Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sunpy/package-template",
"commit": "4268346dead7b529a3d53df19bcf374bb2bbef34",
"commit": "9599f755e4f7880fe20f0f07bbf500d8c41de34d",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -23,6 +23,7 @@
"include_example_code": "n",
"include_cruft_update_github_workflow": "y",
"use_extended_ruff_linting": "y",
"matrix_room_id": "!jfEXWJFdXwYnBWsiqk:openastronomy.org",
"_sphinx_theme": "sunpy",
"_parent_project": "",
"_install_requires": "",
Expand All @@ -32,7 +33,7 @@
".github/workflows/sub_package_update.yml"
],
"_template": "https://github.com/sunpy/package-template",
"_commit": "4268346dead7b529a3d53df19bcf374bb2bbef34"
"_commit": "9599f755e4f7880fe20f0f07bbf500d8c41de34d"
}
},
"directory": null
Expand Down
17 changes: 8 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "Cargo"
interval: "monthly"
cooldown:
default-days: 7
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"
groups:
rust: # group all rust deps into a single PR
patterns:
- "*"
cooldown:
default-days: 7
70 changes: 50 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: hecrj/setup-rust-action@v2
- uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses]
with:
persist-credentials: false
- uses: hecrj/setup-rust-action@v2 # zizmor: ignore[unpinned-uses]
- run: cargo test

core:
needs: [rust]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
with:
submodules: false
coverage: codecov
Expand All @@ -50,8 +54,10 @@ jobs:
sdist_verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses]
with:
persist-credentials: false
- uses: actions/setup-python@v6 # zizmor: ignore[unpinned-uses]
with:
python-version: '3.13'
- run: python -m pip install -U --user build
Expand All @@ -60,8 +66,8 @@ jobs:
- run: python -m twine check dist/*

test:
needs: [core, sdist_verify, rust]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
needs: [core, sdist_verify]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
with:
submodules: false
coverage: codecov
Expand All @@ -79,7 +85,7 @@ jobs:

docs:
needs: [core]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses]
with:
default_python: '3.13'
submodules: false
Expand All @@ -91,7 +97,7 @@ jobs:
envs: |
- linux: build_docs

publish:
build_dists:
# Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.*
# see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi
if: |
Expand All @@ -101,12 +107,11 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'Run publish')
)
needs: [test, docs]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v2
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v2 # zizmor: ignore[unpinned-uses]
with:
sdist: true
test_extras: 'tests'
test_command: 'pytest -p no:warnings --doctest-rst --pyargs streamtracer'
submodules: false
targets: |
- cp3{12,13,14}-manylinux_x86_64
- cp3{12,13,14}-musllinux_x86_64
Expand All @@ -115,20 +120,45 @@ jobs:
- cp3{12,13,14}-win_amd64
- target: cp3{12,13,14}-manylinux_aarch64
runs-on: ubuntu-24.04-arm
secrets:
pypi_token: ${{ secrets.pypi_token }}
submodules: false
save_artifacts: true
upload_to_pypi: false

publish:
if: startsWith(github.ref, 'refs/tags/v')
name: Upload to PyPI
runs-on: ubuntu-latest
needs: [build_dists]
permissions:
id-token: write
environment:
name: pypi
steps:
- name: Download artifacts
uses: actions/download-artifact@v8 # zizmor: ignore[unpinned-uses]
with:
merge-multiple: true
pattern: dist-*
path: dist

- run: ls -lha dist/

- name: Run upload
uses: pypa/gh-action-pypi-publish@v1.13.0 # zizmor: ignore[unpinned-uses]

notify:
if: always() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
needs: [publish]
if: ${{ !cancelled() && (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') }}
needs: [build_dists]
runs-on: ubuntu-latest
environment:
name: matrix
steps:
- uses: Cadair/matrix-notify-action@main
- uses: Cadair/matrix-notify-action@main # zizmor: ignore[unpinned-uses]
with:
matrix_token: ${{ secrets.matrix_access_token }}
workflow_description: "CI Workflow in sunpy/streamtracer"
matrix_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
homeserver: ${{ secrets.matrix_homeserver }}
homeserver: ${{ secrets.MATRIX_HOMESERVER }}
roomid: '!jfEXWJFdXwYnBWsiqk:openastronomy.org'
ignore_pattern: '.*Load.*'
ignore_pattern: '.*(Load|report overall).*'
summarise_success: true
workflow_description: 'in sunpy/streamtracer'
12 changes: 7 additions & 5 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1
- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
20 changes: 11 additions & 9 deletions .github/workflows/sub_package_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ on:
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * 1' # Every Monday at 7am UTC

permissions: {}

jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses]
with:
persist-credentials: false

- uses: actions/setup-python@v6
- uses: actions/setup-python@v6 # zizmor: ignore[unpinned-uses]
with:
python-version: "3.14"

Expand All @@ -50,8 +52,8 @@ jobs:
id: cruft_update
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 }}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"

cruft_output=$(cruft update --skip-apply-ask --refresh-private-variables)
echo $cruft_output
Expand All @@ -77,7 +79,7 @@ jobs:

- name: Create pull request
if: steps.cruft_json.outputs.has_changes == '1'
uses: peter-evans/create-pull-request@v8
uses: peter-evans/create-pull-request@v8 # zizmor: ignore[unpinned-uses]
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: "."
Expand All @@ -102,7 +104,7 @@ jobs:
issues: write
steps:
- name: Open an issue if workflow fails
uses: actions/github-script@v7
uses: actions/github-script@v8 # zizmor: ignore[unpinned-uses]
with:
github-token: ${{ github.token }}
# This script is adapted from https://github.com/scientific-python/issue-from-pytest-log-action
Expand Down Expand Up @@ -150,7 +152,7 @@ jobs:
repo: variables.name,
body: issue_body,
title: variables.title,
labels: [variables.label],
labels: [variables.label, "pre-commit.ci autofix"],
});
} else {
await github.rest.issues.update({
Expand Down
36 changes: 32 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,82 @@
repos:
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.23.1
hooks:
- id: zizmor
# This should be before any formatting hooks like isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.4"
hooks:
- id: ruff
args: ["--fix"]
types: [python]
# Define here once and then reference using YAML anchor
exclude: &exclude_dirs ^streamtracer/(data|extern)/
- repo: https://github.com/PyCQA/isort
rev: 8.0.1
hooks:
- id: isort
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|streamtracer/extern)$"
types: [python]
exclude: *exclude_dirs
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast
types: [python]
exclude: *exclude_dirs
- id: check-case-conflict
types: [python]
exclude: *exclude_dirs
- id: trailing-whitespace
exclude: ".*(.fits|.fts|.fit|.header|.txt)$"
types_or: [python, rst, rust]
- id: check-yaml
types: [yaml]
exclude: *exclude_dirs
- id: check-toml
types: [toml]
exclude: *exclude_dirs
- id: debug-statements
types: [python, rust]
exclude: *exclude_dirs
- id: check-added-large-files
args: ["--enforce-all", "--maxkb=1054"]
- id: end-of-file-fixer
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|.json)$|^CITATION.rst$"
types_or: [python, rst, rust]
- id: mixed-line-ending
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*)$"
types_or: [python, rst, rust]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args: [ "--write-changes" ]
types_or: [python, rst, rust]
exclude: *exclude_dirs
# Run mypy type validation
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
hooks:
- id: mypy
types: [python]
exclude: *exclude_dirs
additional_dependencies: [types-setuptools]
# Python code formatting
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
types: [python]
exclude: *exclude_dirs
# Rust code formatting
- repo: https://github.com/FeryET/pre-commit-rust
rev: v1.1.0
hooks:
- id: cargo-check
types: [rust]
- id: clippy
args: ["--allow-staged", "--fix", "--", "-A", "clippy::needless_return", "-W", "clippy::implicit_return"]
types: [rust]
- id: fmt
types: [rust]
ci:
autofix_prs: false
autoupdate_schedule: "quarterly"
Loading
Loading