diff --git a/.cruft.json b/.cruft.json index 73199919..ab699e71 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "0c0f34c2ccd536ba8320fcda29c4d8e0f8f9adc5", + "commit": "35179454100c2f83118c49ac4a4a15e3c670365e", "checkout": null, "context": { "cookiecutter": { @@ -21,7 +21,7 @@ "use_compiled_extensions": "n", "enable_dynamic_dev_versions": "y", "include_example_code": "n", - "include_cruft_update_github_workflow": "y", + "include_cruft_update_github_workflow": "n", "use_extended_ruff_linting": "n", "matrix_room_id": "", "_sphinx_theme": "sunpy", @@ -33,7 +33,7 @@ ".github/workflows/sub_package_update.yml" ], "_template": "https://github.com/sunpy/package-template", - "_commit": "0c0f34c2ccd536ba8320fcda29c4d8e0f8f9adc5" + "_commit": "35179454100c2f83118c49ac4a4a15e3c670365e" } }, "directory": null diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 897730bc..644f95e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ permissions: {} jobs: core: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2 with: submodules: false coverage: codecov @@ -45,10 +45,10 @@ jobs: sdist_verify: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 # zizmor: ignore[unpinned-uses] + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: actions/setup-python@v6 # zizmor: ignore[unpinned-uses] + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.13' - run: python -m pip install -U --user build @@ -58,7 +58,7 @@ jobs: test: needs: [core, sdist_verify] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2 with: submodules: false coverage: codecov @@ -75,7 +75,7 @@ jobs: docs: needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v2 # zizmor: ignore[unpinned-uses] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2 with: default_python: '3.13' submodules: false @@ -110,7 +110,7 @@ jobs: contains(github.event.pull_request.labels.*.name, 'Run publish') ) needs: [test, docs] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v2 # zizmor: ignore[unpinned-uses] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1 # v3.0.2 with: python-version: '3.13' test_extras: 'all,tests' @@ -130,7 +130,7 @@ jobs: name: pypi steps: - name: Download artifacts - uses: actions/download-artifact@v8 # zizmor: ignore[unpinned-uses] + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: merge-multiple: true pattern: dist-* diff --git a/.github/workflows/label_sync.yml b/.github/workflows/label_sync.yml index 7f217758..cc1d5fbd 100644 --- a/.github/workflows/label_sync.yml +++ b/.github/workflows/label_sync.yml @@ -18,6 +18,6 @@ jobs: runs-on: ubuntu-latest name: Label Sync steps: - - uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd + - uses: srealmoreno/label-sync-action@850ba5cef2b25e56c6c420c4feed0319294682fd # v2.0.0 with: config-file: https://raw.githubusercontent.com/sunpy/.github/main/labels.yml diff --git a/.github/workflows/sub_package_update.yml b/.github/workflows/sub_package_update.yml deleted file mode 100644 index bfb213a8..00000000 --- a/.github/workflows/sub_package_update.yml +++ /dev/null @@ -1,164 +0,0 @@ -# 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 - -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 - -permissions: {} - -jobs: - update: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - 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.14" - - - name: Install Cruft - run: python -m pip install git+https://github.com/Cadair/cruft@patch-p1 - - - 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 - 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}" - - cruft_output=$(cruft update --skip-apply-ask --refresh-private-variables) - echo $cruft_output - git restore --staged . - - if [[ "$cruft_output" == *"Failed to cleanly apply the update, there may be merge conflicts."* ]]; then - echo merge_conflicts=1 >> $GITHUB_OUTPUT - else - echo merge_conflicts=0 >> $GITHUB_OUTPUT - fi - - - name: Check if only .cruft.json is modified - id: cruft_json - if: steps.check.outputs.has_changes == '1' - run: | - git status --porcelain=1 - if [[ "$(git status --porcelain=1)" == " M .cruft.json" ]]; then - echo "Only .cruft.json is modified. Exiting workflow early." - echo "has_changes=0" >> "$GITHUB_OUTPUT" - else - echo "has_changes=1" >> "$GITHUB_OUTPUT" - fi - - - name: Create pull request - if: steps.cruft_json.outputs.has_changes == '1' - uses: peter-evans/create-pull-request@v8 # zizmor: ignore[unpinned-uses] - with: - token: ${{ secrets.GITHUB_TOKEN }} - add-paths: "." - commit-message: "Automatic package template update" - branch: "cruft/update" - delete-branch: true - draft: ${{ steps.cruft_update.outputs.merge_conflicts == '1' }} - title: "Updates from the package template" - labels: | - No Changelog Entry Needed - body: | - This is an autogenerated PR, which will applies the latest changes from the [SunPy Package Template](https://github.com/sunpy/package-template). - If this pull request has been opened as a draft there are conflicts which need fixing. - - **To run the CI on this pull request you will need to close it and reopen it.** - - report-fail: - if: failure() - needs: [update] - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - name: Open an issue if workflow fails - uses: actions/github-script@v9 # zizmor: ignore[unpinned-uses] - with: - github-token: ${{ github.token }} - # This script is adapted from https://github.com/scientific-python/issue-from-pytest-log-action - # Under MIT license (c) Scientific Python Developers - script: | - const fs = require('fs'); - - // Edit these if needed for your repo - const variables = { - owner: context.repo.owner, - name: context.repo.repo, - label: "Infrastructure", - creator: "app/github-actions", - title: "SunPy Package Template auto-update failed." - }; - - const logs = 'The package update workflow failed.' - const workflow_url = `https://github.com/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; - const issue_body = `[Workflow Run URL](${workflow_url})\n${logs}`; - - const query_string = `repo:${variables.owner}/${variables.name} author:${variables.creator} label:${variables.label} is:open in:title ${variables.title}`; - - // Run GraphQL query against GitHub API to find the most recent open issue used for reporting failures - const query = `query { - search(query: "${query_string}", type:ISSUE, first: 1) { - edges { - node { - ... on Issue { - body - id - number - } - } - } - } - }`; - - const result = await github.graphql(query); - - // If no issue is open, create a new issue, - // else update the body of the existing issue. - if (result.search.edges.length === 0) { - await github.rest.issues.create({ - owner: variables.owner, - repo: variables.name, - body: issue_body, - title: variables.title, - labels: [variables.label, "pre-commit.ci autofix"], - }); - } else { - await github.rest.issues.update({ - owner: variables.owner, - repo: variables.name, - issue_number: result.search.edges[0].node.number, - body: issue_body - }); - } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ddcbd646..45155589 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.25.2 + rev: v1.28.0 hooks: - id: zizmor # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.15.15" + rev: "v0.16.1" hooks: - id: ruff args: ["--fix"] @@ -45,7 +45,7 @@ repos: - id: mixed-line-ending types_or: [python, rst] - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell args: [ "--write-changes" ] diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4ea33746..4bb8346d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-lts-latest tools: - python: "mambaforge-latest" + python: "miniforge3-latest" jobs: post_checkout: - git fetch --unshallow || true diff --git a/tox.ini b/tox.ini index 500b941a..b91f2c26 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,7 @@ pass_env = # If the user has set a LC override we should follow it LC_ALL set_env = + COVERAGE_FILE={toxinidir}/.coverage MPLBACKEND = agg COLUMNS = 180 build_docs,online: HOME = {envtmpdir}