Skip to content

Releases: PyO3/pyo3

PyO3 0.16.0

27 Feb 23:39
Compare
Choose a tag to compare

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:

@adamreichold
@aganders3
@Amanieu
@aviramha
@birkenfeld
@b05902132
@CarlKCarlK
@cmpute
@danielhenrymantilla
@davidhewitt
@DSPOM2
@ghuls
@Gobot1234
@kevinheavey
@konstin
@mejrs
@messense
@milesgranger
@mrl5
@parsons20
@ricohageman
@saidvandeklundert
@Tom1380
@vxgmichel

PyO3 0.15.1

19 Nov 10:06
Compare
Choose a tag to compare

This release is a set of bug fixes for some minor issues reported since PyO3 0.15's release. There are also some small additions for those storing PyIterator, PySequence, and PyMapping in Py smart pointers, and a PyTraceback type to ease interacting with Python tracebacks from Rust.

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:

@dansvo
@davidhewitt
@KRunchPL
@mejrs
@messense
@moriyoshi
@saidvandeklundert
@taiki-e

PyO3 0.15.0

03 Nov 23:04
Compare
Choose a tag to compare

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

05 Sep 14:02
Compare
Choose a tag to compare

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

29 Aug 06:56
Compare
Choose a tag to compare

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

22 Aug 00:20
Compare
Choose a tag to compare

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

09 Aug 08:03
Compare
Choose a tag to compare

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

04 Jul 21:22
Compare
Choose a tag to compare

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

03 Jul 21:27
Compare
Choose a tag to compare

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 on inventory) 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

12 Feb 23:33
Compare
Choose a tag to compare

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