Skip to content

Commit a629839

Browse files
authored
Merge branch 'master' into informative-valueError
2 parents ecc2189 + 06563cf commit a629839

152 files changed

Lines changed: 14963 additions & 3903 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codecov.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
patch:
7+
default:
8+
target: 80%
9+
threshold: 0%
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Setup python and poetry'
2+
inputs:
3+
python-version:
4+
required: true
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Install poetry
9+
shell: bash
10+
run: pipx install poetry
11+
12+
- name: Setup python
13+
uses: actions/setup-python@v6
14+
with:
15+
python-version: ${{ inputs.python-version }}
16+
cache: poetry
17+
18+
- name: Install packages
19+
shell: bash
20+
run: |
21+
poetry env use ${{ inputs.python-version }}
22+
poetry install --with dev,test,docs

.github/workflows/coverage.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ jobs:
1616
uses: actions/checkout@v4
1717

1818
- name: Setup python
19-
uses: actions/setup-python@v5
19+
uses: ./.github/actions/setup-python
2020
with:
21-
python-version: "3.10"
22-
cache: "pip"
23-
24-
- name: Install package
25-
run: pip install .[dev]
21+
python-version: "3.12"
2622

2723
- name: Run unit tests with coverage
28-
run: pytest -v tests --ignore tests/integration --cov malariagen_data/anoph --cov-report=xml
24+
run: poetry run pytest -v tests --ignore tests/integration --cov malariagen_data/anoph --cov-report=xml
2925

3026
- name: Upload coverage report
3127
uses: codecov/codecov-action@v3

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ jobs:
2121
uses: actions/checkout@v4
2222

2323
- name: Setup python
24-
uses: actions/setup-python@v5
24+
uses: ./.github/actions/setup-python
2525
with:
2626
python-version: ${{ matrix.python-version }}
27-
cache: "pip"
28-
29-
- name: Install package
30-
run: pip install .[dev]
3127

3228
- id: 'auth'
3329
name: 'Set up Google Cloud authentication'
@@ -50,7 +46,7 @@ jobs:
5046
key: gcs_cache_integration_tests_20240922
5147

5248
- name: Run integration tests
53-
run: pytest --durations=20 -v tests/integration
49+
run: poetry run pytest --durations=20 -v tests/integration
5450

5551
- name: Save GCS cache
5652
uses: actions/cache/save@v3

.github/workflows/latest_docs.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,19 @@ jobs:
1212
- name: Check out source 🛒
1313
uses: actions/checkout@v4
1414

15-
- name: Set up Python 🐍
16-
uses: actions/setup-python@v5
15+
- name: Setup python 🐍
16+
uses: ./.github/actions/setup-python
1717
with:
1818
python-version: '3.12'
1919

20-
- name: Install poetry
21-
run: pipx install poetry==1.8.3
22-
2320
- name: Eyeball native environment 👀
2421
run: python --version ; pip --version ; poetry --version ; pwd ; ls -la
2522

26-
- name: Install package dependencies 📜
27-
run: poetry install
28-
2923
- name: Build HTML 🏗️
3024
run: poetry run sphinx-build -b html docs/source docs/build/html
3125

3226
- name: Deploy HTML to GitHub Pages 🚀
33-
uses: peaceiris/actions-gh-pages@v3.9.3
27+
uses: peaceiris/actions-gh-pages@v4
3428
with:
3529
publish_branch: gh-pages
3630
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/linting.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@ jobs:
1616
uses: actions/checkout@v4
1717

1818
- name: Setup python
19-
uses: actions/setup-python@v5
19+
uses: ./.github/actions/setup-python
2020
with:
2121
python-version: '3.12'
22-
cache: 'pip'
2322

2423
- name: Run pre-commit checks
2524
uses: pre-commit/action@v3.0.0
2625

27-
- name: Install package
28-
run: pip install .[dev]
29-
3026
- name: Run mypy
31-
run: |
32-
mypy malariagen_data tests --ignore-missing-imports
27+
run: poetry run mypy malariagen_data tests --ignore-missing-imports

.github/workflows/notebooks.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Setup python
20-
uses: actions/setup-python@v5
20+
uses: ./.github/actions/setup-python
2121
with:
2222
python-version: "3.12"
23-
cache: "pip"
24-
25-
- name: Install package
26-
run: pip install .[dev]
2723

2824
- id: 'auth'
2925
name: 'Set up Google Cloud authentication'
@@ -46,7 +42,7 @@ jobs:
4642
key: gcs_cache_notebooks_20240922
4743

4844
- name: Run notebooks
49-
run: jupyter nbconvert --execute notebooks/*.ipynb --inplace
45+
run: poetry run jupyter nbconvert --execute notebooks/*.ipynb --inplace
5046

5147
- name: Save GCS cache
5248
uses: actions/cache/save@v3

.github/workflows/release.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ jobs:
1010
- name: Checkout source
1111
uses: actions/checkout@v4
1212

13-
- name: Install poetry
14-
run: pipx install poetry==1.8.3
15-
1613
- name: Setup python
17-
uses: actions/setup-python@v5
14+
uses: ./.github/actions/setup-python
1815
with:
1916
python-version: '3.12'
20-
cache: 'poetry'
2117

2218
- name: Configure poetry
2319
run: |

.github/workflows/tagged_docs.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,14 @@ jobs:
2424
with:
2525
ref: ${{ env.VERSION_TAG }}
2626

27-
- name: Set up Python 🐍
28-
uses: actions/setup-python@v5
27+
- name: Setup python 🐍
28+
uses: ./.github/actions/setup-python
2929
with:
3030
python-version: '3.12'
3131

32-
- name: Install poetry
33-
run: pipx install poetry==1.8.3
34-
3532
- name: Eyeball native environment 👀
3633
run: python --version ; pip --version ; poetry --version ; pwd ; ls -la
3734

38-
- name: Install package dependencies 📜
39-
run: poetry install
40-
4135
- name: Build HTML 🏗️
4236
run: poetry run sphinx-build -b html docs/source docs/build/html
4337

.github/workflows/tests.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)