Retire PyO3 v0.19, v0.20, and v0.21
Summary
The Rust SIG currently maintains five (5) versions of PyO3, the Rust bindings for CPython / PyPy. This proposal is about dropping the three oldest versions (v0.19, v0.20, and v0.21), while keeping the two most recent ones (v0.22, v0.23).
Owner
- Name: Fabio Valentini for the Rust SIG
- Email: decathorpe (at) gmail (dot) com
- Name: Michel Lind
Current status
- Targeted release: Fedora Linux 42
- Last updated: 2025-01-06
- Announced
- Discussion thread
- FESCo issue: <will be assigned by the Wrangler>
- Tracker bug: <will be assigned by the Wrangler>
- Release notes tracker: <will be assigned by the Wrangler>
Detailed Description
Old branches of PyO3 are not guaranteed to keep working with newer versions of CPython due to API and / or ABI changes (for interfaces outside the "Limited API"). PyO3 upstream also does not backport bugfixes to older branches - so we cannot maintain old branches of PyO3 downstream indefinitely.
The number of Python packages that depend on these three old versions is already small, and all of them either already have stable releases with support for PyO3 v0.22+, or have pull requests for porting to PyO3 v0.22+ that are being worked on:
- pyo3 v0.19:
- python-pendulum: already ported to pyo3 v0.22 upstream, not yet part of a release
- python-watchfiles: already ported to pyo3 v0.23 in version 1.0.0 and later, which also add support for the free-threaded Python interpreter
- pyo3 v0.20:
- python-bcrypt: already ported to pyo3 v0.22+ in version 4.2.0 and later
- python-libcst: work-in-progress port to pyo3 v0.22
- pyo3 v0.21:
- fapolicy-analyzer: work-in-progress port to pyo3 v0.22
Feedback
N/Y
Benefit to Fedora
Dropping support for old versions of PyO3 pushes dependent Python projects to use versions of PyO3 that officially support the latest CPython versions. Ongoing maintenance cost for removed old versions is eliminated, resulting in less work for members of the Rust SIG, and fewer old packages in Fedora.
Scope
- Proposal owners:
Retire the following packages:
rust-pyo3_0.19 rust-pyo3-build-config0.19 rust-pyo3-ffi0.19 rust-pyo3-macros0.19 rust-pyo3-macros-backend0.19 rust-pyo3_0.20 rust-pyo3-build-config0.20 rust-pyo3-ffi0.20 rust-pyo3-macros0.20 rust-pyo3-macros-backend0.20 rust-pyo3_0.21 rust-pyo3-build-config0.21 rust-pyo3-ffi0.21 rust-pyo3-macros0.21 rust-pyo3-macros-backend0.21
Rust SIG members can provide Pull Requests for updating dependent Python packages to versions that bump the PyO3 dependency to v0.22 or later, or backporting upstream changes if they have not yet been released.
- Other developers:
Maintainers of affected Python packages (or Python Packagers SIG members) need to update affected packages and / or merge Pull Requests.
- Release engineering:
N/A
- Policies and guidelines:
N/A (not needed for this Change)
- Trademark approval:
N/A (not needed for this Change)
- Alignment with the Fedora Strategy:
Maybe?
Upgrade/compatibility impact
Native Python extensions built using PyO3 / Rust are statically linked, and do not pull in Rust libraries at install. The packages that are retired as part of this Change are not installed on user systems.
How To Test
Dependent Python packages should continue to work fine when updated and / or built with PyO3 v0.22 or v0.23.
There should be no packages in the Fedora repositories that pull in older versions (v0.21, v0.20, or v0.19).
User Experience
Building these Python extensions with recent versions of PyO3 should improve support for the latest versions of CPython, including official support for Python 3.13+ and / or support for running on a free-threaded Python interpreter.
Dependencies
Affected Python packages:
- fapolicy-analyzer
- python-bcrypt
- python-libcst
- python-pendulum
- python-watchfiles
Contingency Plan
- Contingency mechanism:
If any dependent package cannot be updated and / or ported to use PyO3 v0.22+, the retirement for the respective PyO3 packages can be postponed to a later release of Fedora.
- Contingency deadline:
Final Freeze.
- Blocks release?
N/A (not a System Wide Change)
Documentation
Release Notes
The packages for obsolete versions of PyO3 (v0.21, v0.20, and v0.19), the Rust bindings for CPython and PyPy, were removed from Fedora. All Python packages that contain native Python extensions written in Rust are now built with PyO3 v0.22 or later, bringing official support for Python 3.13 and / or support for running on a "free-threaded" Python interpreter.