Skip to content

Commit 95657fd

Browse files
authored
re-enable the minimum versions ci (#11027)
* enable the min-deps ci * move array-api-strict to the `extras` feature * restructure the `extras` feature * [skip-rtd] * disable the ci trigger * [skip-rtd] * disable the trigger entirely [skip-rtd] * create a environment for the policy check * define tasks for the different min-deps envs * ignore `pytz` and `pytest-reportlog` * combine the task definitions using dependent tasks * refactor the min-versions job * restore the lock file * ignore the policy violation for `array-api-strict` * skip the min-versions policy checks along with all other ci * bad merge * remove outdated comment
1 parent a813e00 commit 95657fd

File tree

3 files changed

+70
-23
lines changed

3 files changed

+70
-23
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,8 @@ jobs:
244244
min-version-policy:
245245
name: Minimum Version Policy
246246
runs-on: "ubuntu-latest"
247-
needs: detect-ci-trigger
248-
# min-version-policy doesn't work with Pixi yet https://github.com/pydata/xarray/pull/10888#discussion_r2504335457
249-
if: false
250-
# if: needs.detect-ci-trigger.outputs.triggered == 'false'
247+
needs: [detect-ci-trigger, cache-pixi-lock]
248+
if: needs.detect-ci-trigger.outputs.triggered == 'false'
251249
defaults:
252250
run:
253251
shell: bash -l {0}
@@ -260,18 +258,30 @@ jobs:
260258
with:
261259
fetch-depth: 0 # Fetch all history for all branches and tags.
262260

263-
- uses: actions/setup-python@v6
261+
- name: Restore cached pixi lockfile
262+
uses: actions/cache/restore@v5
263+
id: restore-pixi-lock
264264
with:
265-
python-version: "3.x"
265+
enableCrossOsArchive: true
266+
path: |
267+
pixi.lock
268+
key: ${{ needs.cache-pixi-lock.outputs.cache-id }}
266269

267-
- name: All-deps minimum versions policy
268-
uses: xarray-contrib/minimum-dependency-versions@3db8e1c17328ee1e27dfe4db90d908644856eb61 # v1.0.0
270+
- uses: prefix-dev/[email protected]
269271
with:
270-
policy: ci/policy.yaml
271-
environment-paths: ci/requirements/min-all-deps.yml
272+
pixi-version: ${{ env.PIXI_VERSION }}
273+
cache: true
274+
environments: "policy"
275+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
272276

273277
- name: Bare minimum versions policy
274-
uses: xarray-contrib/minimum-dependency-versions@3db8e1c17328ee1e27dfe4db90d908644856eb61 # v1.0.0
275-
with:
276-
policy: ci/policy.yaml
277-
environment-paths: ci/requirements/bare-minimum.yml
278+
run: |
279+
pixi run policy-bare-minimum
280+
281+
- name: Bare minimum and scipy versions policy
282+
run: |
283+
pixi run policy-bare-min-and-scipy
284+
285+
- name: All-deps minimum versions policy
286+
run: |
287+
pixi run policy-min-versions

ci/policy.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@ policy:
2424
- pytest-xdist
2525
- pytest-hypothesis
2626
- hypothesis
27+
- pytz
28+
- pytest-reportlog
2729
# these packages don't fail the CI, but will be printed in the report
28-
ignored_violations: []
30+
ignored_violations:
31+
- array-api-strict

pixi.toml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ seaborn = "*"
7979
[feature.extras.dependencies]
8080
# array
8181
sparse = "*"
82+
pint = "*"
83+
array-api-strict = "*"
8284

8385
# algorithms
8486
scipy = "*"
@@ -87,9 +89,10 @@ toolz = "*"
8789
# tutorial
8890
pooch = "*"
8991

90-
# other
92+
# calendar
9193
cftime = "*"
92-
pint = "*"
94+
95+
# other
9396
iris = "*"
9497

9598
[feature.extras.pypi-dependencies]
@@ -106,11 +109,6 @@ pandas = "2.2.*"
106109
scipy = "1.13.*"
107110

108111
[feature.min-versions.dependencies]
109-
# minimal versions for all dependencies
110-
# Note that when you update min-supported versions, you should:
111-
# - Update the min version lower-bound in the corresponding feature(s) where applicable
112-
# - Update this section to pin to the min version
113-
114112
array-api-strict = "2.4.*" # dependency for testing the array api compat
115113
boto3 = "1.34.*"
116114
bottleneck = "1.4.*"
@@ -204,7 +202,6 @@ cartopy = "*"
204202
seaborn = "*"
205203

206204
[feature.test.dependencies]
207-
array-api-strict = "*"
208205
pytest = "*"
209206
pytest-asyncio = "*"
210207
pytest-cov = "*"
@@ -292,6 +289,42 @@ cytoolz = "*"
292289
[feature.release.tasks]
293290
release-contributors = "python ci/release_contributors.py"
294291

292+
[feature.policy.pypi-dependencies]
293+
xarray-minimum-dependency-policy = "*"
294+
295+
[feature.policy.dependencies]
296+
python = "3.13.*"
297+
298+
[feature.policy.tasks.check-policy]
299+
cmd = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml {{ env }}"
300+
args = ["env"]
301+
302+
[feature.policy.tasks]
303+
policy-bare-minimum = [
304+
{ task = "check-policy", args = [
305+
"pixi:test-py311-bare-minimum",
306+
] },
307+
]
308+
policy-bare-min-and-scipy = [
309+
{ task = "check-policy", args = [
310+
"pixi:test-py311-bare-min-and-scipy",
311+
] },
312+
]
313+
policy-min-versions = [
314+
{ task = "check-policy", args = [
315+
"pixi:test-py311-min-versions",
316+
] },
317+
]
318+
policy = [
319+
{ task = "check-policy", args = [
320+
"""\
321+
pixi:test-py311-bare-minimum \
322+
pixi:test-py311-bare-min-and-scipy \
323+
pixi:test-py311-min-versions \
324+
""",
325+
] },
326+
]
327+
295328
[environments]
296329
# Testing
297330
# test-just-xarray = { features = ["test"] } # https://github.com/pydata/xarray/pull/10888/files#r2511336147
@@ -392,3 +425,4 @@ doc = { features = [
392425
] }
393426
pre-commit = { features = ["pre-commit"], no-default-feature = true }
394427
release = { features = ["release"], no-default-feature = true }
428+
policy = { features = ["policy"], no-default-feature = true }

0 commit comments

Comments
 (0)