Skip to content

Commit 268e891

Browse files
authored
cruft update (#420)
Fixes #418 ## Summary by Sourcery Update project automation and linting configuration to align with the latest template and pinned GitHub Actions versions. Enhancements: - Adjust Ruff and typos configuration to refine ignored rules and identifiers and keep settings in sync with the template. - Update tox documentation build message to point to the correct HTML output path. CI: - Pin all GitHub Actions and shared workflows to specific commit SHAs and bump them to their latest compatible versions across CI and maintenance workflows. - Annotate the label sync action with its current version and tweak Dependabot cooldown settings for GitHub Actions updates. Chores: - Refresh pre-commit hook versions for security and tooling updates, including zizmor and ruff.
2 parents a3a3ca3 + 9ec3a45 commit 268e891

9 files changed

Lines changed: 30 additions & 26 deletions

File tree

.cruft.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/sunpy/package-template",
3-
"commit": "fb26c9794c872939b7e72bc7f30b943628384a8e",
3+
"commit": "a31905a50a3889e42d9ca50065a4a4276ea62511",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -24,6 +24,7 @@
2424
"include_cruft_update_github_workflow": "y",
2525
"use_extended_ruff_linting": "y",
2626
"matrix_room_id": "",
27+
"extra_ci_jobs": "",
2728
"_sphinx_theme": "sunpy",
2829
"_parent_project": "",
2930
"_install_requires": "",
@@ -33,7 +34,7 @@
3334
".github/workflows/sub_package_update.yml"
3435
],
3536
"_template": "https://github.com/sunpy/package-template",
36-
"_commit": "fb26c9794c872939b7e72bc7f30b943628384a8e"
37+
"_commit": "a31905a50a3889e42d9ca50065a4a4276ea62511"
3738
}
3839
},
3940
"directory": null

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: "monthly"
77
cooldown:
8-
default-days: 7
8+
default-days: 14 # Most updates should be from the package template
99
groups:
1010
actions:
1111
patterns:

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ permissions: {}
3131

3232
jobs:
3333
core:
34-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v3.0.1 # zizmor: ignore[unpinned-uses]
34+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
3535
with:
3636
submodules: false
3737
coverage: codecov
@@ -44,10 +44,10 @@ jobs:
4444
sdist_verify:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v7 # zizmor: ignore[unpinned-uses]
47+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4848
with:
4949
persist-credentials: false
50-
- uses: actions/setup-python@v7 # zizmor: ignore[unpinned-uses]
50+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
5151
with:
5252
python-version: '3.14'
5353
- run: python -m pip install -U --user build
@@ -57,7 +57,7 @@ jobs:
5757

5858
test:
5959
needs: [core, sdist_verify]
60-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v3.0.1 # zizmor: ignore[unpinned-uses]
60+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
6161
with:
6262
submodules: false
6363
coverage: codecov
@@ -72,7 +72,7 @@ jobs:
7272

7373
docs:
7474
needs: [core]
75-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v3.0.1 # zizmor: ignore[unpinned-uses]
75+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
7676
with:
7777
default_python: '3.13'
7878
submodules: false
@@ -123,7 +123,7 @@ jobs:
123123
contains(github.event.pull_request.labels.*.name, 'Run publish')
124124
)
125125
needs: [test, docs]
126-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v3.0.1 # zizmor: ignore[unpinned-uses]
126+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2
127127
with:
128128
python-version: '3.13'
129129
test_extras: 'all,tests'
@@ -143,7 +143,7 @@ jobs:
143143
name: pypi
144144
steps:
145145
- name: Download artifacts
146-
uses: actions/download-artifact@v8 # zizmor: ignore[unpinned-uses]
146+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
147147
with:
148148
merge-multiple: true
149149
pattern: dist-*
@@ -152,4 +152,4 @@ jobs:
152152
- run: ls -lha dist/
153153

154154
- name: Run upload
155-
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
155+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

.github/workflows/label_sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ jobs:
1818
runs-on: ubuntu-latest
1919
name: Label Sync
2020
steps:
21-
- uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd
21+
- uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd # v2.0.0
2222
with:
2323
config-file: https://raw.githubusercontent.com/sunpy/.github/main/labels.yml

.github/workflows/sub_package_update.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
contents: write
2323
pull-requests: write
2424
steps:
25-
- uses: actions/checkout@v7 # zizmor: ignore[unpinned-uses]
25+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2626
with:
2727
persist-credentials: false
2828

29-
- uses: actions/setup-python@v7 # zizmor: ignore[unpinned-uses]
29+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
3030
with:
3131
python-version: "3.14"
3232

@@ -79,7 +79,7 @@ jobs:
7979
8080
- name: Create pull request
8181
if: steps.cruft_json.outputs.has_changes == '1'
82-
uses: peter-evans/create-pull-request@v8 # zizmor: ignore[unpinned-uses]
82+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
8383
with:
8484
token: ${{ secrets.GITHUB_TOKEN }}
8585
add-paths: "."
@@ -104,7 +104,7 @@ jobs:
104104
issues: write
105105
steps:
106106
- name: Open an issue if workflow fails
107-
uses: actions/github-script@v9 # zizmor: ignore[unpinned-uses]
107+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
108108
with:
109109
github-token: ${{ github.token }}
110110
# This script is adapted from https://github.com/scientific-python/issue-from-pytest-log-action

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
exclude: "(.*/)?CITATION.rst$|.*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|aiapy/extern)$"
22
repos:
33
- repo: https://github.com/zizmorcore/zizmor-pre-commit
4-
rev: v1.26.1
4+
rev: v1.28.0
55
hooks:
66
- id: zizmor
77
# This should be before any formatting hooks like isort
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: "v0.15.20"
9+
rev: "v0.16.1"
1010
hooks:
1111
- id: ruff
1212
args: ["--fix", "--unsafe-fixes"]

_typos.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
default.extend-ignore-identifiers-re = [
2+
"afile",
23
"alog",
4+
"CPY001",
5+
"emiss",
6+
"hsi_",
37
"nd",
48
"nin",
59
"observ",
610
"ot",
11+
"precess",
12+
"precessed",
713
"te",
814
"upto",
9-
"afile",
10-
"precessed",
11-
"precess",
12-
"emiss",
13-
"hsi_",
1415
]

ruff.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ lint.extend-select = [
1111
"ALL",
1212
]
1313
lint.extend-ignore = [
14-
"I", # Ignore isort
1514
"ANN001", # Missing type annotation for function argument
1615
"ANN002", # Missing type annotation for variable
1716
"ANN003", # Missing type annotation for keyword
@@ -20,6 +19,7 @@ lint.extend-ignore = [
2019
"ANN205", # Missing return type annotation for staticmethod
2120
"ANN206", # Missing return type annotation for classmethod
2221
"COM812", # May cause conflicts when used with the formatter
22+
"CPY001", # Missing copyright notice at top of file
2323
"D200", # One-line docstring should fit on one line
2424
"D205", # 1 blank line required between summary line and description
2525
"D400", # First line should end with a period
@@ -29,8 +29,10 @@ lint.extend-ignore = [
2929
"F403", # unable to detect undefined names,
3030
"FIX001", # Line contains FIXME, consider resolving the issue
3131
"FIX002", # Line contains TODO, consider resolving the issue
32+
"I", # Ignore isort
3233
"ISC001", # May cause conflicts when used with the formatter
3334
"PLR0913", # Too many arguments in function definition
35+
"PLR0917", # Too many positional arguments
3436
"PLR2004", # Magic value used in comparison
3537
"SLF001", # Private member accessed
3638
"TD001", # Invalid TODO tag: `FIXME`

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pass_env =
2828
# If the user has set a LC override we should follow it
2929
LC_ALL
3030
set_env =
31+
COVERAGE_FILE={toxinidir}/.coverage
3132
MPLBACKEND = agg
3233
devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
33-
COVERAGE_FILE={toxinidir}/.coverage
3434
deps =
3535
# For packages which publish nightly wheels this will pull the latest nightly
3636
devdeps: astropy>=0.0.dev0
@@ -93,4 +93,4 @@ commands =
9393
_build/html \
9494
!gallery: -D plot_gallery=0 \
9595
{posargs}
96-
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'
96+
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "html" / "index.html"))'

0 commit comments

Comments
 (0)