From 410b00addf492e97c6e249962376f53f2cfb9ceb Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Wed, 10 Sep 2025 12:18:22 +0200 Subject: [PATCH 1/2] policy: make overrides, exclude and ignored_validations optional --- .github/workflows/ci.yml | 5 ++++- envs/env3.yaml | 5 +++++ minimum_versions.py | 9 +++------ policy_no_extra_options.yaml | 11 +++++++++++ 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 envs/env3.yaml create mode 100644 policy_no_extra_options.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c911e61..a04720c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: envs/env1.yaml envs/env2.yaml expected-failure: ["false"] + policy-file: ["policy.yaml"] include: - env-paths: | envs/failing-env1.yaml @@ -58,6 +59,8 @@ jobs: envs/env1.yaml envs/failing-env1.yaml expected-failure: "true" + - env-paths: "envs/env3.yaml" + policy-file: policy_no_extra_options.yaml steps: - name: clone the repository @@ -67,7 +70,7 @@ jobs: id: action-run continue-on-error: true with: - policy: policy.yaml + policy: ${{ matrix.policy-file }} environment-paths: ${{ matrix.env-paths }} today: 2024-12-20 - name: detect outcome diff --git a/envs/env3.yaml b/envs/env3.yaml new file mode 100644 index 0000000..cd9ceac --- /dev/null +++ b/envs/env3.yaml @@ -0,0 +1,5 @@ +channels: + - conda-forge +dependencies: + - python=3.10 + - numpy=1.24 diff --git a/minimum_versions.py b/minimum_versions.py index f2bdaa2..1133347 100644 --- a/minimum_versions.py +++ b/minimum_versions.py @@ -52,9 +52,6 @@ "required": [ "packages", "default", - "overrides", - "exclude", - "ignored_violations", ], }, }, @@ -167,11 +164,11 @@ def parse_policy(file): return Policy( channels=policy["channels"], platforms=policy["platforms"], - exclude=package_policy["exclude"], + exclude=package_policy.get("exclude", {}), package_months=package_policy["packages"], default_months=package_policy["default"], - ignored_violations=package_policy["ignored_violations"], - overrides=package_policy["overrides"], + ignored_violations=package_policy.get("ignored_violations", {}), + overrides=package_policy.get("overrides", {}), ) diff --git a/policy_no_extra_options.yaml b/policy_no_extra_options.yaml new file mode 100644 index 0000000..5c398aa --- /dev/null +++ b/policy_no_extra_options.yaml @@ -0,0 +1,11 @@ +channels: + - conda-forge +platforms: + - noarch + - linux-64 +policy: + # all packages in months + packages: + python: 30 + numpy: 18 + default: 12 From 0071b267a60f88fc539e41625f3c3b0e4536eda3 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Wed, 10 Sep 2025 12:26:42 +0200 Subject: [PATCH 2/2] add missing args in include --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a04720c..e1c2ccd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,16 @@ jobs: include: - env-paths: | envs/failing-env1.yaml + policy-file: "policy.yaml" expected-failure: "true" - env-paths: | envs/env1.yaml envs/failing-env1.yaml + policy-file: "policy.yaml" expected-failure: "true" - env-paths: "envs/env3.yaml" policy-file: policy_no_extra_options.yaml + expected-failure: "false" steps: - name: clone the repository