-
Notifications
You must be signed in to change notification settings - Fork 15
Support new Python version
Adding support for a new version of Python typically happens in two stages:
- without numba
- with numba
Numba is expected to take 3-6 months to support a new major Python release (for example, numba didn't support Python 3.11 until six months after its release!). Since numba is now an optional dependency (#423), we should try to support a new Python version shortly after numpy, scipy, and pandas support it.
If old (>24 months as per our support policy) versions of dependencies give any difficulty, consider removing support for them.
- Add
"py31x"
to[tool.black.target-version]
- Add
"Programming Language :: Python :: 3.1x",
to[project.classifiers]
- New Python versions often come with new
DeprecationWarning
s andFutureWarning
s. Update these in[tool.pytest.ini_options.filterwarnings]
as necessary. - When numba is supported, update
python_version
in the numba-related dependencies in[project.optional-dependencies]
- For example,
"python-graphblas[numba]; python_version<'3.12'"
- For example,
- Add
3.1x
option to randompyver
(and 1 as weight).- This also tests whether
pip install python-graphblas[default]
works. - Consider using a large weight during testing to test the new Python version
- This also tests whether
- Add
3.1x
option to randompyver
(and 1 as weight)- Consider using a large weight during testing to test the new Python version
- Determine which versions of numpy, scipy, pandas, and awkward support this Python version and randomly choose from them in "Update env" step.
- This can be done by looking at wheels on PyPI and/or download files on anaconda.org to see which Python versions have builds.
- If necessary, handle other dependency versions that cause issues during testing (hopefully unlikely)
- When numba is supported, update the
if
check under "Update env" that checks Python version and randomly chooses to not install numba.
Then test the changes in a PR and viola! That's it!
As a sanity check, I would recommend searching for the previous and new Python versions to make sure the new version has been added everywhere appropriate:
$ git grep 3\.11
$ git grep py311
Update Python version in binder/environment.yml
and docs/env.yml
whenever.
Finally, be aware of any other changes in Python that may impact python-graphblas
and whether some features can be enabled in old Python versions via from __future__ import whatever
.