Please reconsider the Python support policy #6170
robsdedude
started this conversation in
General
Replies: 1 comment 2 replies
|
Why are your library's users on really old versions of Python? PyO3 looks at the cryptography library's download statistics for old Python versions to decide when to drop EOL Pythons. See #4581 for the most recent discussion. If your library is a commercial project, maybe it would be worthwhile maintaining a fork of PyO3 (or paying someone to do it for you) which maintains support for old versions or backports fixes from new versions. |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The Problem
Initially when discovering pyo3, I was really positively surprised to find that it even supported legacy Python versions. However, recently support for Python 3.7 was dropped.
This is a big pain for me developing an extensions module for a Python library. The library follows SemVer and has an LTS branch. That means support for Python versions is kept even after they go EOL.
How to tackle it in Python
It's somewhat straight forward to deal with python dependencies that drop support for said EOL Python versions. Dependencies declared in
pyproject.tomlcan be different versions for depending on the Python version. E.g.,Trying to solve it it with
build.rsIn Rust this isn't possible. Cargo isn't aware of the Python version at the time of having to select the pyo3 version to build against. So I'd have to stick to the newest pyo3 version which is supporting the oldest Python version I want to support. That's an option, but an unfortunate one as it means users of my library will not have access to security fixes (such as the recent possible oob read that got fixed in 0.29.0) even if they are on a non-EOL Python version.
Using
build.rsto check which Python version to build for doesn't seem to be an option either as Cargo doesn't respect feature selection inbuild.rs:Trying to solve it with Cargo features
Maturin does allow to select package features depending on the Python version. Something like
But that doesn't get me anywhere either because adding this to my
Cargo.tomlLeaves me with the following compilation error
All reactions