Skip to content

Commit

Permalink
Support numpy 2.0
Browse files Browse the repository at this point in the history
Per numpy's instructions, build with numpy >= 1.25 and test with numpy
1.19.
  • Loading branch information
joaander committed May 23, 2024
1 parent ad2a8d6 commit bce33e0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:

jobs:
build_wheels:
name: Build wheels [${{ matrix.python }}, ${{ matrix.os.base }}-${{ matrix.os.arch }}]
name: Build wheels [${{ matrix.python.version }}, ${{ matrix.os.base }}-${{ matrix.os.arch }}]
runs-on: ${{ matrix.os.base }}-${{ matrix.os.version }}
strategy:
fail-fast: false
Expand All @@ -39,19 +39,28 @@ jobs:
version: 13
arch: 'x86_64'

python: ['cp38', 'cp39', 'cp310', 'cp311', 'cp312']
python:
- version: 'cp39'
oldest_numpy: '1.21.6'
- version: 'cp310'
oldest_numpy: '1.21.6'
- version: 'cp311'
oldest_numpy: '1.23.2'
- version: 'cp312'
oldest_numpy: '1.26.2'

steps:
- uses: actions/[email protected]

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "${{ matrix.python }}-*"
CIBW_BUILD: "${{ matrix.python.version }}-*"
CIBW_TEST_REQUIRES: pytest==8.2.1 numpy==${{ matrix.python.oldest_numpy }}

- uses: actions/[email protected]
with:
name: dist-python-${{ matrix.python }}-${{ matrix.os.base }}-${{ matrix.os.arch }}
name: dist-python-${{ matrix.python.version }}-${{ matrix.os.base }}-${{ matrix.os.arch }}
path: ./wheelhouse/*.whl

build_sdist:
Expand Down
6 changes: 3 additions & 3 deletions INSTALLING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ Install prerequisites

**General requirements:**

* **C compiler** (tested with gcc 9-12, clang 10-14, visual studio 2019-2022)
* **Python** >= 3.8
* **numpy** >= 1.17.3
* **C compiler** (tested with gcc 10-14, clang 10-18, Visual Studio 2019-2022)
* **Python** >= 3.9
* **numpy** >= 1.19.0
* **Cython** >= 0.22

**To build the documentation**:
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -36,12 +36,11 @@ 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"

# Build on 64-bit architectures.
archs = ["auto64"]
Expand Down

0 comments on commit bce33e0

Please sign in to comment.