Validate minimum dependency environments according to xarray's policy scheme
Project description
xarray-minimum-dependency-versions
Check that the minimum dependency versions follow xarray's policy rules.
[!NOTE] Be aware that at the moment there is no public python API, so there are no stability guarantees.
Policy files
Before we can validate environments we need to create a policy file (named e.g. policy.yaml). This allows us to specify the conda channels, the platforms we want to check on, the actual support windows, any overrides, packages that are not supposed to be checked, and allowed violations.
These windows are checked according to xarray's policy, that is, a version can be required as soon as it is at least N months old. As opposed to a fixed support window this means we can never end up requiring a one-month old dependency (or being able to drop all existing versions) for packages with infrequent releases.
For example:
channels:
- conda-forge
platforms:
- noarch
- linux-64
policy:
# policy in months
# Example is xarray's values
packages:
python: 30
numpy: 18
default: 12
overrides:
# override the policy for specific packages
package3: 0.3.1
# these packages are completely ignored
exclude:
- package1
- package2
- ...
# these packages don't fail the CI, but will be printed in the report as a warning
ignored_violations:
- package4
If there are no packages with overrides, exclude, or ignored_violations,
you can set them to an empty mapping or sequence, respectively:
...
overrides: {}
exclude: []
ignored_violations: []
channels
The names of the conda channels to check. Usually, conda-forge.
platforms
The names of the platforms to check. Usually, noarch and linux-64 are sufficient.
policy
The main policy definition. packages is a mapping of package names to the number of months, with default specifying the default for packages that are not in packages.
Any package listed in ignored_violations will show a warning if the policy is violated, but will not count as an error, and it is possible to force a specific version using overrides.
Usage
With the policy file, we can check environment files. There are currently two kinds supported: conda environment definitions as yaml files, and pixi environments.
Check also minimum-versions --help and minimum-versions validate --help.
conda
To validate a conda environment file, run:
minimum-versions validate --policy ./policy.yaml path/to/env1.yaml
or with an explicit prefix
minimum-versions validate --policy ./policy.yaml conda:path/to/env1.yaml
We can also validate multiple files at the same time:
minimum-versions validate --policy .../policy.yaml .../env1.yaml .../env2.yaml
pixi
To validate pixi environments, we need to specify the manifest-path (usually either pyproject.toml or pixi.toml):
minimum-versions validate --policy ./policy.yaml --manifest-path pixi.toml pixi:test-env
where name in pixi:<name> is the name of the environment.
Again, we can validate multiple environments at once:
minimum-versions validate --policy ./policy.yaml --manifest-path pixi.toml pixi:test-env1 pixi:test-env2
time travel support
To check how validation would look at a certain point in time, use the --today option:
minimum-versions validate --policy ./policy.yaml ./env1.yaml --today 2025-10-01
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xarray_minimum_dependency_policy-2.0.0.tar.gz.
File metadata
- Download URL: xarray_minimum_dependency_policy-2.0.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df3bfdfea358ba3c8c434ccc33039af884c241dcab44685e6f4430243d241e8d
|
|
| MD5 |
32063572f1c44c6fc30085381cff239c
|
|
| BLAKE2b-256 |
1a3353c955f00498670e86c27592476a997c1b63900db1c62863c658c3860af9
|
Provenance
The following attestation bundles were made for xarray_minimum_dependency_policy-2.0.0.tar.gz:
Publisher:
pypi.yml on xarray-contrib/minimum-dependency-versions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xarray_minimum_dependency_policy-2.0.0.tar.gz -
Subject digest:
df3bfdfea358ba3c8c434ccc33039af884c241dcab44685e6f4430243d241e8d - Sigstore transparency entry: 774122899
- Sigstore integration time:
-
Permalink:
xarray-contrib/minimum-dependency-versions@10c2aa0b74609aa542d5dd9c42223f5804f43470 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/xarray-contrib
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@10c2aa0b74609aa542d5dd9c42223f5804f43470 -
Trigger Event:
release
-
Statement type:
File details
Details for the file xarray_minimum_dependency_policy-2.0.0-py3-none-any.whl.
File metadata
- Download URL: xarray_minimum_dependency_policy-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fce3095c67d5982dc0af575cd9cee5331000846f34abd630da8d7ee667ea020
|
|
| MD5 |
e8329adae72db6b35132d0ace295d91f
|
|
| BLAKE2b-256 |
3c615584740e8524c2b55ec7d7f35857a7c713276940c7095d5b1044b33d67e9
|
Provenance
The following attestation bundles were made for xarray_minimum_dependency_policy-2.0.0-py3-none-any.whl:
Publisher:
pypi.yml on xarray-contrib/minimum-dependency-versions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xarray_minimum_dependency_policy-2.0.0-py3-none-any.whl -
Subject digest:
7fce3095c67d5982dc0af575cd9cee5331000846f34abd630da8d7ee667ea020 - Sigstore transparency entry: 774122901
- Sigstore integration time:
-
Permalink:
xarray-contrib/minimum-dependency-versions@10c2aa0b74609aa542d5dd9c42223f5804f43470 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/xarray-contrib
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@10c2aa0b74609aa542d5dd9c42223f5804f43470 -
Trigger Event:
release
-
Statement type: