Releases: PyO3/pyo3
PyO3 0.15.0
This release of PyO3 brings support for Python 3.10 and PyPy 3.8. In addition, new optional dependencies on anyhow
and eyre
have been added for easy integration of the popular error-handling libraries with Python code.
A number of consistency improvements have been made to PyList
, PyTuple
and PySequence
APIs. They now all exclusively use usize
- based indexing, and now also support Rust's indexing operator.
In this release #[pymethods]
are now able to implement many magic methods such as __str__
and __repr__
, removing the need for #[pyproto]
macro implementations. For the 0.15 release series both #[pymethods]
and #[pyproto]
will be supported; #[pyproto]
is expected to be deprecated in the future.
For full details of all changes, see the CHANGELOG. For help with upgrading, see the migration guide.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback.
PyO3 0.14.5
This release fixes a compile regression of PyO3 0.14.4 where not all APIs related to PyStringData
were conditionally disabled correctly on big-endian platforms.
In addition, a few public APIs have been added to the pyo3_build_config
crate to support needs of the PyOxidizer project.
Thanks to @decathorpe and @indygreg for further reports, discussions, and resolution.
PyO3 0.14.4
This release resolves issues with the PyString::data
API added in 0.14.3. After release it was found to be unsound on certain platforms, so has been disabled on those platforms and marked unsafe
with the safety expectation that users will ensure it works appropriately on their platform as part of usage.
Thanks to @decathorpe and @indygreg for the report, discussion, and resolution.
PyO3 0.14.3
This release is a small set of bugfixes added on top of the PyO3 0.14.2 release.
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:
@awestlake87
@davidhewitt
@indygreg
@mejrs
@messense
@mtreinish
@pschafhalter
@Ptrskay3
@sansyrox
@tiran
PyO3 0.14.2
This release is a small quality-of-life update for the PyO3 0.14 release series. Optional support for the indexmap
crate has been added. In addition, there have been a number of documentation improvements, and bugfixes for regressions and incorrect FFI definitions.
Users who removed macOS cargo configuration from their setup after updating to PyO3 0.14 will unfortunately have to once again add configuration to their compilation after updating to this release. This is because PyO3 was using functionality which Cargo had erroneously allowed.
The recommended way to restore configuration for macOS is to add a build script which invokes pyo3_build_config::add_extension_module_link_args()
. The cargo configuration previously recommended is also still an option.
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:
@alex
@awestlake87
@batconjurer
@birkenfeld
@davidhewitt
@deantvv
@Eric-Arellano
@indygreg
@IvanIsCoding
@mejrs
@messense
@nihaals
@tommilligan
PyO3 0.14.1
This release addresses some incorrect FFI definitions in PyO3 0.14.0 which caused crashes when targeting PyPy. In addition, IntoPy<PyObject>
has been implemented for &PathBuf
and &OsString
for additional convenience when working with the new conversions.
Thank you to @alex and @jameshilliard for the quick reports, and @birkenfeld and @messense for the quick fixes!
PyO3 0.14.0
This release contains a significant number of improvements and optimizations since the 0.13 releases. Conversion support for more Rust standard library types has been added: [T; N]
, Path
, PathBuf
, OsStr
, and OsString
. In addition, the #[pyo3(...)]
attribute options already used in #[pyclass]
and #[derive(FromPyObject)]
have been expanded to all macros to cover more options such as #[pyo3(name = "...")]
.
This release also includes some notable performance optimizations to PyO3's Python function generation, and users should observe reductions in overhead when calling PyO3-wrapped functions from Python. The documentation has also benefited from extensive work from several contributors.
Finally, there are a number of breaking changes to this release:
- To reduce the default dependency set, a new feature
multiple-pymethods
has been added. If this feature is not enabled, each#[pyclass]
may only have a single#[pymethods]
block. If this feature is enabled then the previous behavior (and dependency oninventory
) is restored. - The
pyo3::ffi
module has received many updates to keep in sync with CPython's definitions. - A number of APIs and particular usages of PyO3 macros have been marked deprecated where better alternatives now exist.
- A number of previously-deprecated APIs have been removed.
For full details of all changes, see the CHANGELOG. For help with upgrading, see the migration guide.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following users' commits are included in this release:
@alex
@alonblade
@aviramha
@birkenfeld
@c410-f3r
@daggy1234
@daniil-konovalenko
@davidhewitt
@erikjohnston
@GabrielMajeri
@gilescope
@indygreg
@isosphere
@jameshilliard
@kangalioo
@kngwyu
@konstin
@m-ou-se
@mejrs
@messense
@nw0
@ohadravid
@ravenexp
@scalexm
@simonrainerson
@TheGhostHuCodes
@Winxton
@1tgr
PyO3 0.13.2
This release contains small improvements over PyO3 0.13.1. The minimum supported Rust version has been lowered to Rust 1.41. A serde
feature has been added which provides implementations of Serialize
and Deserialize
for types inside the Py<T>
smart pointer.
Of note is that this release disables automatic finalization of the Python interpreter at program exit for Rust binaries embedding the Python interpreter. This was found to cause a number of issues with C extensions such as Tensorflow and Scipy which were sensitive to the deinitialization order. For the vast majority of users this should cause no impact or fix a number of problem cases. For the minority who did depend on finalization, the unsafe method with_embedded_python_interpreter
has been added to manually control the interpreter lifecycle.
For full details of all changes, see the CHANGELOG.
Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback. The following users' commits are included in this release:
@alex
@awestlake87
@birkenfeld
@cfbolz
@daniil-konovalenko
@davidhewitt
@decathorpe
@ijl
@kangalioo
@kngwyu
@lazka
@nw0
@tdamsma
PyO3 0.13.1
This release is a set of quality-of-life improvements and bugfixes for PyO3 0.13.0. All new functionality adds flexibility to pyo3 in rarer cases, such as fixing #[pyclass(dict)]
support for the abi3
feature (on compatible Python versions). In addition, a long-overdue initiative to reconcile PyO3's ffi
definitions with the current state of the upstream Python API has started. This resulted in a number of new deprecations where mismatches were found.
For full details of all changes, see the CHANGELOG.
Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback. The following users' commits are included in this release:
@cecini
@dalcde
@daniil-konovalenko
@davidhewitt
@kngwyu
@konstin
@nw0
@OrangeTux
PyO3 0.13.0
The major feature for this PyO3 release is support for the CPython limited API. This is an opt-in feature when building extension modules which makes it possible for the built wheel to be installable on multiple Python versions.
As well as this, a number of other refinements, fixes, and performance improvements have been merged into this release. In particular, note that the internal "macros" crates have been renamed to pyo3-macros
and pyo3-macros-backend
for clarity and consistency (previously pyo3cls
and pyo3-derive-backend
).
For full details of all changes, see the CHANGELOG.
Thank you to everyone who contributed code, documentation fixes, design ideas, bug reports, and feedback. The following users' commits are included in this release:
@AleksaC
@alex
@Askaholic
@aviramha
@birkenfeld
@daggy1234
@davidhewitt
@dvermd
@kngwyu
@konstin
@Palladinium
@roblabla
@scalexm
@Stranger6667