Skip to content

Commit 4308eca

Browse files
committed
Created action
1 parent 3b51b9b commit 4308eca

10 files changed

Lines changed: 155 additions & 535 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.history
2+
chart.md
3+
schedule.md
4+
schedule.json

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-ast
7+
- id: check-builtin-literals
8+
- id: check-case-conflict
9+
- id: check-json
10+
- id: check-toml
11+
- id: check-yaml
12+
args: [--allow-multiple-documents]
13+
- id: debug-statements
14+
- id: end-of-file-fixer
15+
- id: mixed-line-ending
16+
- id: trailing-whitespace
17+
18+
- repo: https://github.com/rbubley/mirrors-prettier
19+
rev: 787fb9f542b140ba0b2aced38e6a3e68021647a3 # frozen: v3.5.3
20+
hooks:
21+
- id: prettier
22+
files: \.(css|html|md|yml|yaml|gql)
23+
args: [--prose-wrap=preserve]
24+
25+
- repo: https://github.com/astral-sh/ruff-pre-commit
26+
rev: 971923581912ef60a6b70dbf0c3e9a39563c9d47 # frozen: v0.11.4
27+
hooks:
28+
- id: ruff
29+
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
30+
- id: ruff-format
31+
32+
- repo: https://github.com/codespell-project/codespell
33+
rev: "63c8f8312b7559622c0d82815639671ae42132ac" # frozen: v2.4.1
34+
hooks:
35+
- id: codespell
36+
37+
ci:
38+
autofix_prs: false
39+
autofix_commit_msg: |
40+
'[pre-commit.ci 🤖] Apply code format tools to PR'
41+
autoupdate_schedule: quarterly

action.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Generate SPEC-0000 Data"
2+
description: "Based on the current SPEC 0 schedule, generate a tarball with the latest versions of all packages."
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up Python
8+
uses: actions/setup-python@v5
9+
with:
10+
python-version: "3.13"
11+
- name: Install dependencies
12+
shell: bash
13+
run: |
14+
pip install -r requirements.txt
15+
- name: Run spec_zero_versions.py
16+
shell: bash
17+
run: |
18+
python spec_zero_versions.py
19+
- name: Upload artifact
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: ${{ inputs.artifact-name }}
23+
path: "spec_zero_data/*.tar.xz"

readme.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPEC 0 Version Action
2+
3+
This repository contains a GitHub Action to generate the
4+
5+
### Drop Schedule
6+
7+
Below is an auto generated schedule with recommended dates for dropping support. We suggest that the next release in a given quarter is
8+
considered as the one removing support for a given item.
9+
10+
You may want to delay the removal of support of an older Python version until your package fully works on the newly released Python, thus keeping the number of supported minor versions of Python the same for your package.
11+
12+
{{< include-md "schedule.md" >}}
13+
14+
### Automatically updating dependencies
15+
16+
To help projects stay compliant with this spec, we additionally provide a `schedule.json` file that can be used by CI systems to deterime new version boundaries. The structure of the file is as follows:
17+
18+
```json
19+
[
20+
{
21+
"start_date": "iso8601_timestamp",
22+
"packages": {
23+
"package_name": "version"
24+
}
25+
}
26+
]
27+
```
28+
29+
All information in the json file is in a string format that should be easy to use. The date is the first timestamp of the relevant quarter. Thus a workflow for using this file could be:
30+
31+
1. fetch `schedule.json`
32+
2. determine maximum date that is smaller than current date
33+
3. update packages listed with new minimum versions
34+
35+
You can obtain the new versions you should set by using this `jq` expression:
36+
37+
```sh
38+
39+
jq 'map(select(.start_date |fromdateiso8601 |tonumber < now))| sort_by("start_date") | reverse | .[0].packages ' schedule.json
40+
41+
```
42+
43+
If you use a package manager like pixi you could update the dependencies with a bash script like this:
44+
45+
```sh
46+
curl -Ls -o schedule.json https://raw.githubusercontent.com/scientific-python/specs/main/spec-0000/schedule.json
47+
for line in $(jq 'map(select(.start_date |fromdateiso8601 |tonumber < now))| sort_by("start_date") | reverse | .[0].packages | to_entries | map(.key + ":" + .value)[]' --raw-output schedule.json); do
48+
package=$(echo "$line" | cut -d ':' -f 1)
49+
version=$(echo "$line" | cut -d ':' -f 2)
50+
if pixi list -x "^$package" &>/dev/null| grep "No packages" -q; then
51+
pixi add "$package>=$version";
52+
fi
53+
done
54+
55+
```

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pandas
2+
requests

spec-0000/chart.md

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)