Skip to content

Commit

Permalink
BLD: NumPy 2 compat for wheel builds
Browse files Browse the repository at this point in the history
* Fixes #4619

* We should build against NumPy `2.0.0` so that we're backwards
compatible to NumPy `1.x` while still supporting 2.x series. This
is simpler to maintain as well. In theory, should support
as far back as NumPy `1.19` if we needed it.
  • Loading branch information
tylerjereddy committed Jun 18, 2024
1 parent d2d9d27 commit 4f891ed
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
requires = [
"Cython>=0.28",
"packaging",
# lowest NumPy we can use for a given Python,
# In part adapted from: https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
# As per NEP29, we set the minimum version to 1.23.2 for Python <=3.11
# and 1.26.0 (first to support) for Python 3.12
"numpy==1.23.2; python_version<='3.11' and platform_python_implementation != 'PyPy'",
"numpy==1.26.0; python_version=='3.12' and platform_python_implementation != 'PyPy'",
# For unreleased versions of Python there is currently no known supported
# NumPy version. In that case we just let it be a bare NumPy install
"numpy<2.0; python_version>='3.13'",
# numpy requirement for wheel builds for distribution on PyPI - building
# against 2.x yields wheels that are also compatible with numpy 1.x at
# runtime.
# Note that building against numpy 1.x works fine too - users and
# redistributors can do this by installing the numpy version they like and
# disabling build isolation.
"numpy>=2.0.0",
# Set to minimum version of setuptools that allows pyproject.toml
"setuptools >= 40.9.0",
"wheel",
Expand Down

0 comments on commit 4f891ed

Please sign in to comment.