forked from sunpy/sunpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates Sunpy core with package template
- Loading branch information
1 parent
7d3cc09
commit 116d0f3
Showing
17 changed files
with
261 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
[run] | ||
omit = | ||
sunpy/cython_version* | ||
sunpy/conftest.py | ||
sunpy/*setup_package* | ||
sunpy/extern/* | ||
sunpy/version* | ||
sunpy/data/sample.py | ||
sunpy/data/_sample.py | ||
sunpy/data/test/_generate_asdf_test.py | ||
*/sunpy/cython_version* | ||
*/sunpy/conftest.py | ||
*/sunpy/*setup_package* | ||
*/sunpy/extern/* | ||
*/sunpy/version* | ||
*/sunpy/data/sample.py | ||
*/sunpy/data/_sample.py | ||
|
||
[report] | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
# Don't complain about packages we have installed | ||
except ImportError | ||
# Don't complain if tests don't hit assertions | ||
raise AssertionError | ||
raise NotImplementedError | ||
# Don't complain about script hooks | ||
def main(.*): | ||
# Ignore branches that don't pertain to this version of Python | ||
pragma: py{ignore_python_version} | ||
# Don't complain about IPython completion helper | ||
def _ipython_key_completions_ | ||
# typing.TYPE_CHECKING is False at runtime | ||
if TYPE_CHECKING: | ||
# Ignore typing overloads | ||
@overload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# This template is taken from the cruft example code, for further information please see: | ||
# https://cruft.github.io/cruft/#automating-updates-with-github-actions | ||
name: Automatic Update from package template | ||
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 | ||
matrix: | ||
include: | ||
- add-paths: . | ||
body: apply the changes to this repo. | ||
branch: cruft/update | ||
commit-message: "Automatic package template update" | ||
title: Updates from the package template | ||
- add-paths: .cruft.json | ||
body: reject these changes for this repo. | ||
branch: cruft/reject | ||
commit-message: "Reject this package template update" | ||
title: Reject new updates from package template | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Cruft | ||
run: python -m pip install cruft | ||
|
||
- name: Check if update is available | ||
continue-on-error: false | ||
id: check | ||
run: | | ||
CHANGES=0 | ||
if [ -f .cruft.json ]; then | ||
if ! cruft check; then | ||
CHANGES=1 | ||
fi | ||
else | ||
echo "No .cruft.json file" | ||
fi | ||
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT" | ||
- name: Run update if available | ||
if: steps.check.outputs.has_changes == '1' | ||
run: | | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
git config --global user.name "${{ github.actor }}" | ||
cruft update --skip-apply-ask --refresh-private-variables | ||
git restore --staged . | ||
- name: Create pull request | ||
if: steps.check.outputs.has_changes == '1' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
add-paths: ${{ matrix.add-paths }} | ||
commit-message: ${{ matrix.commit-message }} | ||
branch: ${{ matrix.branch }} | ||
delete-branch: true | ||
branch-suffix: timestamp | ||
title: ${{ matrix.title }} | ||
body: | | ||
This is an autogenerated PR, which will ${{ matrix.body }}. | ||
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Package Template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.