This release contains a couple of fixes for regressions in PyO3 0.16.0, as well as documentation fixes. The hashbrown optional dependency range has been extended to include its new 0.12 version.
Thank you for the following users for the improvements:
This release contains substantial changes and improvements over PyO3 0.15.1. To support these improvements, support has been dropped for the end-of-life Python 3.6 and Rust versions older than 1.48.
The pyo3::ffi submodule has been split out into a separate pyo3-ffi crate, so that users who want to use PyO3's Python bindings without any of the safe APIs or macros are able to do so.
#[pyclass] can now be used on simple "C-like" enums to create Python enums.
The #[pyproto] macro has been deprecated, and can be disabled by disabling the optional #[pyproto] feature. The "magic methods" such as __repr__ which previously were implemented by #[pyproto] gained support in #[pymethods] in 0.15, and now in PyO3 0.16 #[pymethods] is intended to be the only attribute macro needed to write class method implementations.
There are numerous other reworks, improvements, and bugfixes.
For full details of all changes, 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:
Add #[pyo3(crate = "some::path")] option to all attribute macros (except the deprecated #[pyproto]). #2022
Enable create_exception! macro to take an optional docstring. #2027
Enable #[pyclass] for fieldless (aka C-like) enums. #2034
Add buffer magic methods __getbuffer__ and __releasebuffer__ to #[pymethods]. #2067
Add support for paths in wrap_pyfunction and wrap_pymodule. #2081
Enable wrap_pyfunction! to wrap a #[pyfunction] implemented in a different Rust module or crate. #2091
Add PyAny::contains method (in operator for PyAny). #2115
Add PyMapping::contains method (in operator for PyMapping). #2133
Add garbage collection magic magic methods __traverse__ and __clear__ to #[pymethods]. #2159
Add support for from_py_with on struct tuples and enums to override the default from-Python conversion. #2181
Add eq, ne, lt, le, gt, ge methods to PyAny that wrap rich_compare. #2175
Add Py::is and PyAny::is methods to check for object identity. #2183
Add support for the __getattribute__ magic method. #2187
Changed
PyType::is_subclass, PyErr::is_instance and PyAny::is_instance now operate run-time type object instead of a type known at compile-time. The old behavior is still available as PyType::is_subclass_of, PyErr::is_instance_of and PyAny::is_instance_of. #1985
Rename some methods on PyErr (the old names are just marked deprecated for now): #2026
pytype -> get_type
pvalue -> value (and deprecate equivalent instance)
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 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.15.1 to 0.16.1.
Release notes
Sourced from pyo3's releases.
... (truncated)
Changelog
Sourced from pyo3's changelog.
... (truncated)
Commits
7056bae
release: 0.16.10f1b8dd
Merge pull request #2207 from davidhewitt/tidy-doctests01d8f1e
added missing proc-macro invocation to migration guide (#2209)2bd64c4
guide: tidy up doctests576818d
Merge pull request #2205 from JerzySpendel/typingeaa82b2
Remove typying43d4f5e
Merge pull request #2204 from messense/fixup-changeloge4c5698
Fix up changelog entry for[#2197](https://github.com/pyo3/pyo3/issues/2197)
ad2c1af
Merge pull request #2201 from messense/aarch64-apple-darwinc339550
Merge pull request #2197 from PyO3/bump-hashbrownDependabot 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 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)