Skip to content

Commit b93e078

Browse files
committed
Update cruft with batchpr
1 parent 23a7544 commit b93e078

9 files changed

Lines changed: 129 additions & 74 deletions

File tree

.cruft.json

Lines changed: 2 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": "4268346dead7b529a3d53df19bcf374bb2bbef34",
3+
"commit": "44ff5c06778e86b845dab595ebf338ba876d495e",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -32,7 +32,7 @@
3232
".github/workflows/sub_package_update.yml"
3333
],
3434
"_template": "https://github.com/sunpy/package-template",
35-
"_commit": "4268346dead7b529a3d53df19bcf374bb2bbef34"
35+
"_commit": "44ff5c06778e86b845dab595ebf338ba876d495e"
3636
}
3737
},
3838
"directory": null

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "monthly"
7+
cooldown:
8+
default-days: 7

.github/workflows/ci.yml

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ on:
1616
# Allow manual runs through the web UI
1717
workflow_dispatch:
1818
# Trigger on completion of the scheduled_builds.yml file (only on main)
19-
workflow_run:
19+
workflow_run: # zizmor: ignore[dangerous-triggers] # TODO: Fix our cron job hell
2020
workflows: [Scheduled build triggerer]
2121

2222
concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: true
2525

26+
permissions: {}
27+
2628
jobs:
2729
core:
28-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
30+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
2931
with:
3032
submodules: false
3133
coverage: codecov
@@ -39,11 +41,10 @@ jobs:
3941
sdist_verify:
4042
runs-on: ubuntu-latest
4143
steps:
42-
- uses: actions/checkout@v6
44+
- uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses]
4345
with:
44-
fetch-tags: true
45-
fetch-depth: 0
46-
- uses: actions/setup-python@v6
46+
persist-credentials: false
47+
- uses: actions/setup-python@v6 # zizmor: ignore[unpinned-uses]
4748
with:
4849
python-version: '3.13'
4950
- run: python -m pip install -U --user build
@@ -52,8 +53,8 @@ jobs:
5253
- run: python -m twine check dist/*
5354

5455
test:
55-
needs: [core]
56-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
56+
needs: [core, sdist_verify]
57+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
5758
with:
5859
submodules: false
5960
coverage: codecov
@@ -74,7 +75,7 @@ jobs:
7475

7576
docs:
7677
needs: [core]
77-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
78+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
7879
with:
7980
default_python: '3.13'
8081
submodules: false
@@ -95,7 +96,7 @@ jobs:
9596
online:
9697
if: "!startsWith(github.event.ref, 'refs/tags/v')"
9798
needs: [docs]
98-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
99+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
99100
with:
100101
default_python: '3.13'
101102
submodules: false
@@ -118,7 +119,7 @@ jobs:
118119
secrets:
119120
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
120121

121-
publish:
122+
build_dists:
122123
# Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.*
123124
# see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi
124125
if: |
@@ -128,46 +129,71 @@ jobs:
128129
contains(github.event.pull_request.labels.*.name, 'Run publish')
129130
)
130131
needs: [test, docs]
131-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v2
132+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v2 # zizmor: ignore[unpinned-uses]
132133
with:
133-
upload_to_anaconda: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
134-
anaconda_user: scientific-python-nightly-wheels
135-
anaconda_package: sunpy
136-
anaconda_keep_n_latest: 1
137-
sdist: false
138-
test_extras: 'tests'
139-
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunpy'
140-
submodules: false
134+
sdist: true
141135
targets: |
142136
- cp3{12,13,14}-manylinux*_x86_64
143137
- cp3{12,13,14}-macosx_x86_64
144138
- cp3{12,13,14}-macosx_arm64
145139
- cp3{12,13,14}-win_amd64
146140
- target: cp3{12,13,14}-manylinux_aarch64
147141
runs-on: ubuntu-24.04-arm
142+
test_extras: 'tests'
143+
test_command: 'pytest -p no:warnings --doctest-rst --pyargs sunpy'
144+
submodules: false
145+
save_artifacts: true
146+
upload_to_pypi: false
147+
upload_to_anaconda: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') }}
148+
anaconda_user: scientific-python-nightly-wheels
149+
anaconda_package: sunpy
150+
anaconda_keep_n_latest: 1
148151
secrets:
149-
pypi_token: ${{ secrets.pypi_token }}
150152
anaconda_token: ${{ secrets.anaconda_org_upload_token }}
151153

152154
publish_pure:
153155
needs: [publish]
154-
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2
156+
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2 # zizmor: ignore[unpinned-uses]
155157
with:
156158
python-version: "3.13"
157159
test_extras: 'tests'
158160
test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs sunpy'
159161
submodules: false
160162
env: |
161163
SUNPY_NO_BUILD_ANA_EXTENSION: 1
162-
secrets:
163-
pypi_token: ${{ secrets.pypi_token }}
164+
save_artifacts: true
165+
upload_to_pypi: false
166+
167+
publish:
168+
if: startsWith(github.ref, 'refs/tags/v')
169+
name: Upload to PyPI
170+
runs-on: ubuntu-latest
171+
needs: [build_dists]
172+
permissions:
173+
id-token: write
174+
environment:
175+
name: pypi
176+
steps:
177+
- name: Download artifacts
178+
uses: actions/download-artifact@v7 # zizmor: ignore[unpinned-uses]
179+
with:
180+
merge-multiple: true
181+
pattern: dist-*
182+
path: dist
183+
184+
- run: ls -lha dist/
185+
186+
- name: Run upload
187+
uses: pypa/gh-action-pypi-publish@v1 # zizmor: ignore[unpinned-uses]
164188

165189
notify:
166190
if: always() && (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run')
167191
needs: [publish_pure, online]
192+
environment:
193+
name: matrix
168194
runs-on: ubuntu-latest
169195
steps:
170-
- uses: Cadair/matrix-notify-action@main
196+
- uses: Cadair/matrix-notify-action@main # zizmor: ignore[unpinned-uses]
171197
with:
172198
matrix_token: ${{ secrets.matrix_access_token }}
173199
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sub_package_update.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,20 @@ on:
1313
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
1414
- cron: '0 7 * * 1' # Every Monday at 7am UTC
1515

16+
permissions: {}
17+
1618
jobs:
1719
update:
1820
runs-on: ubuntu-latest
1921
permissions:
2022
contents: write
2123
pull-requests: write
22-
strategy:
23-
fail-fast: true
2424
steps:
25-
- uses: actions/checkout@v6
25+
- uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses]
26+
with:
27+
persist-credentials: false
2628

27-
- uses: actions/setup-python@v6
29+
- uses: actions/setup-python@v6 # zizmor: ignore[unpinned-uses]
2830
with:
2931
python-version: "3.14"
3032

@@ -50,8 +52,8 @@ jobs:
5052
id: cruft_update
5153
if: steps.check.outputs.has_changes == '1'
5254
run: |
53-
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
54-
git config --global user.name "${{ github.actor }}"
55+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
56+
git config --global user.name "${GITHUB_ACTOR}"
5557
5658
cruft_output=$(cruft update --skip-apply-ask --refresh-private-variables)
5759
echo $cruft_output
@@ -77,7 +79,7 @@ jobs:
7779
7880
- name: Create pull request
7981
if: steps.cruft_json.outputs.has_changes == '1'
80-
uses: peter-evans/create-pull-request@v8
82+
uses: peter-evans/create-pull-request@v8 # zizmor: ignore[unpinned-uses]
8183
with:
8284
token: ${{ secrets.GITHUB_TOKEN }}
8385
add-paths: "."
@@ -104,7 +106,7 @@ jobs:
104106
issues: write
105107
steps:
106108
- name: Open an issue if workflow fails
107-
uses: actions/github-script@v7
109+
uses: actions/github-script@v7 # zizmor: ignore[unpinned-uses]
108110
with:
109111
github-token: ${{ github.token }}
110112
# This script is adapted from https://github.com/scientific-python/issue-from-pytest-log-action
@@ -152,7 +154,7 @@ jobs:
152154
repo: variables.name,
153155
body: issue_body,
154156
title: variables.title,
155-
labels: [variables.label],
157+
labels: [variables.label, "pre-commit.ci autofix"],
156158
});
157159
} else {
158160
await github.rest.issues.update({

.pre-commit-config.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,61 @@
1-
exclude: ".*(.csv|.fits|.fts|.fit|.header|.txt|tca.*|.json|.asdf)$|^CITATION.rst|tools\/|sunpy\/extern\/|sunpy\/io\/src\/ana\/"
21
repos:
2+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
3+
rev: v1.23.1
4+
hooks:
5+
- id: zizmor
36
# This should be before any formatting hooks like isort
47
- repo: https://github.com/astral-sh/ruff-pre-commit
58
rev: "v0.15.4"
69
hooks:
710
- id: ruff
811
args: ["--fix"]
12+
types: [python]
13+
# Define here once and then reference using YAML anchor
14+
exclude: &exclude_dirs ^sunpy/(data|extern)/
915
- repo: https://github.com/PyCQA/isort
1016
rev: 8.0.1
1117
hooks:
1218
- id: isort
19+
types: [python]
20+
exclude: *exclude_dirs
1321
- repo: https://github.com/pre-commit/pre-commit-hooks
1422
rev: v6.0.0
1523
hooks:
1624
- id: check-ast
25+
types: [python]
26+
exclude: *exclude_dirs
1727
- id: check-case-conflict
28+
types: [python]
29+
exclude: *exclude_dirs
1830
- id: trailing-whitespace
31+
types_or: [python, rst]
1932
- id: check-yaml
33+
types: [yaml]
34+
exclude: *exclude_dirs
35+
- id: check-toml
36+
types: [toml]
37+
exclude: *exclude_dirs
2038
- id: debug-statements
39+
types: [python]
40+
exclude: *exclude_dirs
2141
- id: check-added-large-files
2242
args: ["--enforce-all", "--maxkb=1054"]
2343
exclude: ""
2444
- id: end-of-file-fixer
45+
types_or: [python, rst]
2546
- id: mixed-line-ending
47+
types_or: [python, rst]
2648
- repo: https://github.com/adhtruong/mirrors-typos
2749
rev: v1.38.1
2850
hooks:
2951
- id: typos
52+
types_or: [python, rst]
53+
exclude: *exclude_dirs
54+
- repo: meta
55+
hooks:
56+
- id: check-hooks-apply
57+
# This may fail if you do not have matching files in the data/ or extern/ directories
58+
- id: check-useless-excludes
3059
- repo: local
3160
hooks:
3261
- id: generate-sunpy-net-hek-attrs

0 commit comments

Comments
 (0)