Skip to content

Commit fc86779

Browse files
authored
Merge pull request #21 from openscm/more-ci
Add extra OS to test strategy
2 parents 1d3a0ae + 4464500 commit fc86779

File tree

8 files changed

+44
-17
lines changed

8 files changed

+44
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ jobs:
7474
os: [ "ubuntu-latest" ]
7575
# Test against all security and bugfix versions: https://devguide.python.org/versions/
7676
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
77+
include:
78+
# Include other OS for latest Python
79+
# because these seem to be the flakiest from experience
80+
# so are worth the extra testing
81+
- os: "windows-latest"
82+
python-version: "3.13"
83+
- os: "macos-latest"
84+
python-version: "3.13"
85+
7786
runs-on: "${{ matrix.os }}"
7887
defaults:
7988
run:
@@ -97,6 +106,8 @@ jobs:
97106
uv-dependency-install-flags: "--all-extras --group tests"
98107
- name: Run tests
99108
run: |
109+
# Warm up the speed tests, allowing failure
110+
uv run pytest tests/integration/database/test_integration_speed.py || true
100111
uv run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
101112
uv run coverage report
102113
- name: Upload coverage reports to Codecov with GitHub Action
@@ -266,7 +277,8 @@ jobs:
266277
# Required for building the locked version of the package
267278
# with pdm-build-locked (see pyproject.toml)
268279
run: |
269-
pdm lock --group :all --strategy inherit_metadata
280+
pdm lock --group :all --strategy inherit_metadata --python="<3.13"
281+
pdm lock --group :all --python=">=3.13" --append
270282
- name: Build package
271283
run: |
272284
uv build

.github/workflows/deploy.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
# Required for building the locked version of the package
4343
# with pdm-build-locked (see pyproject.toml)
4444
run: |
45-
pdm lock --group :all --strategy inherit_metadata
45+
pdm lock --group :all --strategy inherit_metadata --python="<3.13"
46+
pdm lock --group :all --python=">=3.13" --append
4647
- name: Publish to PyPI
4748
run: |
4849
uv build

.github/workflows/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
# Required for building the locked version of the package
3636
# with pdm-build-locked (see pyproject.toml)
3737
run: |
38-
pdm lock --group :all --strategy inherit_metadata
38+
pdm lock --group :all --strategy inherit_metadata --python="<3.13"
39+
pdm lock --group :all --python=">=3.13" --append
3940
- name: Add version to environment
4041
run: |
4142
PROJECT_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`

changelog/21.breaking.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated minimum numpy version to 1.26.0, the earliest that is not in end-of-life. Fixed the numpy pin for Python 3.13 to >=2.1.0, the first numpy version which supported Python 3.13.

changelog/21.trivial.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Added CI for windows and mac with latest Python to try and catch edge cases earlier
2+
- Updated the locking and building with pdm to support different pins for different python version ranges

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ license = { text = "3-Clause BSD License" }
99
requires-python = ">=3.9"
1010
dependencies = [
1111
"attrs>=24.3.0",
12-
"numpy>=1.25.0",
12+
"numpy>=1.26.0; python_version < '3.13'",
13+
"numpy>=2.1.0; python_version >= '3.13'",
1314
"pandas>=2.2.0",
1415
]
1516
readme = "README.md"

tests/integration/database/test_integration_speed.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def test_overhead(groupby, tmpdir):
7878
stop_db_save = time.perf_counter()
7979
time_db_save = stop_db_save - start_db_save
8080

81-
# Ok, particularly given how few files we're dealing with.
81+
# These tolerances are ok, particularly given how few files we're dealing with.
8282
# This is mainly about avoiding a factor of 10
8383
# (which was the difference we were getting in earlier implemenations).
84-
tol_save = 0.25
85-
tol_load = 0.2
84+
tol_save = 2.0
85+
tol_load = 2.0
8686

8787
overhead = (time_db_save - time_pandas_save) / time_pandas_save
8888
assert overhead <= tol_save, f"Overhead is more than {tol_save*100}%"

uv.lock

Lines changed: 19 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)