Commit Graph

3712 Commits

Author SHA1 Message Date
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
David Hewitt 4c80ce93c3
Merge pull request #1469 from PyO3/deny-pypy-and-abi3
Show warning when abi3 is used with PyPy
2021-03-06 23:09:38 +00:00
David Hewitt a45f520ec1
Merge pull request #1457 from davidhewitt/multiple-pymethods
pymethods: make inventory optional
2021-03-06 23:09:02 +00:00
David Hewitt 23b5fe9e69 ffi: add _Py_InitializeMain 2021-03-06 22:45:19 +00:00
David Hewitt 7ed53b72fa ffi: update PyConfig for Python 3.10 2021-03-06 16:48:34 +00:00
David Hewitt 9ef330d21c ffi: move initconfig.rs to cpython/initconfig.rs 2021-03-06 16:48:34 +00:00
Yuji Kanagawa 7c1cc29612
Apply suggestions from birkenfeld
Co-authored-by: Georg Brandl <georg@python.org>
2021-03-06 23:59:46 +09:00
David Hewitt e19c083a81 ci: fix nightly warnings 2021-03-06 09:42:50 +00:00
Yuji Kanagawa 6f8f958f34
Apply suggestions from code review
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-03-06 18:03:17 +09:00
kngwyu a591b55219 Architecture.md: Initial draft 2021-03-06 17:52:54 +09:00
kngwyu 4ec78e6b18 Warning when 'abi3' is used with PyPy 2021-03-06 12:52:32 +09:00
Yuji Kanagawa fa50c11ac4
Merge pull request #1468 from davidhewitt/docs-warnings
docs: deny warnings in ci
2021-03-05 15:13:37 +09:00
David Hewitt bb6d4df497 multiple-pymethods: documentation updates 2021-03-04 23:03:26 +00:00
David Hewitt 977735db20 pymethods: make inventory optional 2021-03-04 19:52:58 +00:00
David Hewitt 1dcda8809d docs: deny warnings in ci 2021-03-04 19:41:11 +00:00
David Hewitt 525358a33c
Merge pull request #1458 from davidhewitt/simplify-ci
ci: simplify workflow
2021-03-04 19:37:53 +00:00
David Hewitt 85c7ecb36e ci: simplify workflow 2021-03-04 11:53:27 +00:00
David Hewitt 74fee84654
Merge pull request #1467 from birkenfeld/module_call
PyModule: rename call* to call_function*
2021-03-04 10:56:16 +00:00
Georg Brandl e065f9b517 PyModule: rename call* to call_function*
For consistency with PyObject/PyAny, where call() means to call the
object itself.
2021-03-04 09:29:28 +01:00
Yuji Kanagawa 21b26fcf3a
Merge pull request #1440 from davidhewitt/fix-multiple-kw-only-arg
pyfunction: refactor argument extraction
2021-03-04 00:15:34 +09:00
Yuji Kanagawa 5bee2af141
Merge pull request #1464 from PyO3/update_maturin_setuptools_rust_comparison
Update setuptools-rust/maturin comparison
2021-03-04 00:13:15 +09:00
konstin 7dfb4c353d Update setuptools-rust/maturin comparison
I tried to make differences clearer and make it a bit less biased towards maturin
2021-03-03 11:40:21 +01:00
David Hewitt df2146c2d2
Merge pull request #1461 from Daggy1234/patch-1
example: add polaroid
2021-03-03 08:53:58 +00:00
Arnav Jindal c889bcbeee
example: add polaroid 2021-03-03 10:36:30 +05:30
David Hewitt 67b1a61ac5
Merge pull request #1455 from PyO3/generate-less-code
Generate less code
2021-03-01 22:32:29 +00:00
konstin 19bcce51dd Use a where clause 2021-03-01 20:31:00 +01:00