Skip to content

Commit

Permalink
[ci] Add testing for NumPy >= 2 (#73)
Browse files Browse the repository at this point in the history
Upstream tests NumPy >= 2 on different platforms, so we must repeat it
manually
  • Loading branch information
EricCousineau-TRI authored Jul 9, 2024
1 parent f1213df commit 51d715e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
# - 'pypy-3.8'
# - 'pypy-3.9'
# - 'pypy-3.10'
numpy_version:
- '1.x'
- '2.x'

# Items in here will either be added to the build matrix (if not
# present), or add new keys to an existing matrix element if all the
Expand Down Expand Up @@ -66,7 +69,7 @@ jobs:
# - runs-on: windows-2019
# python: '2.7'

name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 • NumPy ${{ matrix.numpy_version }} • ${{ matrix.args }}"
runs-on: ${{ matrix.runs-on }}

steps:
Expand Down Expand Up @@ -104,6 +107,10 @@ jobs:
run: |
python -m pip install -r tests/requirements.txt
- name: Install NumPy >= 2
if: matrix.numpy_version == '2.x'
run: pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1'

- name: Setup annotations on Linux
if: runner.os == 'Linux'
run: python -m pip install pytest-github-actions-annotate-failures
Expand All @@ -117,7 +124,7 @@ jobs:
-DPYBIND11_WERROR=ON
-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
-DPYBIND11_NUMPY_1_ONLY=ON
-DPYBIND11_NUMPY_1_ONLY=${{ matrix.numpy_version == '1.x' && 'ON' || 'OFF' }}
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=11
Expand Down Expand Up @@ -148,7 +155,7 @@ jobs:
cmake -S . -B build2
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DPYBIND11_NUMPY_1_ONLY=ON
-DPYBIND11_NUMPY_1_ONLY=${{ matrix.numpy_version == '1.x' && 'ON' || 'OFF' }}
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
Expand All @@ -170,6 +177,7 @@ jobs:
run: >
cmake -S . -B build3
-DPYBIND11_WERROR=ON
-DPYBIND11_NUMPY_1_ONLY=${{ matrix.numpy_version == '1.x' && 'ON' || 'OFF' }}
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_STANDARD=17
Expand Down

0 comments on commit 51d715e

Please sign in to comment.