Commit Graph

3146 Commits

Author SHA1 Message Date
Yuji Kanagawa f0763f069e
Merge pull request #1507 from scalexm/getter-name
Allow `#[name]` with `#[getter]` and `#[setter]`
2021-03-20 16:23:07 +09:00
Yuji Kanagawa acff3b1f3e
Merge pull request #1504 from PyO3/pyclass
Add tuple and unit struct support for pyclass macro
2021-03-20 16:14:15 +09:00
Yuji Kanagawa 873a275ead
Merge pull request #1509 from PyO3/issue-1508
Remove __doc__ from module's __all__
2021-03-20 14:55:29 +09:00
messense acd4601d2f Remove __doc__ from module's __all__ 2021-03-20 11:25:36 +08:00
messense 1c57294214 Use Python::with_gil and py_assert
Co-authored-by: Yuji Kanagawa <yuji.kngw.80s.revive@gmail.com>
2021-03-19 10:17:06 +08:00
messense 2cec240b0e Ban pyo3(get, set) on tuple struct field 2021-03-19 10:17:06 +08:00
messense 773a371ba5 Add tuple and unit struct support for pyclass macro 2021-03-19 10:17:06 +08:00
scalexm b27ee3fd64 Allow `#[name]` with `#[getter]` and `#[setter]` 2021-03-18 19:35:17 +01:00
scalexm adc6e6fe4e Ignore `syn::Type::Group` in `is_python` 2021-03-18 18:56:53 +01: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
dependabot[bot] 01ad9d8e8b
build(deps): update hashbrown requirement from 0.9 to 0.11
Updates the requirements on [hashbrown](https://github.com/rust-lang/hashbrown) to permit the latest version.
- [Release notes](https://github.com/rust-lang/hashbrown/releases)
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.9.0...v0.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-15 05:47:12 +00: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