diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index 673959cf466..106bb82124e 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -244,10 +244,8 @@ jobs: min-version-policy: 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' + needs: [detect-ci-trigger, cache-pixi-lock] + if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: shell: bash -l {0} @@ -260,18 +258,30 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags. - - uses: actions/setup-python@v6 + - name: Restore cached pixi lockfile + uses: actions/cache/restore@v5 + id: restore-pixi-lock with: - python-version: "3.x" + enableCrossOsArchive: true + path: | + pixi.lock + key: ${{ needs.cache-pixi-lock.outputs.cache-id }} - - 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 - environment-paths: ci/requirements/min-all-deps.yml + 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 - environment-paths: ci/requirements/bare-minimum.yml + 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 diff --git a/ci/policy.yaml b/ci/policy.yaml index 5876e54505c..0e0f81d8a1f 100644 --- a/ci/policy.yaml +++ b/ci/policy.yaml @@ -24,5 +24,8 @@ 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: [] + ignored_violations: + - array-api-strict diff --git a/pixi.toml b/pixi.toml index 443c8c8f211..a8d165e868f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -79,6 +79,8 @@ seaborn = "*" [feature.extras.dependencies] # array sparse = "*" +pint = "*" +array-api-strict = "*" # algorithms scipy = "*" @@ -87,9 +89,10 @@ toolz = "*" # tutorial pooch = "*" -# other +# calendar cftime = "*" -pint = "*" + +# other iris = "*" [feature.extras.pypi-dependencies] @@ -106,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.*" @@ -204,7 +202,6 @@ cartopy = "*" seaborn = "*" [feature.test.dependencies] -array-api-strict = "*" pytest = "*" pytest-asyncio = "*" pytest-cov = "*" @@ -292,6 +289,42 @@ 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.*" + +[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 = [ + { 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 # test-just-xarray = { features = ["test"] } # https://github.com/pydata/xarray/pull/10888/files#r2511336147 @@ -392,3 +425,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 }