From dbb1c730f6483dfc6094359fec9192834f35633b Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Thu, 23 May 2024 11:45:32 -0400 Subject: [PATCH] Support numpy 2.0 Per numpy's instructions, build with numpy >= 1.25 and test with numpy 1.19. --- .github/workflows/build_wheels.yaml | 2 +- pyproject.toml | 6 +++--- requirements-oldest-numpy.txt | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 requirements-oldest-numpy.txt diff --git a/.github/workflows/build_wheels.yaml b/.github/workflows/build_wheels.yaml index fb256b27..c56e41c9 100644 --- a/.github/workflows/build_wheels.yaml +++ b/.github/workflows/build_wheels.yaml @@ -39,7 +39,7 @@ jobs: version: 13 arch: 'x86_64' - python: ['cp38', 'cp39', 'cp310', 'cp311', 'cp312'] + python: ['cp39', 'cp310', 'cp311', 'cp312'] steps: - uses: actions/checkout@v4.1.6 diff --git a/pyproject.toml b/pyproject.toml index 74f1a3b1..49dfe717 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers=[ "License :: OSI Approved :: BSD License", "Topic :: Scientific/Engineering :: Physics", ] -dependencies = ["numpy>=1.9.3"] +dependencies = ["numpy>=1.19.0"] [project.scripts] gsd = "gsd.__main__:main" @@ -36,12 +36,12 @@ packages = ["gsd", "gsd.test"] requires = ["setuptools>=64.0.0", "wheel", "Cython", - "oldest-supported-numpy"] + "numpy>=2.0.0rc1"] [tool.cibuildwheel] # Test the wheels. test-command = "pytest --pyargs gsd -v --log-level=DEBUG" -test-requires = "pytest" +before-test = "ls -lR && python3 -m pip install -r .github/requirements-oldest-numpy.txt --no-binary :all: --force-reinstall" # Build on 64-bit architectures. archs = ["auto64"] diff --git a/requirements-oldest-numpy.txt b/requirements-oldest-numpy.txt new file mode 100644 index 00000000..dde5a829 --- /dev/null +++ b/requirements-oldest-numpy.txt @@ -0,0 +1,5 @@ +pytest==8.2.1 +numpy==1.19.3; python_version=='3.9' +numpy==1.21.6; python_version=='3.10' +numpy==1.23.2; python_version=='3.11' +numpy==1.26.2; python_version=='3.12'