Are your dependencies ready for new Python?
MIT License
Are your dependencies ready for new Python?
pip install python_readiness
Alternatives include:
uvx python_readiness
Check if a specific package is ready for a specific Python:
python_readiness -p numpy --python 3.11
This will print the requirement you need to ensure that numpy supports that Python:
python_readiness -p numpy --python 3.13
numpy>=2.1.0 # has_classifier_and_explicit_wheel
python_readiness -p numpy --python 3.12
numpy>=1.26.0 # has_classifier_and_explicit_wheel
python_readiness -p numpy --python 3.11
numpy>=1.23.3 # has_classifier_and_explicit_wheel
python_readiness -p 'numpy>=2' --python 3.11
numpy>=2 # has_classifier_and_explicit_wheel (existing requirement ensures support)
Check if a requirements file is ready for a specific Python:
python_readiness -r requirements.txt --python 3.13
This will output new requirements that ensure your environment is restricted to versions that will support the specified Python version. In particular, look at lines containing "previously". These are the minimum versions you will need to upgrade to for support.
I find this really useful for updating constraints files when incrementally upgrading a large codebase to a new Python.
Check if your current environment is ready for the latest Python:
python_readiness
Check if another virtual environment is ready for the latest Python:
python_readiness -e path/to/.venv
See all options:
python_readiness --help
Take a look at the code, in particular support_from_files
.
It's primarily based on wheel tags and classifiers, but looks at some other metadata and has a few interesting tricks.
python_readiness
currently classifies package versions as one of the following levels of support:
Explicitly supported:
has_classifier_and_explicit_wheel
has_classifier
and has_explicit_wheel
are true.has_classifier
has_explicit_wheel
is_requires_python_lower_bound
Requires-Python: >=3.9
then the package explicitly supports 3.9.Potentially supported:
has_viable_wheel
totally_unknown
Unsupported:
unsupported
Also, if you're interested in looking at the code the bisection code we use to find earliest supported versions is interesting, since it can handle non-monotonic support, e.g. in the case of backports.