UCL / dxh

Collection of helper functions for working with DOLFINx Python interface
http://github-pages.ucl.ac.uk/dxh/
MIT License
3 stars 0 forks source link

Allow for newer Python versions in `python_requires` and consider removing support for Python 3.9 #17

Open matt-graham opened 4 months ago

matt-graham commented 4 months ago

Currently we require Python 3.9 or 3.10

https://github.com/UCL/dxh/blob/6466c60e18d9fec0cb0e7b8e308b44cb781222d8/pyproject.toml#L48

which I think is because previously this is the only Python versions there was fenics-dolfinx releases for on conda-forge. As dxss depends on dxh this also restrict the Python versions dxss can use. The v0.7.3 release of fenics-dolfinx has package builds for Python 3.8 through to 3.12 so we can relax the Python requirements here to allow any version after 3.9. Given by NEP29 timeline current support would be for Python 3.10+ we might also want to consider dropping support for Python 3.9 at the same time. This would also allow us to use for example the X | Y syntax for unions in type hints.

@samcunliffe do you have any thoughts on dropping Python 3.9 support?

samcunliffe commented 4 months ago

We could always do

from __future__ import annotations

...and maintain 3.9 with the nice "or" syntax.

But unless @janoschpreuss is using Python 3.9, I say: drop it. There's no reason -- as far as I can think -- to keep. And dropping makes us nicely ahead of the Python support schedule.

Even if we decide not to drop 3.9, should we add tests for a few more recent versions? https://github.com/UCL/dxh/blob/6466c60e18d9fec0cb0e7b8e308b44cb781222d8/.github/workflows/tests.yml#L16

matt-graham commented 4 months ago

Yeah definitely agree on testing on newer versions.

With regards to Python 3.9 - I hadn't actually realized from __future__ import annotations also allowed usage of | for unions in Python 3.9! Not really relevant for us but it seems like this might be somewhat dependent on actual type checker being used however as this StackOverflow thread suggests doesn't work with pydantic in Python 3.9.

For now I think I'll just open a PR to relax upper range of allowed Python versions so we can also relax in dxhh but will hold off on dropping Python 3.9 support till we confirm definitely not needed.