File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 fail-fast : true
1313 matrix :
1414 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
1519 runs-on : ubuntu-latest
1620
1721 steps :
2327 with :
2428 python-version : ${{ matrix.python-version }}
2529
26- - name : Verify NumPy version
27- run : poetry run python -c "import numpy; print('NumPy version:', numpy.__version__)"
30+ - name : Install matrix NumPy version
31+ run : poetry run pip install --upgrade --no-deps "numpy${{ matrix.numpy-spec }}"
32+
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
2850
2951 - name : Run unit tests
3052 run : poetry run pytest -v tests --ignore tests/integration --typeguard-packages=malariagen_data,malariagen_data.anoph
You can’t perform that action at this time.
0 commit comments