Skip to content

Commit

Permalink
pyproject.toml: Prefer NumPy 2.0 in build-system.
Browse files Browse the repository at this point in the history
Build against NumPy 2.0 in the build-system when possible (i.e., on Python 3.9 or later).
This will create code that is compatible with both NumPy 1.x and 2.x, see:

https://numpy.org/devdocs/dev/depending_on_numpy.html#numpy-2-0-specific-advice
  • Loading branch information
larsoner committed Aug 4, 2024
1 parent 3514302 commit 5336a7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ requires = [
"oldest-supported-numpy; python_version<'3.7'",
# we need to build with at least 1.16.5 for a limited API bugfix
"numpy==1.16.5; python_version=='3.7'",
"oldest-supported-numpy; python_version>='3.8'"
"oldest-supported-numpy; python_version=='3.8'",
"numpy>=2,<3; python_version>='3.9'",
]
build-backend = "setuptools.build_meta"

0 comments on commit 5336a7e

Please sign in to comment.