From 0ec177469dfb731905832c7e05c78f6db5bf312b Mon Sep 17 00:00:00 2001 From: Kyle Sunden Date: Fri, 29 Mar 2024 12:44:45 -0500 Subject: [PATCH] Unpin numpy 2 for install, build against numpy rc for isolated builds --- .github/workflows/cibuildwheel.yml | 4 ++-- pyproject.toml | 13 ++++++++++++- setup.py | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 95b46216cf39..d1dbbb2c47bf 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -94,10 +94,10 @@ jobs: runs-on: ${{ matrix.os }} env: CIBW_BEFORE_BUILD: >- - pip install certifi numpy>=1.25 && + pip install certifi && rm -rf {package}/build CIBW_BEFORE_BUILD_WINDOWS: >- - pip install certifi delvewheel numpy>=1.25 && + pip install certifi delvewheel && rm -rf {package}/build CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- delvewheel repair -w {dest_dir} {wheel} diff --git a/pyproject.toml b/pyproject.toml index 7131609c633a..44f56d8cc122 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,10 +2,21 @@ build-backend = "setuptools.build_meta" requires = [ "certifi>=2020.06.20", - "numpy>=1.25", "pybind11>=2.6", "setuptools>=64", "setuptools_scm>=7", + + # 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", ] [tool.setuptools_scm] diff --git a/setup.py b/setup.py index 6f277d4e4d7d..899021a83254 100644 --- a/setup.py +++ b/setup.py @@ -333,7 +333,7 @@ def make_release_tree(self, base_dir, files): "cycler>=0.10", "fonttools>=4.22.0", "kiwisolver>=1.3.1", - "numpy>=1.21,<2", + "numpy>=1.21", "packaging>=20.0", "pillow>=8", "pyparsing>=2.3.1",