From 0839de149116c0f2274bb8273654cabd60428815 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:34:02 +0100 Subject: [PATCH 01/17] enable the min-deps ci --- .github/workflows/ci-additional.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 673959cf466..a6d677acc5b 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -245,9 +245,7 @@ jobs: name: Minimum Version Policy runs-on: "ubuntu-latest" needs: detect-ci-trigger - # min-version-policy doesn't work with Pixi yet https://github.com/pydata/xarray/pull/10888#discussion_r2504335457 - if: false - # if: needs.detect-ci-trigger.outputs.triggered == 'false' + if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: shell: bash -l {0} @@ -268,10 +266,12 @@ jobs: uses: xarray-contrib/minimum-dependency-versions@3db8e1c17328ee1e27dfe4db90d908644856eb61 # v1.0.0 with: policy: ci/policy.yaml - environment-paths: ci/requirements/min-all-deps.yml + environments: pixi:test-py311-min-versions + manifest-path: pixi.toml - name: Bare minimum versions policy uses: xarray-contrib/minimum-dependency-versions@3db8e1c17328ee1e27dfe4db90d908644856eb61 # v1.0.0 with: policy: ci/policy.yaml - environment-paths: ci/requirements/bare-minimum.yml + environments: pixi:test-py311-bare-minimum + manifest-path: pixi.toml From 2ed80a7f788b68caf64c0a8356385053cb0aa68d Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:34:52 +0100 Subject: [PATCH 02/17] move array-api-strict to the `extras` feature --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 443c8c8f211..7de82d57019 100644 --- a/pixi.toml +++ b/pixi.toml @@ -79,6 +79,7 @@ seaborn = "*" [feature.extras.dependencies] # array sparse = "*" +array-api-strict = "<2.4" # algorithms scipy = "*" @@ -204,7 +205,6 @@ cartopy = "*" seaborn = "*" [feature.test.dependencies] -array-api-strict = "*" pytest = "*" pytest-asyncio = "*" pytest-cov = "*" From b7a40a89fa2e81375ef2bf91a1589cf80d0c47fd Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:35:11 +0100 Subject: [PATCH 03/17] restructure the `extras` feature --- pixi.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pixi.toml b/pixi.toml index 7de82d57019..b2fa6a99613 100644 --- a/pixi.toml +++ b/pixi.toml @@ -79,6 +79,7 @@ seaborn = "*" [feature.extras.dependencies] # array sparse = "*" +pint = "*" array-api-strict = "<2.4" # algorithms @@ -88,9 +89,10 @@ toolz = "*" # tutorial pooch = "*" -# other +# calendar cftime = "*" -pint = "*" + +# other iris = "*" [feature.extras.pypi-dependencies] From 8e0c44a94c214bcd7ed5307e9b34eba37311808d Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:35:30 +0100 Subject: [PATCH 04/17] [skip-rtd] From afbee43b0e3aa77f854fd3a5c26e7f2d93f5ee78 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:45:50 +0100 Subject: [PATCH 05/17] disable the ci trigger --- .github/workflows/ci-additional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index a6d677acc5b..6bd9f01f816 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -245,7 +245,7 @@ jobs: name: Minimum Version Policy runs-on: "ubuntu-latest" needs: detect-ci-trigger - if: needs.detect-ci-trigger.outputs.triggered == 'false' + # if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: shell: bash -l {0} From 96c0c6dd154ce7f25ba7fd6f1cff456c101199f8 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:46:39 +0100 Subject: [PATCH 06/17] [skip-rtd] From 46767e856ec349a1f9058374df10c47bf67d14b7 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 17 Dec 2025 09:49:12 +0100 Subject: [PATCH 07/17] disable the trigger entirely [skip-rtd] --- .github/workflows/ci-additional.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 6bd9f01f816..546d728c925 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -244,7 +244,7 @@ jobs: min-version-policy: name: Minimum Version Policy runs-on: "ubuntu-latest" - needs: detect-ci-trigger + # needs: detect-ci-trigger # if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: From b945d2bee8ce5268a80b2605810a17f306d85549 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:01:13 +0100 Subject: [PATCH 08/17] create a environment for the policy check --- pixi.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pixi.toml b/pixi.toml index b2fa6a99613..2423632bdfd 100644 --- a/pixi.toml +++ b/pixi.toml @@ -294,6 +294,12 @@ cytoolz = "*" [feature.release.tasks] release-contributors = "python ci/release_contributors.py" +[feature.policy.pypi-dependencies] +xarray-minimum-dependency-policy = "*" + +[feature.policy.dependencies] +python = "3.13.*" + [environments] # Testing # test-just-xarray = { features = ["test"] } # https://github.com/pydata/xarray/pull/10888/files#r2511336147 @@ -394,3 +400,4 @@ doc = { features = [ ] } pre-commit = { features = ["pre-commit"], no-default-feature = true } release = { features = ["release"], no-default-feature = true } +policy = { features = ["policy"], no-default-feature = true } From 9ab5ed268d2ec1a94391866921dc48c80d51c229 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:01:25 +0100 Subject: [PATCH 09/17] define tasks for the different min-deps envs --- pixi.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pixi.toml b/pixi.toml index 2423632bdfd..72a49ced65a 100644 --- a/pixi.toml +++ b/pixi.toml @@ -300,6 +300,11 @@ xarray-minimum-dependency-policy = "*" [feature.policy.dependencies] python = "3.13.*" +[feature.policy.tasks] +policy-bare-minimum = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml pixi:test-py311-bare-minimum" +policy-minimum-versions = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml pixi:test-py311-min-versions" +policy-bare-min-and-scipy = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml pixi:test-py311-bare-min-and-scipy" + [environments] # Testing # test-just-xarray = { features = ["test"] } # https://github.com/pydata/xarray/pull/10888/files#r2511336147 From 6e33dfe598d5a6b5c3056a80d3d774d37b7defb2 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:01:44 +0100 Subject: [PATCH 10/17] ignore `pytz` and `pytest-reportlog` --- ci/policy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/policy.yaml b/ci/policy.yaml index 5876e54505c..db853608624 100644 --- a/ci/policy.yaml +++ b/ci/policy.yaml @@ -24,5 +24,7 @@ policy: - pytest-xdist - pytest-hypothesis - hypothesis + - pytz + - pytest-reportlog # these packages don't fail the CI, but will be printed in the report ignored_violations: [] From 2a3dabdc65db862277fe83b22d5f524499d8fefd Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:13:18 +0100 Subject: [PATCH 11/17] combine the task definitions using dependent tasks --- pixi.toml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/pixi.toml b/pixi.toml index 72a49ced65a..8c6a643d6b1 100644 --- a/pixi.toml +++ b/pixi.toml @@ -300,10 +300,35 @@ xarray-minimum-dependency-policy = "*" [feature.policy.dependencies] python = "3.13.*" +[feature.policy.tasks.check-policy] +cmd = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml {{ env }}" +args = ["env"] + [feature.policy.tasks] -policy-bare-minimum = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml pixi:test-py311-bare-minimum" -policy-minimum-versions = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml pixi:test-py311-min-versions" -policy-bare-min-and-scipy = "minimum-versions validate --policy ci/policy.yaml --manifest-path pixi.toml pixi:test-py311-bare-min-and-scipy" +policy-bare-minimum = [ + { task = "check-policy", args = [ + "pixi:test-py311-bare-minimum", + ] }, +] +policy-bare-min-and-scipy = [ + { task = "check-policy", args = [ + "pixi:test-py311-bare-min-and-scipy", + ] }, +] +policy-min-versions = [ + { task = "check-policy", args = [ + "pixi:test-py311-min-versions", + ] }, +] +policy = [ + { task = "check-policy", args = [ + """\ + pixi:test-py311-bare-minimum \ + pixi:test-py311-bare-min-and-scipy \ + pixi:test-py311-min-versions \ + """, + ] }, +] [environments] # Testing From bbbd528712ec5e6f8aa4ff4ce982f0fc4407d02f Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:17:00 +0100 Subject: [PATCH 12/17] refactor the min-versions job --- .github/workflows/ci-additional.yaml | 30 +++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 546d728c925..7ef5d375703 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -244,6 +244,7 @@ jobs: min-version-policy: name: Minimum Version Policy runs-on: "ubuntu-latest" + needs: cache-pixi-lock # needs: detect-ci-trigger # if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: @@ -258,20 +259,21 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - - - name: All-deps minimum versions policy - uses: xarray-contrib/minimum-dependency-versions@3db8e1c17328ee1e27dfe4db90d908644856eb61 # v1.0.0 + - uses: prefix-dev/setup-pixi@v0.9.3 with: - policy: ci/policy.yaml - environments: pixi:test-py311-min-versions - manifest-path: pixi.toml + pixi-version: ${{ env.PIXI_VERSION }} + cache: true + environments: "policy" + cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} - name: Bare minimum versions policy - uses: xarray-contrib/minimum-dependency-versions@3db8e1c17328ee1e27dfe4db90d908644856eb61 # v1.0.0 - with: - policy: ci/policy.yaml - environments: pixi:test-py311-bare-minimum - manifest-path: pixi.toml + run: | + pixi run policy-bare-minimum + + - name: Bare minimum and scipy versions policy + run: | + pixi run policy-bare-min-and-scipy + + - name: All-deps minimum versions policy + run: | + pixi run policy-min-versions From bec61be4c7850beeb788cecdadb9c494080d8a77 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:20:24 +0100 Subject: [PATCH 13/17] restore the lock file --- .github/workflows/ci-additional.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 7ef5d375703..18b5a393732 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -259,6 +259,15 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. + - name: Restore cached pixi lockfile + uses: actions/cache/restore@v5 + id: restore-pixi-lock + with: + enableCrossOsArchive: true + path: | + pixi.lock + key: ${{ needs.cache-pixi-lock.outputs.cache-id }} + - uses: prefix-dev/setup-pixi@v0.9.3 with: pixi-version: ${{ env.PIXI_VERSION }} From 654fb266f562ab81e73d3f77e41a1af169443768 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:25:36 +0100 Subject: [PATCH 14/17] ignore the policy violation for `array-api-strict` --- ci/policy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/policy.yaml b/ci/policy.yaml index db853608624..0e0f81d8a1f 100644 --- a/ci/policy.yaml +++ b/ci/policy.yaml @@ -27,4 +27,5 @@ policy: - pytz - pytest-reportlog # these packages don't fail the CI, but will be printed in the report - ignored_violations: [] + ignored_violations: + - array-api-strict From 34dd1925dbc1241eb39471ea60c6115702de43e2 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:28:34 +0100 Subject: [PATCH 15/17] skip the min-versions policy checks along with all other ci --- .github/workflows/ci-additional.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 18b5a393732..106bb82124e 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -244,9 +244,8 @@ jobs: min-version-policy: name: Minimum Version Policy runs-on: "ubuntu-latest" - needs: cache-pixi-lock - # needs: detect-ci-trigger - # if: needs.detect-ci-trigger.outputs.triggered == 'false' + needs: [detect-ci-trigger, cache-pixi-lock] + if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: shell: bash -l {0} From 736c88b0c83bed8c965db670e0ecd906e508c734 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 13:32:58 +0100 Subject: [PATCH 16/17] bad merge --- pixi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixi.toml b/pixi.toml index 8c6a643d6b1..4f3e2de0257 100644 --- a/pixi.toml +++ b/pixi.toml @@ -80,7 +80,7 @@ seaborn = "*" # array sparse = "*" pint = "*" -array-api-strict = "<2.4" +array-api-strict = "*" # algorithms scipy = "*" From 5cdf4fc7a5974539d83191bc95a3f8041ed5032d Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 20 Dec 2025 14:15:33 +0100 Subject: [PATCH 17/17] remove outdated comment --- pixi.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pixi.toml b/pixi.toml index 4f3e2de0257..a8d165e868f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -109,11 +109,6 @@ pandas = "2.2.*" scipy = "1.13.*" [feature.min-versions.dependencies] -# minimal versions for all dependencies -# Note that when you update min-supported versions, you should: -# - Update the min version lower-bound in the corresponding feature(s) where applicable -# - Update this section to pin to the min version - array-api-strict = "2.4.*" # dependency for testing the array api compat boto3 = "1.34.*" bottleneck = "1.4.*"