Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
444 commits
Select commit Hold shift + click to select a range
e912bfc
pre-commit updates in the template (#125)
Cadair Sep 25, 2024
dcd5ea6
better version parsing for docs build
wtbarnes Sep 17, 2024
33f857c
use base version
wtbarnes Sep 24, 2024
68df6ae
Update conf.py
wtbarnes Sep 25, 2024
93135e0
Add packaging dep to docs
Cadair Sep 25, 2024
17602ec
Better version parsing for docs build (#123)
Cadair Sep 25, 2024
174811c
Add an is_release variable
Cadair Sep 30, 2024
68d0582
Update conf.py
Cadair Sep 30, 2024
bc171f1
Update conf.py
Cadair Sep 30, 2024
b5bbed7
Add an is_release variable (#126)
Cadair Sep 30, 2024
e29ff49
[create-pull-request] automated change
Cadair Oct 2, 2024
e4da826
pre-commit updates in the template (#127)
Cadair Oct 2, 2024
c11a88c
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Oct 8, 2024
f7f4aa6
[pre-commit.ci] pre-commit autoupdate (#128)
nabobalis Oct 8, 2024
1f8da70
[create-pull-request] automated change
Cadair Oct 9, 2024
dd83077
pre-commit updates in the template (#129)
nabobalis Oct 9, 2024
3f5d6fc
Update __init__.py
Cadair Oct 16, 2024
ed1ad67
remove mention of drms (#130)
Cadair Oct 16, 2024
8334c24
Adds graphviz arguments to docs/conf
CyclingNinja Oct 16, 2024
7b0225e
Adds graphviz arguments to docs/conf (#131)
Cadair Oct 17, 2024
a6c38c5
Update conf.py
Cadair Oct 21, 2024
aec53b8
Update conf.py
Cadair Oct 21, 2024
653a294
[create-pull-request] automated change
Cadair Oct 23, 2024
69d58df
Adds proposed new .ruff.toml
CyclingNinja Oct 28, 2024
083d204
Modifies tox[testing] tox[test]
CyclingNinja Oct 28, 2024
b7264b7
Merge branch 'main' of github.com:sunpy/package-template into home_ruff
CyclingNinja Oct 28, 2024
50c3017
pre-commit updates in the template (#134)
Cadair Oct 28, 2024
d4075da
Make relative imports absolute
CyclingNinja Oct 28, 2024
3160866
Add logic to allow flexible roll out of ruff lint
CyclingNinja Oct 28, 2024
7184bf1
add ruff to test matrix
CyclingNinja Oct 28, 2024
138304f
fix syntax by removing it
CyclingNinja Oct 28, 2024
07a5eea
Adds proposed new .ruff.toml (#135)
Cadair Oct 29, 2024
892a1a7
Uses SunPy docs theme in template
CyclingNinja Oct 29, 2024
ec23899
Adds sunpy-sphinx-theme deps
CyclingNinja Oct 29, 2024
748d6ca
Applies SunPy docs theme in template (#136)
Cadair Oct 29, 2024
4e4a456
[create-pull-request] automated change
Cadair Oct 30, 2024
37a592b
pre-commit updates in the template (#137)
Cadair Oct 30, 2024
dca494c
Only run pre-commit update monthly
Cadair Oct 30, 2024
707f39d
Fix ruff and hidden cookies
Cadair Oct 30, 2024
2f0f5dd
Fix niggles in ruff.toml (#138)
Cadair Oct 30, 2024
58f6da5
Improve cruft workflow
Cadair Oct 30, 2024
ccdc2f5
Fix examples exclude pattern
Cadair Oct 30, 2024
d987170
Make the cruft update workflow smarter (#139)
CyclingNinja Oct 30, 2024
a61f804
ignore print in example mod code
Cadair Oct 30, 2024
cbe7fa9
Merge branch 'main' into fix_examples_ignore
CyclingNinja Oct 30, 2024
51fb616
Fix examples exclude pattern (#140)
Cadair Oct 30, 2024
bdac705
Ignore F405 in __init__.py
CyclingNinja Oct 30, 2024
aae6367
Update .ruff.toml
Cadair Oct 31, 2024
79045ff
Update .ruff.toml
Cadair Oct 31, 2024
6c92c2f
Ignore F405 in __init__.py (#141)
Cadair Oct 31, 2024
3fdfcf3
More ruff
Cadair Oct 31, 2024
4ca8e60
More ruff (#142)
CyclingNinja Oct 31, 2024
3ebe50e
Add label sync workflow
Cadair Oct 31, 2024
3482e31
[create-pull-request] automated change
Cadair Nov 6, 2024
806a616
pre-commit updates in the template (#146)
nabobalis Nov 6, 2024
f0e9789
Remove N from extended ruff rules
Cadair Nov 11, 2024
fb114e3
Remove N from extended ruff rules (#147)
nabobalis Nov 11, 2024
351fc4a
Add label sync workflow (#144)
nabobalis Nov 11, 2024
a689df8
Fix label config URL
Cadair Nov 11, 2024
75f84c4
Give label sync workflow write permissions for issues
Cadair Nov 11, 2024
d6e545d
Adds Giles and Towncrier config
CyclingNinja Nov 12, 2024
2a57567
[create-pull-request] automated change
Cadair Nov 13, 2024
c558494
Merge branch 'main' of github.com:sunpy/package-template into add_tow…
CyclingNinja Nov 13, 2024
93422b3
pre-commit updates in the template (#148)
nabobalis Nov 13, 2024
bec8528
Give label sync workflow write permissions for issues
Cadair Nov 11, 2024
b45ef1f
Temporarily removes figure tests in giles config
CyclingNinja Nov 14, 2024
bb7d084
Adds changelog infrastructure
CyclingNinja Nov 14, 2024
e4c2311
Merge branch 'main' of github.com:sunpy/package-template into add_tow…
CyclingNinja Nov 14, 2024
9f1eacb
Adds sphinx_changelog extension in conf.py
CyclingNinja Nov 14, 2024
7ddb162
Adds sphinx changelog and min versions for sphinx documentatoin
CyclingNinja Nov 14, 2024
68fed7e
Merge branch 'main' of github.com:sunpy/package-template
CyclingNinja Nov 15, 2024
1c43e10
Updates urls to wrap in with the package template
CyclingNinja Nov 18, 2024
d9d5cc2
[create-pull-request] automated change
Cadair Nov 20, 2024
cd21e0d
pre-commit updates in the template (#151)
nabobalis Nov 20, 2024
834b578
TST: Dependabot
Cadair Nov 26, 2024
1a52ab8
TST: Dependabot 2
Cadair Nov 26, 2024
44e8070
Use hashes for parent workflows and versions for template
Cadair Nov 26, 2024
f8fa755
Apply suggestions from code review
Cadair Nov 26, 2024
d964d67
Adds project url options to cookiecutter
CyclingNinja Nov 15, 2024
369d592
Adds projecturls baked cookies test
CyclingNinja Nov 26, 2024
6e3e8cb
Merge branch 'main' of github.com:sunpy/package-template into url_exp…
CyclingNinja Nov 26, 2024
0c42134
Update {{ cookiecutter.package_name }}/pyproject.toml
CyclingNinja Nov 26, 2024
a73c0d5
Use hashes for parent workflows and versions for template (#152)
Cadair Nov 27, 2024
7d8b2a2
Bump OpenAstronomy/github-actions-workflows
dependabot[bot] Nov 27, 2024
837ec01
Bump OpenAstronomy/github-actions-workflows from 1.13.0 to 1.14.0 in …
Cadair Nov 27, 2024
682594e
Merge branch 'main' into url_expansion
CyclingNinja Nov 27, 2024
6407d13
Relocates the project.urls block in toml
CyclingNinja Nov 28, 2024
2126cd4
Adds sourcecode/github processing in cookiecutteR
CyclingNinja Nov 28, 2024
3c05b14
Update cookiecutter.json
CyclingNinja Nov 28, 2024
2166b21
Update cookiecutter.json
CyclingNinja Nov 28, 2024
f99616a
Update cookiecutter.json
CyclingNinja Nov 28, 2024
5798006
Update cookiecutter.json
CyclingNinja Nov 28, 2024
ed2ca4c
Update cookiecutter.json
CyclingNinja Nov 28, 2024
1ff00c7
Update cookiecutter.json
CyclingNinja Nov 28, 2024
8bdd26a
Adds github slug option
CyclingNinja Nov 28, 2024
ef5181e
Fixes stray `github_repo`
CyclingNinja Nov 28, 2024
45a8f51
[create-pull-request] automated change
Cadair Dec 1, 2024
0bb9b80
Adds new test to fixture list
CyclingNinja Nov 28, 2024
052eeaa
Update .ruff.toml
Cadair Dec 3, 2024
81a2a7d
Update example_mod.py
Cadair Dec 3, 2024
e3789bc
pre-commit updates in the template (#155)
nabobalis Dec 3, 2024
1a74e6d
Merge branch 'main' into url_expansion
Cadair Dec 3, 2024
065ebd1
Adds new test to fixture list
CyclingNinja Nov 28, 2024
569370f
Merge branch 'url_expansion' of github.com:CyclingNinja/package-templ…
CyclingNinja Dec 3, 2024
e6ddd22
Update cookiecutter.json
CyclingNinja Dec 3, 2024
43d31ac
Update cookiecutter.json
CyclingNinja Dec 3, 2024
39e29a9
Update cookiecutter.json
Cadair Dec 4, 2024
d7e01fd
Adds configuration of wider url behaviours in cookiecutter (#150)
Cadair Dec 4, 2024
b3a28df
Merge branch 'main' of github.com:sunpy/package-template into add_tow…
CyclingNinja Dec 4, 2024
c1c6935
Propogates cookiecutter.changelog_url in .toml
CyclingNinja Dec 4, 2024
037ce9c
Applies github_repo to changelog link
CyclingNinja Dec 4, 2024
02ebbfc
Update {{ cookiecutter.package_name }}/pyproject.toml
CyclingNinja Dec 5, 2024
cde42da
Update {{ cookiecutter.package_name }}/pyproject.toml
CyclingNinja Dec 5, 2024
d42c74f
Update {{ cookiecutter.package_name }}/docs/whatsnew/index.rst
CyclingNinja Dec 5, 2024
faa27f6
Update {{ cookiecutter.package_name }}/docs/whatsnew/index.rst
CyclingNinja Dec 5, 2024
2b46a9f
Update {{ cookiecutter.package_name }}/pyproject.toml
CyclingNinja Dec 5, 2024
2463c5d
Update {{ cookiecutter.package_name }}/pyproject.toml
CyclingNinja Dec 5, 2024
d0c12e5
Update {{ cookiecutter.package_name }}/pyproject.toml
Cadair Dec 6, 2024
3737aa3
Adds towncrier and giles config (#149)
Cadair Dec 6, 2024
45ef2be
Update the batchpr script some more
Cadair Dec 6, 2024
cd586dc
Adds further documentation on cruft
CyclingNinja Dec 6, 2024
d023b08
Bump OpenAstronomy/github-actions-workflows
dependabot[bot] Dec 9, 2024
d4cc8d5
Fix issue_url
Cadair Dec 9, 2024
5446d70
Fix issue_url again
Cadair Dec 9, 2024
d32c2ef
Bump OpenAstronomy/github-actions-workflows from 1.14.0 to 1.15.0 in …
nabobalis Dec 9, 2024
136004b
[create-pull-request] automated change
Cadair Dec 11, 2024
c66950b
pre-commit updates in the template (#159)
nabobalis Dec 11, 2024
1b3a908
Add no changelog label to update PRs
Cadair Dec 16, 2024
5ff9d6c
Add no changelog label to update PRs (#162)
nabobalis Dec 16, 2024
a0de03c
[create-pull-request] automated change
Cadair Dec 18, 2024
b34ea13
pre-commit updates in the template (#163)
nabobalis Dec 18, 2024
3396a46
Update the batchpr script some more (#156)
Cadair Dec 18, 2024
10f7258
Fix package name in towncrier configuration
samaloney Dec 13, 2024
9d9cdcf
Add a tests for different package / module name
Cadair Dec 18, 2024
c60ccf2
Fix package name in towncrier configuration (#161)
Cadair Dec 18, 2024
c11ab1d
Even more batchpr
Cadair Dec 18, 2024
dcda94c
Even more batchpr (#164)
nabobalis Dec 18, 2024
3a6dfb9
Merge branch 'main' of github.com:sunpy/package-template into docs_cruft
CyclingNinja Dec 20, 2024
a193655
remove html theme options
CyclingNinja Dec 20, 2024
a0fe07d
[create-pull-request] automated change
Cadair Dec 25, 2024
f14be4e
pre-commit updates in the template (#165)
nabobalis Dec 25, 2024
8b25d68
Bump peter-evans/create-pull-request
dependabot[bot] Dec 30, 2024
5f101bf
Bump peter-evans/create-pull-request from 7.0.5 to 7.0.6 in the actio…
nabobalis Dec 30, 2024
9bb5c19
[create-pull-request] automated change
Cadair Jan 8, 2025
d6b86e0
pre-commit updates in the template (#168)
nabobalis Jan 8, 2025
978957b
[create-pull-request] automated change
Cadair Jan 15, 2025
ff0522b
pre-commit updates in the template (#169)
Cadair Jan 15, 2025
333bf62
[create-pull-request] automated change
Cadair Jan 22, 2025
37ffb52
pre-commit updates in the template (#172)
nabobalis Jan 22, 2025
1f8ae7f
[create-pull-request] automated change
Cadair Jan 29, 2025
fde2382
Update .readthedocs.yaml
nabobalis Jan 29, 2025
88bedc4
pre-commit updates in the template (#173)
nabobalis Jan 29, 2025
10eaaa4
Merge branch 'main' of github.com:OpenAstronomy/packaging-guide into …
Cadair Jan 29, 2025
2d7ac70
Whoops
Cadair Jan 29, 2025
d1c5aec
Manual update from OA (#174)
Cadair Jan 29, 2025
9654978
[create-pull-request] automated change
Cadair Feb 1, 2025
29db356
pre-commit updates in the template (#175)
nabobalis Feb 1, 2025
539bcae
Bump the actions group across 1 directory with 2 updates
dependabot[bot] Feb 3, 2025
4fbd480
Bump the actions group across 1 directory with 2 updates (#176)
nabobalis Feb 3, 2025
415b289
change code examples from openastronomy to sunpy
jgieseler Feb 6, 2025
2b52e8c
Change code examples from openastronomy to sunpy (#178)
Cadair Feb 6, 2025
6287a27
Merge branch 'OpenAstronomy/main' into main (with unresolved conflicts)
Cadair Feb 6, 2025
d7fa4e2
Update pyproject.toml
nabobalis Feb 6, 2025
c77e311
Updates from OpenAstronomy/packaging-guide (#179)
nabobalis Feb 6, 2025
5748596
Add line breaks to long signatures in API docs
nabobalis Feb 7, 2025
3411c10
Add AI-Note
ankitkhushwaha Feb 8, 2025
4f11e36
Add AI-Note (#182)
nabobalis Feb 8, 2025
9749d8e
Update README.rst
Cadair Feb 10, 2025
df1f099
Add line breaks to long signatures in API docs (#180)
nabobalis Feb 11, 2025
c3a49e3
Merge branch 'main' into docs_cruft
nabobalis Feb 11, 2025
5ff78f2
Apply suggestions from code review
nabobalis Feb 11, 2025
1ab5193
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 11, 2025
1ee4816
Update rtd_environment.yaml
nabobalis Feb 11, 2025
2743b19
Update index.rst
nabobalis Feb 11, 2025
3e64521
Update rtd_environment.yaml
nabobalis Feb 11, 2025
49960ff
Update docs/index.rst
nabobalis Feb 11, 2025
1c9970c
Update docs/rtd_environment.yaml
nabobalis Feb 11, 2025
9c8f244
Adds further documentation on cruft (#157)
nabobalis Feb 11, 2025
3a1e779
[create-pull-request] automated change
Cadair Feb 12, 2025
09c4b02
pre-commit updates in the template (#183)
nabobalis Feb 12, 2025
81778d5
Update ci.yml
CyclingNinja Feb 19, 2025
f1d92f9
Add devdeeps to test
CyclingNinja Feb 19, 2025
91b3627
Update ci.yml
Cadair Feb 20, 2025
45a54a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 20, 2025
e0e2aa7
Remove cron deploy from ci.yml (#185)
Cadair Feb 20, 2025
062bbce
Merge branch 'OpenAstronomy/main' into main
Cadair Feb 24, 2025
634b247
Bump peter-evans/create-pull-request
dependabot[bot] Feb 24, 2025
9d63de0
Updates from OpenAstronomy/packaging-guide (#186)
Cadair Feb 24, 2025
063658c
Bump peter-evans/create-pull-request from 7.0.6 to 7.0.7 in the actio…
Cadair Feb 24, 2025
a8aeef9
[create-pull-request] automated change
Cadair Feb 26, 2025
7877cc9
pre-commit updates in the template (#188)
nabobalis Feb 26, 2025
fa87437
[create-pull-request] automated change
Cadair Mar 1, 2025
d0b7fbc
pre-commit updates in the template (#189)
nabobalis Mar 1, 2025
0365554
Bump peter-evans/create-pull-request
dependabot[bot] Mar 10, 2025
d0b4146
Bump peter-evans/create-pull-request from 7.0.7 to 7.0.8 in the actio…
nabobalis Mar 10, 2025
d13f022
[create-pull-request] automated change
Cadair Mar 12, 2025
af9aabb
pre-commit updates in the template (#191)
nabobalis Mar 12, 2025
75d7aa0
[create-pull-request] automated change
Cadair Mar 26, 2025
75bb72f
pre-commit updates in the template (#193)
nabobalis Mar 26, 2025
310f938
Bump actions/setup-python in the actions group across 1 directory
dependabot[bot] Mar 31, 2025
d1ba076
Bump actions/setup-python from 5.4.0 to 5.5.0 in the actions group ac…
nabobalis Mar 31, 2025
5a4f4af
[create-pull-request] automated change
Cadair Apr 9, 2025
b60690b
pre-commit updates in the template (#195)
nabobalis Apr 9, 2025
46452cd
Update pre-commit-update.yaml
Cadair Apr 15, 2025
3b42210
Bump actions/setup-python in the actions group across 1 directory
dependabot[bot] Apr 28, 2025
6f783ab
Bump actions/setup-python from 5.5.0 to 5.6.0 in the actions group ac…
nabobalis Apr 28, 2025
78ec72a
[create-pull-request] automated change
Cadair May 1, 2025
57a6cb0
pre-commit updates in the template (#197)
nabobalis May 1, 2025
5b72b62
Merge branch 'OpenAstronomy/main' into main (with unresolved conflicts)
Cadair May 6, 2025
aecee0f
Update pyproject.toml
Cadair May 6, 2025
12de35d
Updates from OpenAstronomy/packaging-guide (#199)
Cadair May 6, 2025
76194c6
[create-pull-request] automated change
Cadair Jun 1, 2025
1bdd28c
pre-commit updates in the template (#201)
nabobalis Jun 1, 2025
9dfda82
Bump OpenAstronomy/github-actions-workflows
dependabot[bot] Jun 9, 2025
58db922
Bump OpenAstronomy/github-actions-workflows from 1.16.0 to 1.17.0 in …
nabobalis Jun 9, 2025
21e1b2b
Update OpenAstronomy Workflows to v2
Cadair Jun 11, 2025
c91869d
Python version bumps
Cadair Jun 11, 2025
15fdf53
Update OpenAstronomy Workflows to v2 (#203)
nabobalis Jun 11, 2025
405404e
Bump OpenAstronomy/github-actions-workflows
dependabot[bot] Jun 16, 2025
f13bf9f
Bump OpenAstronomy/github-actions-workflows from 1.17.0 to 2.0.0 in t…
nabobalis Jun 16, 2025
2be5f37
Bump OpenAstronomy/github-actions-workflows
dependabot[bot] Jun 30, 2025
7bda107
Bump OpenAstronomy/github-actions-workflows from 2.0.0 to 2.1.0 in th…
Cadair Jun 30, 2025
e5e5e02
[create-pull-request] automated change
Cadair Jul 1, 2025
d1437ea
PLC0415
Cadair Jul 7, 2025
88a0a31
pre-commit updates in the template (#206)
Cadair Jul 7, 2025
69ae2b1
[create-pull-request] automated change
Cadair Aug 1, 2025
28de72a
Update tox.ini
nabobalis Aug 1, 2025
07c9efb
Update tox.ini
nabobalis Aug 1, 2025
f8ad787
Update tox.ini
nabobalis Aug 1, 2025
d97a71e
Update tox.ini
nabobalis Aug 1, 2025
e1732ae
pre-commit updates in the template (#207)
nabobalis Aug 1, 2025
c8632ac
Bump OpenAstronomy/github-actions-workflows
dependabot[bot] Aug 4, 2025
1c727d0
Bump OpenAstronomy/github-actions-workflows from 2.1.0 to 2.2.1 in th…
nabobalis Aug 4, 2025
d2de57a
doc config update
nabobalis Aug 4, 2025
2d254ec
doc config update (#209)
nabobalis Aug 4, 2025
4672eef
Bump actions/checkout in the actions group across 1 directory
dependabot[bot] Aug 11, 2025
ad3ae37
Bump actions/checkout from 4.2.2 to 4.3.0 in the actions group across…
nabobalis Aug 11, 2025
21d5b01
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Aug 11, 2025
9d1c42c
[pre-commit.ci] pre-commit autoupdate (#211)
nabobalis Aug 11, 2025
d984a22
Merge branch 'OpenAstronomy/main' into main (with unresolved conflicts)
Cadair Aug 19, 2025
247d21b
Update tox.ini
Cadair Aug 19, 2025
fe68149
Update pyproject.toml
Cadair Aug 19, 2025
e682c2d
Updates from OpenAstronomy/packaging-guide (#212)
Cadair Aug 19, 2025
351c5e8
Bump actions/checkout in the actions group across 1 directory
dependabot[bot] Aug 25, 2025
82c75c6
Bump actions/checkout from 4.3.0 to 5.0.0 in the actions group across…
nabobalis Aug 26, 2025
e704335
[create-pull-request] automated change
Cadair Sep 1, 2025
24dadf0
pre-commit updates in the template (#215)
Cadair Sep 1, 2025
8937a62
Bump checkout action
Cadair Sep 2, 2025
1d40154
Bump checkout action in template update workflow (#216)
CyclingNinja Sep 2, 2025
8968ca6
Update python versioning
CyclingNinja Sep 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directories:
- "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
78 changes: 78 additions & 0 deletions .github/workflows/oa_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Automatic Update from OpenAstronomy/packging-guide
permissions:
contents: write
pull-requests: write

on:
# Allow manual runs through the web UI
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * 1' # Every Monday at 7am UTC

jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: true

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0

- name: Add OpenAstronomy/packaging-guide remote
run: |
git remote add openastronomy https://github.com/OpenAstronomy/packaging-guide.git
git remote update

- name: Check if there are new commits in OpenAstronomy/packaging-guide
continue-on-error: false
id: check
run: |
CHANGES=0
if [ "$(git rev-list HEAD..openastronomy/main --count)" -gt 0 ]; then
CHANGES=1
fi
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT"

- name: Merge in OpenAstronomy/packaging-guide
if: steps.check.outputs.has_changes == '1'
id: merge
continue-on-error: false
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"

git merge --no-edit --no-commit openastronomy/main || true
if [[ -n $(git ls-files --unmerged) ]]; then
CONFLICTS=1
# Commit the unresolved conflicts
git add .
git commit -m "Merge branch 'OpenAstronomy/main' into main (with unresolved conflicts)"
else
CONFLICTS=0
# No conflicts, commit the merge
git commit -m "Merge branch 'OpenAstronomy/main' into main"
fi
echo "has_conflicts=$CONFLICTS" >> "$GITHUB_OUTPUT"

- name: Create pull request
if: steps.check.outputs.has_changes == '1'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: ${{ steps.merge.outputs.has_conflicts == '1' }}
delete-branch: true
branch-suffix: timestamp
title: "Updates from OpenAstronomy/packaging-guide"
body: |
This is an autogenerated PR, which merges commits from OpenAstronomy/packaging-guide.

${{ steps.merge.outputs.has_conflicts == '1' && '**These changes have conflicts that need to be manually resolved.**' || '' }}

*Do not squash merge this PR! All commits from upstream should be present in the repos history.*
45 changes: 45 additions & 0 deletions .github/workflows/pre-commit-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update template pre-commit
permissions:
contents: write
pull-requests: write

on:
# Allow manual runs through the web UI
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 1 * *' # First day of the month at 7am UTC

jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: true

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0

- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit update
id: check
run: pre-commit autoupdate -c '{{ cookiecutter.package_name }}/.pre-commit-config.yaml'

- name: Create pull request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true
branch-suffix: timestamp
title: "pre-commit updates in the template"
body: |
This is an autogenerated PR, which updates the `{{ cookiecutter.package_name }}/.pre-commit-config.yaml` file.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@ concurrency:

jobs:
test:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@28e947497bed4d6ec3fa1d66d198e95a1d17bc63 # v2.2.1
with:
envs: |
- macos: py311-test
- linux: py312-test
- linux: py313-test
- linux: build_docs

bake_cookies:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@28e947497bed4d6ec3fa1d66d198e95a1d17bc63 # v2.2.1
with:
artifact-path: |
cookies
envs: |
- linux: bake_cookies
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,4 @@ dmypy.json
# Just in case you want to test out the defaults in the repo
packagename
None/
cookies
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ repos:
exclude: "{{ cookiecutter.package_name }}"
- id: debug-statements
exclude: "{{ cookiecutter.package_name }}"
ci:
autofix_prs: false
13 changes: 9 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
OpenAstronomy Packaging Guide
=============================
SunPy Package Template
======================

The `OpenAstronomy Python Packaging Guide <https://packaging-guide.openastronomy.org/en/latest/>`__ that contains an embedded `cookiecutter <https://cookiecutter.readthedocs.io/>`__ template.
Please see also the `instructions for using the template <https://packaging-guide.openastronomy.org/en/latest/#using-the-template>`__.
This repo extends the `OpenAstronomy Python Packaging Guide <https://packaging-guide.openastronomy.org/en/latest/>`__ to add SunPy specific features such as config files which are shared over all of SunPy's packages.

Previewing Rendered Templates
-----------------------------

To make it easier to preview changes to files when rendering the template there is a tox environment named ``bake_cookies``.
If you run ``tox -e bake_cookies`` a new directory named ``cookies`` will be present with a variety of test renders of the template in (see ``tests/conftest.py`` for the configuration options).
20 changes: 18 additions & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"author_name": "",
"author_email": "",
"project_url": "",
"github_repo": "",
"sourcecode_url": "{{ 'https://github.com/' + cookiecutter.github_repo if cookiecutter.github_repo else '' }}",
"download_url": "https://pypi.org/project/{{ cookiecutter.package_name }}",
"documentation_url": "",
"changelog_url": "",
"issue_tracker_url": "{{ 'https://github.com/' + cookiecutter.github_repo + '/issues/' if cookiecutter.github_repo else '' }}",
"license": [
"BSD 3-Clause",
"GNU GPL v3+",
Expand All @@ -22,12 +28,22 @@
"enable_dynamic_dev_versions": "n",
"include_example_code": "n",
"include_cruft_update_github_workflow": "n",
"_sphinx_theme": "alabaster",
"use_extended_ruff_linting": "n",
"_sphinx_theme": "sunpy",
"_parent_project": "",
"_install_requires": "",
"_copy_without_render": [
"docs/_templates",
"docs/_static",
".github/workflows/sub_package_update.yml"
]
],
"__prompts__" : {
"project_url": "Primary website for the project, leave blank for Sunpy Homepage",
"github_repo": "user/repo format GitHub repository. Leave blank if project is not on GitHub.",
"sourcecode_url": "URL for source code, i.e. https://github.com/...",
"download_url": "PyPI address for the project, optional",
"documentation_url": "Documentation URL, optional",
"changelog_url": "URL to the changelog, optional",
"issue_tracker_url": "URL to the issue tracker, optional"
}
}
13 changes: 4 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,15 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# Treat everything in single ` as a Python reference.
default_role = 'py:obj'

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

html_theme_options = {
"description": "A generic Python packaging guide and template.",
"code_font_family": "'Fira Code', monospace",
"github_user": "OpenAstronomy",
"github_repo": "packaging-guide",
"sidebar_width": "300px"
}
html_theme = 'sunpy'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
50 changes: 48 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To create a new package based on the template run:
.. code-block:: console

$ pip install cookiecutter cruft
$ cruft create https://github.com/OpenAstronomy/packaging-guide
$ cruft create https://github.com/sunpy/package-template

and go through the steps offered in the cli naming your package and filling in your details.
Cruft is built on cookiecutter, and enables the updating of the template from the source.
Expand All @@ -42,7 +42,7 @@ If you would like to stick to simply the cookiecutter approach, the template sti
.. code-block:: console

$ pip install cookiecutter
$ cookiecutter gh:OpenAstronomy/packaging-guide -o ./output_directory
$ cookiecutter gh:sunpy/package-template -o ./output_directory

This will create a new directory in your current directory named the same as the value of "packagename" you supplied.
Change into this directory and run ``git init`` to make it into a git repository, and make an initial commit.
Expand All @@ -54,3 +54,49 @@ The template currently implements the following optional flags, all of which def
* ``include_example_code``: This option will fill your new package with some example functions to allow you to test it.
* ``use_compiled_extensions``: This turns on the features needed to support compiled extensions as described in :ref:`extensions`.
* ``enable_dynamic_dev_versions``: This enables a feature which ensures that ``my_package.__version__`` always returns the current git version as calculated by ``setuptools_scm`` when the package is installed as an editable install. See :ref:`dev-versions` for more details.
* ``include_cruft_update_github_repo``: This option adds a github workflow with pulls in the latest changes from the template every Monday morning and creates a PR against the repo which can then be accepted or closed.
* ``use_extended_ruff_linting``: This option flag enables the stricter ruff rules. Recommend `Y` on creation of a new project.

Pre-commit
==========

Pre-commit is configured through ``.pre-commit-config.yaml`` and can be installed locally and ran:

.. code-block:: bash

$ pre-commit run --all-files

It also possible to use the tox environment to run it and and is integrated into the CI.

Within ``.pre-commit-config.yaml``, there are several tools and each one is configured either within the ``.pre-commit-config.yaml`` or for larger tools like ruff, it is has a dedicated config file ``.ruff.toml`` and we strongly recommend using the full set of rules when you setup your package.

Updating to a new version of the template
=========================================

It will be simplest to updating a package to a newer template by waiting for the GitHub workflow to trigger.
This will trigger a pull request one can review and merge via GitHub's UI.

If you do not want to wait, or want to do it manually, you will have to use cruft's CLI.
For this you will need to install cruft locally and then you can check the status of the package by running:

.. code-block:: console

$ cruft check

This will let you know whether the repository is up to date or not.
From there, you can run:

.. code-block:: console

$ cruft update

To update the repo and if there is a case conflicting files, ``.rej`` files will be created and you will have to manually deal with them and merge changes.

If you need up update one of the variables in the package ``.cruft.json`` for example, changing a ``n`` to a ``y`` this can be done using:

.. code-block:: console

$ cruft update --variables-to-update '{"use_extended_ruff_linting": "y"}'

This will work through the codebase and include the desired functionality without any further action.
Then you can commit and push the resulting changes.
6 changes: 4 additions & 2 deletions docs/rtd_environment.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: rtd311
name: rtd313
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- python=3.13
- pip
- graphviz
- pip:
- sunpy-sphinx-theme
2 changes: 1 addition & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def process_version(enable_dynamic_dev_versions):

def process_github_workflow(include_cruft_update_github_workflow):
if include_cruft_update_github_workflow != "y":
remove_dir(os.path.join(PROJECT_DIRECTORY, '.github'))
remove_file(os.path.join(PROJECT_DIRECTORY, '.github', 'workflows', 'sub_package_update.yml'))


if __name__ == '__main__':
Expand Down
Loading
Loading