Skip to content

Commit

Permalink
MNT: Build agains Numpy v2 where possible
Browse files Browse the repository at this point in the history
Since it is not needed anymore with recent Numpy versions, and bump
minimum required Numpy to 2.0.0rc1 in order to be able to build Numpy
2-compatible wheels
  • Loading branch information
astrofrog authored and rdbisme committed Apr 18, 2024
1 parent bd70f84 commit 1dc14d8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,16 @@ requires = [
"setuptools",
"versioneer",
"wheel",
"oldest-supported-numpy"
"oldest-supported-numpy ; python_version < '3.9'",
# Comments on numpy build requirement range:
#
# 1. >=2.0.x is the numpy requirement for wheel builds for distribution
# on PyPI - building against 2.x yields wheels that are also
# ABI-compatible with numpy 1.x at runtime.
# 2. 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.
# 3. The <2.3 upper bound is for matching the numpy deprecation policy,
# it should not be loosened
"numpy>=2.0.0rc1<2.3 ; python_version >= '3.9'",
]
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ def get_long_description():
install_requires=["numpy"],
extras_require={"doc": ["numpydoc", "sphinx", "gitpython"]},
cmdclass=cmdclass,
setup_requires=["numpy"],
setup_requires=[
"oldest-supported-numpy ; python_version < '3.9'",
"numpy>=2.0.0rc1 ; python_version >= '3.9'"
],
ext_modules=prepare_modules(),
zip_safe=False,
)
Expand Down

0 comments on commit 1dc14d8

Please sign in to comment.