Commit Graph

3087 Commits

Author SHA1 Message Date
messense 773a371ba5 Add tuple and unit struct support for pyclass macro 2021-03-19 10:17:06 +08:00
Yuji Kanagawa 20452a7c09
Merge pull request #1471 from kngwyu/architecture
Architecture.md: Initial draft
2021-03-18 17:12:17 +09:00
Yuji Kanagawa dacdc68b26
Merge branch 'main' into architecture 2021-03-18 15:54:52 +09:00
David Hewitt f22fb423cb
Merge pull request #1503 from davidhewitt/main-tweaks
main: tweaks from rename
2021-03-17 21:07:58 +00:00
David Hewitt 971b48f091
Update guide/src/parallelism.md
Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
2021-03-17 07:02:29 +00:00
Yuji Kanagawa acf7271879
Merge pull request #1494 from PyO3/enhance-py-run
Extend py_run! to take locals dict and refactor tests using it
2021-03-17 12:52:33 +09:00
Yuji Kanagawa 6137e3a726
Merge pull request #1456 from davidhewitt/pyclass-impl-flags
pyclass: move flags to PyClassImpl
2021-03-17 12:50:49 +09:00
David Hewitt 4d2913dc06 main: tweaks from rename 2021-03-16 22:14:57 +00:00
messense c0d49052b5
Merge pull request #1502 from messense/check-buffer
Check buffer protocol support before getting buffer in sequence protocol specialization
2021-03-16 16:17:37 +08:00
David Hewitt dab62a5835
Merge pull request #1495 from davidhewitt/macros-wrapper-expressions
macros-backend: make __wrap fns expressions
2021-03-16 07:26:15 +00:00
messense ba7644849d Check buffer protocol support before getting buffer in sequence protocol specialization
This avoids calling a expensive `PyErr_Format` inside of
`PyObject_GetBuffer` when buffer protocol is unsupported
2021-03-16 13:32:14 +08:00
kngwyu 603d81f9ef Python C/API -> Python/C API 2021-03-15 22:20:22 +09:00
messense b7376da739
Merge pull request #1498 from messense/func-name
Fix wrong class name in function call error message
2021-03-15 17:21:28 +08:00
messense e6374240b1 Get rid of _LOCATION 2021-03-15 16:47:25 +08:00
messense 10339ea61f Add `()` inside of `FunctionDescription::full_name()`
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-15 16:20:55 +08:00
messense c70eba1aaa Fix wrong class name in function call error message 2021-03-15 14:24:19 +08:00
David Hewitt 3891788aa7 macros-backend: make __wrap fns expressions 2021-03-14 17:21:57 +00:00
Yuji Kanagawa bbca585002
Apply some more suggestions from davidhewitt for Architecture.md
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-14 23:48:49 +09:00
kngwyu 9b88a452e2 Refactor tests to use shorter macros 2021-03-14 23:43:53 +09:00
David Hewitt 6ab61a1560
Merge pull request #1492 from davidhewitt/no-pymodule-call-function
pymodule: remove call_function etc.
2021-03-14 12:50:15 +00:00
David Hewitt b10cefdca2 pymodule: remove call_function etc. 2021-03-14 11:19:55 +00:00
David Hewitt 648759ad3d
Merge pull request #1493 from davidhewitt/pymodule-cleanups
pymodule: misc cleanups
2021-03-14 11:14:55 +00:00
kngwyu 7ec1fed798 Extend py_run! macro to take dict as *d syntax 2021-03-14 16:33:49 +09:00
David Hewitt d9fe404d69 [review] kngwyu 2021-03-14 00:50:59 +00:00
David Hewitt 66b3022d0e
Merge pull request #1483 from davidhewitt/macros-tidy-ups
pymethods: macros tidy-ups
2021-03-14 00:09:23 +00:00
Matthew Scheffel e24f29dbf5
Add context manager example to user guide (#1476)
* Add context manager example

A simple illustrative example on how to use context managers. I required this to use pymc3, which relies heavily on the context stack for modelling.

* Clippy changes to context example

* Extend context manager example with exit exceptions

* Context manager, s/call1/call_method1/ and comments for clarity

* Add newline to context manager section to avoid horizontal scrolling

* Change generic, potentially confusing label.

s/objects.py/house.py/

* Use call_function1 rather than call_method1.

* Missed a call_method0, change to call_function0

* Update guide/src/python_from_rust.md

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>

* Update guide/src/python_from_rust.md

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-13 22:54:13 +00:00
David Hewitt 31c7af2ac7 pyclass: move flags to PyClassImpl 2021-03-13 22:44:53 +00:00
David Hewitt bff39d8871 pymodule: misc cleanups 2021-03-13 22:24:37 +00:00
kngwyu 78c41831f3 [Architecture] Cover more topics and mention in Contributing 2021-03-13 16:39:16 +09:00
Yuji Kanagawa d3dc031b22
Merge pull request #1487 from messense/sysconfigdata-name
Use _PYTHON_SYSCONFIGDATA_NAME in find_sysconfigdata when cross-compiling
2021-03-13 14:59:00 +09:00
messense 9199c78e1b Update build.rs
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-12 16:56:14 +08:00
messense 884cd9d726 Apply suggestion from code review
Co-authored-by: kngwyu <yuji.kngw.80s.revive@gmail.com>
2021-03-12 16:56:14 +08:00
messense b9a2c64157 Use _PYTHON_SYSCONFIGDATA_NAME in find_sysconfigdata when cross-compiling 2021-03-12 16:56:14 +08:00
messense 5014b60e5e
Merge pull request #1489 from davidhewitt/fix-msrv-matches
msrv: remove use of matches! macro
2021-03-12 16:55:41 +08:00
David Hewitt e55fe205ed msrv: remove use of matches! macro 2021-03-12 07:28:49 +00:00
Yuji Kanagawa b75a8f6e8b
Merge pull request #1486 from davidhewitt/pyfunction-generic-argument
pyfunction: reject generic functions
2021-03-12 00:09:24 +09:00
David Hewitt 9613228a0c pyfunction: reject generic functions 2021-03-09 23:47:47 +00:00
David Hewitt 78080ebbd2 macros-backend: support noargs for pyproto py_methods 2021-03-08 23:56:08 +00:00
David Hewitt abe19e2ecc macros-backend: flatten call structure 2021-03-08 23:07:12 +00:00
David Hewitt fe75b2da59
Merge pull request #1482 from PyO3/dependabot/cargo/num-complex-0.4
build(deps): update num-complex requirement from 0.3 to 0.4
2021-03-08 22:06:51 +00:00
David Hewitt 5e44c2b0d6
Merge pull request #1473 from davidhewitt/initconfig-limited-api
ffi: move initconfig.rs to cpython/initconfig.rs
2021-03-08 21:59:58 +00:00
David Hewitt 993d461287 changelog: add entry for num-complex update 2021-03-08 21:35:50 +00:00
dependabot[bot] 6573cb1b96 build(deps): update num-complex requirement from 0.3 to 0.4
Updates the requirements on [num-complex](https://github.com/rust-num/num-complex) to permit the latest version.
- [Release notes](https://github.com/rust-num/num-complex/releases)
- [Changelog](https://github.com/rust-num/num-complex/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-complex/compare/num-complex-0.3.0...num-complex-0.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-08 21:35:35 +00:00
David Hewitt 52555eb7a7
Merge pull request #1481 from PyO3/dependabot/cargo/num-bigint-0.4
build(deps): update num-bigint requirement from 0.3 to 0.4
2021-03-08 08:52:27 +00:00
David Hewitt 818039ff93 changelog: add entry for num-bigint update 2021-03-08 08:03:05 +00:00
David Hewitt ce1aa3172b
Merge pull request #1479 from davidhewitt/no-examples-glob
cargo.toml: don't use a glob for examples
2021-03-08 07:10:06 +00:00
dependabot[bot] adcc4719d2
build(deps): update num-bigint requirement from 0.3 to 0.4
Updates the requirements on [num-bigint](https://github.com/rust-num/num-bigint) to permit the latest version.
- [Release notes](https://github.com/rust-num/num-bigint/releases)
- [Changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-bigint/compare/num-bigint-0.3.0...num-bigint-0.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-08 05:49:06 +00:00
David Hewitt 72e6dc6618 cargo.toml: don't use a glob for examples 2021-03-07 22:48:56 +00:00
Yuji Kanagawa cca560649e
Apply suggestions from davidhewitt
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-07 23:26:45 +09:00
David Hewitt d75d109aee
Merge pull request #1472 from davidhewitt/nightly-warnings
ci: fix nightly warnings
2021-03-06 23:10:48 +00:00