Please reconsider the Python support policy #6170
Replies: 2 comments 5 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. |
|
Hi! mm, make a breaking change should not be an issue with SymVer, it only says when something breaks, but the number does not means you API changed, or there is something new, is only a marker to know when something that will break shows, nothing more, so there should not be any issue... But I get that say move from 1.x.x to 2.x.x sounds like a major change, and could be confusing, but SymVer is not perfect, you could up the version with a very big note about from where the breaking change comes. You may want to think a little about SymVer and project dependencies, if any dep make a breaking change, will you always change the major version? if any dep add a new feature which is exposed by your crate, will you also increase the minor version? |
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