版本发布 8
This release is the first PyO3 release to be tested against Python 3.14.0 final. There are no significant changes to 3.14 support since PyO3 0.26 which was tested against the 3.14 release candidates. Support for PyPy 3.9 and PyPy 3.10 (both no longer supported upstream) has been dropped. The `FromPyObject` trait has been reworked in a similar fashion to the `IntoPyObject` trait introduced in PyO3 0.23. This has established a performant and flexible implementation of both these traits and no further changes to the traits are anticipated in the future. Thank you for the patience upgrading through these incremental improvements at the core of PyO3. The `.downcast()` family of functions are now deprecated in favour of the `.cast()` family of functions, which are an incremental improvement to API usability and to error messages on failed conversions. Operations on the `PyCapsule` type have been changed without deprecation to fix some issues with lifetimes of return values (in `.name()` and `.reference()` specifically). The capsule API now also encourages checking of capsule names, which is one of the few defences available to protect the validity of casting data read by the capsule API. There are also many other incremental improvements, bug fixes and smaller features. Please consult the [migration guide](https://pyo3.rs/v0.27.0/migration.html) for help upgrading. Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following contributors' commits are included in this release: @alex @altendky @bazaah @bschoenmaeckers @crepererum @davidhewitt @dependabot[bot] @elbaro @Icxolu @jqnatividad @mbrobbel @NilsIrl @rvben @sanders41 @tdyas @Tpt @vvsagar
This version solidifies support for Python 3.14 and free-threaded Python 3.14t. A number of PyO3 APIs have been renamed to reflect the fact the GIL is no longer a universal feature of all Python implementations. For example: - `Python::with_gil` is now known as `Python::attach` - `Python::allow_threads` is now known as `Python::detach` - `pyo3::prepare_freethreaded_python` is now known as `Python::initialize()` The minimum supported Rust version has been increased to Rust 1.74. An optional dependency on the `bytes` crate has been added to allow support for converting `bytes::Bytes` to / from Python. The `PyObject` type alias for `Py<PyAny>` has also been deprecated; the `Py` and `Bound` smart pointers have been the primary interface for all Python-facing types since PyO3 0.21 and the `PyObject` type alias had been a frequent source of confusion. There are also many other incremental improvements, bug fixes and smaller features. Please consult the [migration guide](https://pyo3.rs/v0.26.0/migration.html) for help upgrading. Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following contributors' commits are included in this release: @ahlinc @alex @anilbey @bschoenmaeckers @Cheukting @codeguru42 @davidhewitt @decathorpe @dependabot[bot] @drewkett @FlickerSoul @Icxolu @jder @jessekrubin @jjmarchewitz @kemingy @msimacek @musicinmybrain @ngoldbaum @Nnamdi-sys @nucccc @olp-cs @robsdedude @rrricharrrd @sxlijin @timfel @tonybaloney @Tpt @wxianxin @xushiyan @yogevm15
This version extends Python version support to include the new Python 3.14, currently in beta. Please note it is possible that there may yet be changes to 3.14 before stable release which may impact final compatibility. New optional dependencies on `bigdecimal`, `ordered_float`, and `time` have been added to permit converting types from those crates to Python types (and vice versa). The `experimental-inspect` feature now has the capability to autogenerate type stubs. These stubs are still extremely basic and lack much information. Tooling such as `setuptools-rust` and `maturin` will also need to be updated to make adoption of these easier. Please follow https://github.com/PyO3/pyo3/issues/5137 to keep abreast of developments of this feature. The `#[pyclass]` macro has gained new options `#[pyclass(generic)]` and `#[pyclass(immutable_type)]` to offer additional control over the runtime behaviour of the generated Python type object. The `AsPyPointer` trait has been removed as PyO3's smart pointer types such as `Py<T>`, `Bound<T>` and `Borrowed<T>` covered this use case with a better API. As part of the upgrade to support 3.14, there have also been many cleanups to `pyo3-ffi`. Many definitions which are private implementation details of CPython have been removed; projects downstream of CPython cannot rely on stability of these even across CPython patch releases. There are also many other incremental improvements, bug fixes and smaller features. Please consult the [migration guide](https://pyo3.rs/v0.25.0/migration.html) for help upgrading. Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following contributors' commits are included in this release: @0x676e67 @bschoenmaeckers @clin1234 @davidbrochart @davidhewitt @ddelange @decathorpe @dependabot[bot] @exg @hgmich @Icxolu @IvanIsCoding @m-ou-se @n-eq @ngoldbaum @Owen-CH-Leung @prutschman-iv @superserious-dev @Tpt @trim21 @Vrajs16 @xhochy
This is a small patch release containing minor bugfixes and documentation improvements, including an unused imports lint warning raised from inside PyO3's proc macros. Thank you to the following contributors for the improvements: @davidbrochart @davidhewitt @ddelange @decathorpe @hgmich @Icxolu @n-eq @Tpt @trim21
This release is a security fix for the `PyString::from_object` method, which passed `&str` data to the Python C API without checking for a terminating nul byte. All historical PyO3 versions are affected, and we recommend you upgrade if you are using `PyString::from_object`. Thank you to @vthib for the report and @Dr-Emann for the fix. A RUSTSEC advisory will be published shortly. Aside from the security fix, this release contains a number of other non-breaking additions: - An `abi3-py313` feature to support compiling with the Python 3.13 stable ABI. - `PyAnyMethods::getattr_opt` to get optional attributes without paying the cost of a Python exception when the attribute in question does not exist. - Constructor for `PyInt::new`. - `with_critical_section2` for locking two objects at the same time on the free-threaded build. - Fix for a PyO3 0.24.0 regression with `Option<&str>` and `Option<&T>` (where `T: PyClass`) function arguments no longer being permitted There are also a few other small bug fixes for edge cases, mostly related to compile errors from PyO3's macro code. Thank you to the following contributors for the improvements: @bschoenmaeckers @davidhewitt @Dr-Emann @emmagordon @epontan @Icxolu @IvanIsCoding @jelmer @jonaspleyer @ngoldbaum @Owen-CH-Leung @Tpt @Trolldemorted @XuehaiPan
This release is an incremental improvement of refinements and optimizations following the new APIs established in PyO3's last few releases. Support for `jiff` datetime conversions have been added, and also UUID conversions. The `FromPyObject` derive macro has gained new `#[pyo3(default = ...)]` and `#[pyo3(rename_all = ...)]` options, and the `IntoPyObject` derive macro has gained a new `#[pyo3(into_py_with = ...)]` option. PyO3 will now pass positional arguments to Python functions using the "vectorcall" protocol in many cases, which should be an optimization over the previous behaviour (of creating a Python tuple of positional arguments). Many methods on iterators of Python collections have been optimized. There are also many other incremental improvements, bug fixes and smaller features. Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following contributors' commits are included in this release: @0x676e67 @alex @arielb1 @bschoenmaeckers @davidhewitt @dependabot[bot] @eltociear @Icxolu @IvanIsCoding @JeanArhancet @kahojyun @kemingy @kylebarron @LifeLex @LilyFoote @lundybernard @matt-codecov @mattip @mejrs @messense @msimacek @ngoldbaum @nicolasavru @Owen-CH-Leung @peterjoel @SilverBzH @Tpt @yoav-orca @yotamofek
This release contains a range of fixes on top of PyO3 0.23.3, primarily grouped into the following categories: - Fixes for the new support for free-threaded Python 3.13 - Fixes to conversions between Python and `chrono` datetimes - Fixes to various build configuration cases for Windows - Fixes to edge cases in PyO3's macros leading to compile failures Thank you to the following contributors for the improvements: @alex @bschoenmaeckers @davidhewitt @Icxolu @kahojyun @LilyFoote @mejrs @messense @msimacek @ngoldbaum @Owen-CH-Leung @Tpt
**_This release is a soundness fix for PyO3 0.23.0 through 0.23.2._** In PyO3 0.23.0 the `PYO3_CONFIG_FILE` environment variable used to configure builds regressed such that changing the environment variable would no longer trigger PyO3 to reconfigure and recompile. In combination with workflows using tools such as `maturin` to build for multiple versions in a single build, this leads to Python wheels being compiled against the wrong Python API version. All users who distribute artefacts for multiple Python versions are encouraged to update and rebuild with PyO3 0.23.3. Affected wheels produced from PyO3 0.23.0 through 0.23.2 are highly unstable and will crash the Python interpreter in unpredictable ways. Aside from this fix, PyO3 0.23.3 contains some fixes to link configuration for Python 3.13t on Windows. Thank you to the following contributors for the improvements: @davidhewitt @Icxolu @kemingy