Skip to content

Commit 51d715e

Browse files
[ci] Add testing for NumPy >= 2 (#73)
Upstream tests NumPy >= 2 on different platforms, so we must repeat it manually
1 parent f1213df commit 51d715e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/ci.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
# - 'pypy-3.8'
4040
# - 'pypy-3.9'
4141
# - 'pypy-3.10'
42+
numpy_version:
43+
- '1.x'
44+
- '2.x'
4245

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

69-
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
72+
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 • NumPy ${{ matrix.numpy_version }} • ${{ matrix.args }}"
7073
runs-on: ${{ matrix.runs-on }}
7174

7275
steps:
@@ -104,6 +107,10 @@ jobs:
104107
run: |
105108
python -m pip install -r tests/requirements.txt
106109
110+
- name: Install NumPy >= 2
111+
if: matrix.numpy_version == '2.x'
112+
run: pip install 'numpy>=2.0.0b1' 'scipy>=1.13.0rc1'
113+
107114
- name: Setup annotations on Linux
108115
if: runner.os == 'Linux'
109116
run: python -m pip install pytest-github-actions-annotate-failures
@@ -117,7 +124,7 @@ jobs:
117124
-DPYBIND11_WERROR=ON
118125
-DPYBIND11_DISABLE_HANDLE_TYPE_NAME_DEFAULT_IMPLEMENTATION=ON
119126
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=ON
120-
-DPYBIND11_NUMPY_1_ONLY=ON
127+
-DPYBIND11_NUMPY_1_ONLY=${{ matrix.numpy_version == '1.x' && 'ON' || 'OFF' }}
121128
-DDOWNLOAD_CATCH=ON
122129
-DDOWNLOAD_EIGEN=ON
123130
-DCMAKE_CXX_STANDARD=11
@@ -148,7 +155,7 @@ jobs:
148155
cmake -S . -B build2
149156
-DPYBIND11_WERROR=ON
150157
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
151-
-DPYBIND11_NUMPY_1_ONLY=ON
158+
-DPYBIND11_NUMPY_1_ONLY=${{ matrix.numpy_version == '1.x' && 'ON' || 'OFF' }}
152159
-DDOWNLOAD_CATCH=ON
153160
-DDOWNLOAD_EIGEN=ON
154161
-DCMAKE_CXX_STANDARD=17
@@ -170,6 +177,7 @@ jobs:
170177
run: >
171178
cmake -S . -B build3
172179
-DPYBIND11_WERROR=ON
180+
-DPYBIND11_NUMPY_1_ONLY=${{ matrix.numpy_version == '1.x' && 'ON' || 'OFF' }}
173181
-DDOWNLOAD_CATCH=ON
174182
-DDOWNLOAD_EIGEN=ON
175183
-DCMAKE_CXX_STANDARD=17

0 commit comments

Comments
 (0)