This release corrects a failure to compile of the either feature when the experimental-inspect feature is not enabled.
It also adds backwards-compatibility for pyo3 0.20.0 to build against pyo3-build-config 0.20.2, as pyo3 0.20.0 was (unintentionally) not pinned against an exact patch version pyo3-build-config, and pyo3 0.20.0 could not build against pyo3-build-config 0.20.1 due to an internal API adjustment.
Thank you to the following users for the improvements:
This release is the first PyO3 release to be dual-licensed under Apache 2.0 OR MIT licensing (expanding from just Apache 2.0 of previous releases).
Python 3.12 stable is now supported. The minimum supported Rust version has been increased to Rust 1.56.
The __eq__, __ne__, __lt__, __le__, __gt__ and __ge__ magic methods are now usable in #[pymethods] to implement Python operators as an alternative to the __richcmp__ method PyO3 already offered.
#[pyclass(rename_all = "renaming_rule")] has been added to rename all fields of structs exposed to Python (e.g. rename_all = "snake_case") .
PyDict::get_item now returns Result<Option<&PyAny>> instead of just Option<&PyAny>. The previous implementation which ignored Python errors used APIs now considered deprecated by the Python language designers; it is now considered best practice to bubble up any exception raised during dictionary __getitem__. For most users migration for this change will simply require addition of a ? on each use of PyDict::get_item.
Note that Python 3.7 is end of life but PyO3 will continue to support for now as a number of downstream Python packages still have high proportions of downloads on 3.7. A future release is expected to drop Python 3.7 when these numbers reduce.
There have been numerous other smaller improvements, changes and fixes. For full details see the CHANGELOG.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following users' commits are included in this release:
Pin pyo3 and pyo3-ffi dependencies on pyo3-build-config to require the same patch version, i.e. pyo3 0.20.2 requires exactlypyo3-build-config 0.20.2. #3721
Fixed
Fix compile failure when building pyo3 0.20.0 with latest pyo3-build-config 0.20.X. #3724
Add as_ptr and into_ptr inherent methods for Py, PyAny, PyRef, and PyRefMut. #3359
Implement DoubleEndedIterator for PyTupleIterator and PyListIterator. #3366
Add #[pyclass(rename_all = "...")] option: this allows renaming all getters and setters of a struct, or all variants of an enum. Available renaming rules are: "camelCase", "kebab-case", "lowercase", "PascalCase", "SCREAMING-KEBAB-CASE", "SCREAMING_SNAKE_CASE", "snake_case", "UPPERCASE". #3384
Add FFI definitions PyObject_GC_IsTracked and PyObject_GC_IsFinalized on Python 3.9 and up (PyPy 3.10 and up). #3403
Add types for None, Ellipsis, and NotImplemented. #3408
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps pyo3 from 0.19.2 to 0.20.2.
Release notes
Sourced from pyo3's releases.
... (truncated)
Changelog
Sourced from pyo3's changelog.
... (truncated)
Commits
bcef18b
release: 0.20.2fa6d60b
Use a definite version specification when depending on pyo3-build-config.f9f0bdd
Merge pull request #3724 from davidhewitt/fix-build-config-issuecf21325
re-add emit_pyo3_cfgs for pyo3 0.20.0 compatibilityf789385
Merge pull request #3722 from PyO3/fix-doc-build9120b35
Include the experimental-inspect feature for the docs.rs build thereby making...2e79c55
Add CI job to test the equivalent of a docs.rs build.2564ca4
Fix missing feature flags in implementation of Either conversion.be4d562
Merge pull request #3713 from PyO3/release-0.20.1d3f034a
release: 0.20.1Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show