Skip to content

Commit df061a8

Browse files
committed
Merge branch 'main' into refactor
2 parents f587a3e + 85bd465 commit df061a8

File tree

6 files changed

+42
-12
lines changed

6 files changed

+42
-12
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020

2121
steps:
2222
- name: clone the repository
23-
uses: actions/checkout@v5
23+
uses: actions/checkout@v6
2424
- name: setup python
25-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2626
with:
2727
python-version: "${{ matrix.python-version }}"
2828
- name: upgrade pip
@@ -50,24 +50,30 @@ jobs:
5050
envs/env1.yaml
5151
envs/env2.yaml
5252
expected-failure: ["false"]
53+
policy-file: ["policy.yaml"]
5354
include:
5455
- env-paths: |
5556
envs/failing-env1.yaml
57+
policy-file: "policy.yaml"
5658
expected-failure: "true"
5759
- env-paths: |
5860
envs/env1.yaml
5961
envs/failing-env1.yaml
62+
policy-file: "policy.yaml"
6063
expected-failure: "true"
64+
- env-paths: "envs/env1.yaml"
65+
policy-file: policy_no_extra_options.yaml
66+
expected-failure: "false"
6167

6268
steps:
6369
- name: clone the repository
64-
uses: actions/checkout@v5
70+
uses: actions/checkout@v6
6571
- name: run action
6672
uses: ./
6773
id: action-run
6874
continue-on-error: true
6975
with:
70-
policy: policy.yaml
76+
policy: ${{ matrix.policy-file }}
7177
environment-paths: ${{ matrix.env-paths }}
7278
today: 2024-12-20
7379
- name: detect outcome

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ repos:
44
hooks:
55
- id: trailing-whitespace
66
- id: end-of-file-fixer
7-
- repo: https://github.com/psf/black
8-
rev: 25.1.0
7+
- repo: https://github.com/psf/black-pre-commit-mirror
8+
rev: 25.9.0
99
hooks:
1010
- id: black
1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.12.11
12+
rev: v0.14.3
1313
hooks:
1414
- id: ruff
1515
args: ["--fix"]

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ policy:
3232
- package4
3333
```
3434
35-
then add a new step to CI:
35+
If there are no packages with `overrides`, `exclude`, or `ignored_violations`, you can set
36+
them to an empty mapping or sequence, respectively:
37+
38+
```yaml
39+
...
40+
overrides: {}
41+
exclude: []
42+
ignored_violations: []
43+
```
44+
45+
Then add a new step to CI:
3646

3747
```yaml
3848
jobs:

action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ runs:
3838
ENVIRONMENT_PATHS: ${{ inputs.environment-paths }}
3939
TODAY: ${{ inputs.today }}
4040
run: |
41-
python minimum_versions.py --today="$TODAY" --policy="$POLICY_PATH" $ENVIRONMENT_PATHS
41+
python ${{ github.action_path }}/minimum_versions.py --today="$TODAY" --policy="$POLICY_PATH" $ENVIRONMENT_PATHS

minimum_versions/policy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
"packages": {
1818
"type": "object",
1919
"patternProperties": {
20-
"^[a-z][-a-z_]*$": {"type": "integer", "minimum": 1}
20+
"^[a-z][a-z0-9_-]*$": {"type": "integer", "minimum": 1}
2121
},
2222
"additionalProperties": False,
2323
},
2424
"default": {"type": "integer", "minimum": 1},
2525
"overrides": {
2626
"type": "object",
2727
"patternProperties": {
28-
"^[a-z][-a-z_]*": {"type": "string", "format": "date"}
28+
"^[a-z][a-z0-9_-]*": {"type": "string", "format": "date"}
2929
},
3030
"additionalProperties": False,
3131
},
3232
"exclude": {"type": "array", "items": {"type": "string"}},
3333
"ignored_violations": {
3434
"type": "array",
35-
"items": {"type": "string", "pattern": "^[a-z][-a-z_]*$"},
35+
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_-]*$"},
3636
},
3737
},
3838
"required": [

policy_no_extra_options.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
channels:
2+
- conda-forge
3+
platforms:
4+
- noarch
5+
- linux-64
6+
policy:
7+
# all packages in months
8+
packages:
9+
python: 30
10+
numpy: 18
11+
default: 12
12+
overrides: {}
13+
exclude: []
14+
ignored_violations: []

0 commit comments

Comments
 (0)