diff --git a/.cruft.json b/.cruft.json index d84a6a4..30c1e04 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "c359c134fbf9e3f11302c2019fb58ac11cf14cdf", + "commit": "164646d882aa2e972d305c54778aaaf35f707464", "checkout": null, "context": { "cookiecutter": { @@ -32,7 +32,7 @@ ".github/workflows/sub_package_update.yml" ], "_template": "https://github.com/sunpy/package-template", - "_commit": "c359c134fbf9e3f11302c2019fb58ac11cf14cdf" + "_commit": "164646d882aa2e972d305c54778aaaf35f707464" } }, "directory": null diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3720533..ecb8d7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: sdist_verify: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: python-version: '3.13' diff --git a/.github/workflows/sub_package_update.yml b/.github/workflows/sub_package_update.yml index 71bf5b9..171ce90 100644 --- a/.github/workflows/sub_package_update.yml +++ b/.github/workflows/sub_package_update.yml @@ -1,9 +1,6 @@ # 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 @@ -19,14 +16,17 @@ on: jobs: update: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write strategy: fail-fast: true steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: - python-version: "3.11" + python-version: "3.14" - name: Install Cruft run: python -m pip install git+https://github.com/Cadair/cruft@patch-p1 @@ -93,3 +93,70 @@ jobs: 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@v7 + 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) { + github.rest.issues.create({ + owner: variables.owner, + repo: variables.n ame, + body: issue_body, + title: variables.title, + labels: [variables.label], + }); + } else { + 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 9b74d68..ede3dc5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|drms/extern)$|^CITATION repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.14.3" + rev: "v0.14.10" hooks: - id: ruff args: ['--fix', '--unsafe-fixes'] diff --git a/docs/conf.py b/docs/conf.py index 91143ba..8bb126f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,8 @@ # extensions coming with Sphinx (named "sphinx.ext.*") or your custom # ones. extensions = [ - "hoverxref.extension", + # TODO: Re-enable this, it was failing the doc build + # "hoverxref.extension", "sphinx_copybutton", "sphinx_gallery.gen_gallery", "sphinx.ext.autodoc", diff --git a/pytest.ini b/pytest.ini index 33bfb0c..dac2b3b 100644 --- a/pytest.ini +++ b/pytest.ini @@ -49,3 +49,5 @@ filterwarnings = # https://github.com/pytest-dev/pytest-cov/issues/557 ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning ignore:.*is deprecated and slated for removal in Python 3:DeprecationWarning + # pyparsing 3.3 raises dep warnings with old mpl in oldestdeps + ignore::pyparsing.warnings.PyparsingDeprecationWarning