@@ -11,25 +11,42 @@ jobs:
1111 strategy :
1212 fail-fast : true
1313 matrix :
14- python-version : ["3.10"]
15- numpy-version : ["numpy==1.26.4"]
14+ python-version : ["3.10", "3.11", "3.12"]
15+ numpy-spec :
16+ # Keep this aligned with pyproject.toml: numpy = ">=2.0.2,<2.1"
17+ - " ==2.0.2" # locked baseline
18+ - " >=2.0.2,<2.1" # latest allowed in declared range
1619 runs-on : ubuntu-latest
1720
1821 steps :
1922 - name : Checkout source
2023 uses : actions/checkout@v4
2124
2225 - name : Setup python
23- uses : actions/setup-python@v5
26+ uses : ./.github/ actions/setup-python
2427 with :
2528 python-version : ${{ matrix.python-version }}
26- cache : " pip"
2729
28- - name : Install package
29- run : pip install " ${{ matrix.numpy-version }}" .[dev]
30+ - name : Install matrix NumPy version
31+ run : poetry run pip install --upgrade --no-deps "numpy ${{ matrix.numpy-spec }}"
3032
31- - name : Verify NumPy version
32- run : python -c "import numpy; print('NumPy version:', numpy.__version__)"
33+ - name : Verify NumPy version and spec
34+ env :
35+ NUMPY_SPEC : ${{ matrix.numpy-spec }}
36+ run : |
37+ poetry run python - <<'PY'
38+ import os
39+ import numpy
40+ from packaging.specifiers import SpecifierSet
41+
42+ spec = SpecifierSet(os.environ["NUMPY_SPEC"])
43+ version = numpy.__version__
44+ if version not in spec:
45+ raise RuntimeError(
46+ f"NumPy version {version} does not satisfy matrix spec {spec}"
47+ )
48+ print("NumPy version:", version, "| spec:", spec)
49+ PY
3350
3451 - name : Run unit tests
35- run : pytest -v tests --ignore tests/integration --typeguard-packages=malariagen_data,malariagen_data.anoph
52+ run : poetry run pytest -v tests --ignore tests/integration --typeguard-packages=malariagen_data,malariagen_data.anoph
0 commit comments