Skip to content

Drop support for NumPy 1.x and Python 3.10; test with Python 3.15 and NumPy 2.5 - #277

Open
apdavison wants to merge 2 commits into
python-quantities:masterfrom
apdavison:update-supported-versions
Open

apdavison wants to merge 2 commits into
python-quantities:masterfrom
apdavison:update-supported-versions

Conversation

@apdavison

Copy link
Copy Markdown
Contributor

Following the policy of NEP 29 plus one year, this PR drops support for NumPy 1.24–1.26 and Python 3.10. Their drop dates were 2025-12-18 (NumPy 1.24), 2026-06-17 (1.25), 2026-09-16 (1.26) and 2026-04-04 (Python 3.10). It also adds Python 3.15 and NumPy 2.5 to the CI matrix.

With NumPy 1.x gone, the _np_version < (2, 0, 0) code paths in quantity.py and dimensionality.py can be removed. I've left that for a separate PR.

CI now installs the latest patch release of each NumPy minor version rather than the .0 release, which lacks wheels for some Python versions that later patch releases support. NumPy 2.0–2.4 have no Python 3.15 wheels, so those jobs build NumPy from source.

Also fixes mypy with NumPy 2.5, where numpy.typing.NDArray can no longer be used as a base class.

NumPy 2.5 defines `numpy.typing.NDArray` with a PEP 695 `type` statement, which cannot be used as a base class, so `mypy` fails on `class Quantity(npt.NDArray)`. The stub now subclasses `np.ndarray[Any, np.dtype[Any]]` directly, which works with all supported NumPy versions.
Following the policy of NEP 29 plus one year, drop support for Python 3.10 and NumPy 1.24–1.26, and add CI testing for Python 3.15 and NumPy 2.5.

CI now installs the latest patch release of each NumPy minor version rather than the .0 release, so that combinations with wheels available in a later patch release use them instead of compiling NumPy from source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant