-
Notifications
You must be signed in to change notification settings - Fork 178
52 lines (46 loc) · 1.5 KB
/
tests.yml
File metadata and controls
52 lines (46 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12"]
numpy-spec:
# Keep this aligned with pyproject.toml: numpy = ">=2.0.2,<2.1"
- "==2.0.2" # locked baseline
- ">=2.0.2,<2.1" # latest allowed in declared range
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install matrix NumPy version
run: poetry run pip install --upgrade --no-deps "numpy${{ matrix.numpy-spec }}"
- name: Verify NumPy version and spec
env:
NUMPY_SPEC: ${{ matrix.numpy-spec }}
run: |
poetry run python - <<'PY'
import os
import numpy
from packaging.specifiers import SpecifierSet
spec = SpecifierSet(os.environ["NUMPY_SPEC"])
version = numpy.__version__
if version not in spec:
raise RuntimeError(
f"NumPy version {version} does not satisfy matrix spec {spec}"
)
print("NumPy version:", version, "| spec:", spec)
PY
- name: Run unit tests
run: poetry run pytest -v tests --ignore tests/integration --typeguard-packages=malariagen_data,malariagen_data.anoph