Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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/[email protected]
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
5 changes: 4 additions & 1 deletion ci/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
50 changes: 42 additions & 8 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ seaborn = "*"
[feature.extras.dependencies]
# array
sparse = "*"
pint = "*"
array-api-strict = "*"

# algorithms
scipy = "*"
Expand All @@ -87,9 +89,10 @@ toolz = "*"
# tutorial
pooch = "*"

# other
# calendar
cftime = "*"
pint = "*"

# other
iris = "*"

[feature.extras.pypi-dependencies]
Expand All @@ -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.*"
Expand Down Expand Up @@ -204,7 +202,6 @@ cartopy = "*"
seaborn = "*"

[feature.test.dependencies]
array-api-strict = "*"
pytest = "*"
pytest-asyncio = "*"
pytest-cov = "*"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }
Loading