Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLD: NumPy 2 compat for wheel builds #4620

Merged
merged 5 commits into from
Jun 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the range of compatible 1.x numpy versions with 2.0 published somewhere? I.e. checking if we need to bump the minimum NumPy version anywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This document isn't too bad: https://numpy.org/doc/stable/dev/depending_on_numpy.html#for-downstream-package-authors. I think we may be "ok" on that front.

You can deduce the stability back to 1.25.x and then to 1.19.x based on that document. It looks like we have Python 3.10 and NumPy 1.23.2 as our runtime lower bounds, which is pretty close to where SciPy is (3.10 and 1.23.5 respectively) at the moment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me do a quick check of the current CI failures to see if I can make a concrete suggestion for those as well.

# 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
Loading