From 653d2c1267f5ceeb1eb61432fd4078f2edef8d7b Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 6 Dec 2024 13:31:21 +0000 Subject: [PATCH 1/4] Update cruft with batchpr --- .cruft.json | 8 ++++- .github/workflows/ci.yml | 12 +++---- .pre-commit-config.yaml | 2 +- .ruff.toml | 1 - CHANGELOG.rst | 0 changelog/README.rst | 34 ++++++++++++++++++ docs/conf.py | 4 +++ docs/index.rst | 8 +++++ docs/whatsnew/changelog.rst | 10 ++++++ docs/whatsnew/index.rst | 12 +++++++ pyproject.toml | 72 +++++++++++++++++++++++++++++++++++++ 11 files changed, 154 insertions(+), 9 deletions(-) create mode 100644 CHANGELOG.rst create mode 100644 changelog/README.rst create mode 100644 docs/whatsnew/changelog.rst create mode 100644 docs/whatsnew/index.rst diff --git a/.cruft.json b/.cruft.json index 90956ce..f7764c9 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sunpy/package-template", - "commit": "cd21e0d710513a891ed03f29e8afd6e0b9217f04", + "commit": "3737aa309d2a695ada046c7868c5683213003f3d", "checkout": null, "context": { "cookiecutter": { @@ -10,6 +10,12 @@ "author_name": "The SunPy Community", "author_email": "sunpy@googlegroups.com", "project_url": "https://sunpy.org", + "github_repo": "", + "sourcecode_url": "", + "download_url": "https://pypi.org/project/sunkit-magex", + "documentation_url": "", + "changelog_url": "", + "issue_tracker_url": "", "license": "GNU GPL v3+", "minimum_python_version": "3.10", "use_compiled_extensions": "n", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 089d5de..8aea841 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ - +# Main CI Workflow name: CI on: @@ -22,7 +22,7 @@ concurrency: jobs: core: - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: submodules: false coverage: codecov @@ -47,7 +47,7 @@ jobs: test: needs: [core, sdist_verify] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: submodules: false coverage: codecov @@ -62,7 +62,7 @@ jobs: docs: needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: default_python: '3.12' submodules: false @@ -80,7 +80,7 @@ jobs: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Run cron CI') ) - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 with: default_python: '3.12' submodules: false @@ -101,7 +101,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@main + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 with: python-version: '3.12' test_extras: 'tests' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a8919f..979d8ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: # This should be before any formatting hooks like isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.7.4" + rev: "v0.8.1" hooks: - id: ruff args: ["--fix"] diff --git a/.ruff.toml b/.ruff.toml index 0112266..c84d0ae 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -23,7 +23,6 @@ extend-ignore = [ "UP038", # Use | in isinstance - not compatible with models and is slower # pytest (PT) "PT001", # Always use pytest.fixture() - "PT004", # Fixtures which don't return anything should have leading _ "PT023", # Always use () on pytest decorators # flake8-pie (PIE) "PIE808", # Disallow passing 0 as the first argument to range diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..e69de29 diff --git a/changelog/README.rst b/changelog/README.rst new file mode 100644 index 0000000..7d388e3 --- /dev/null +++ b/changelog/README.rst @@ -0,0 +1,34 @@ +========= +Changelog +========= + +.. note:: + + This README was adapted from the pytest changelog readme under the terms of the MIT licence. + +This directory contains "news fragments" which are short files that contain a small **ReST**-formatted text that will be added to the next ``CHANGELOG``. + +The ``CHANGELOG`` will be read by users, so this description should be aimed at SunPy users instead of describing internal changes which are only relevant to the developers. + +Make sure to use full sentences with correct case and punctuation, for example:: + + Add support for Helioprojective coordinates in `sunpy.coordinates.frames`. + +Please try to use Sphinx intersphinx using backticks. + +Each file should be named like ``.[.].rst``, where ```` is a pull request number, ``COUNTER`` is an optional number if a PR needs multiple entries with the same type and ```` is one of: + +* ``breaking``: A change which requires users to change code and is not backwards compatible. (Not to be used for removal of deprecated features.) +* ``feature``: New user facing features and any new behavior. +* ``bugfix``: Fixes a reported bug. +* ``doc``: Documentation addition or improvement, like rewording an entire session or adding missing docs. +* ``deprecation``: Feature deprecation +* ``removal``: Feature removal. +* ``trivial``: A change which has no user facing effect or is tiny change. + +So for example: ``123.feature.rst``, ``456.bugfix.rst``. + +If you are unsure what pull request type to use, don't hesitate to ask in your PR. + +Note that the ``towncrier`` tool will automatically reflow your text, so it will work best if you stick to a single paragraph, but multiple sentences and links are OK and encouraged. +You can install ``towncrier`` and then run ``towncrier --draft`` if you want to get a preview of how your change will look in the final release notes. diff --git a/docs/conf.py b/docs/conf.py index 87c2bd4..0c076bd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,11 @@ "sphinx.ext.mathjax", "sphinx_automodapi.automodapi", "sphinx_automodapi.smart_resolver", +<<<<<<< 'sphinx_gallery.gen_gallery', +======= + "sphinx_changelog", +>>>>>>> ] # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 577afb9..573af54 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,14 @@ This is the documentation for sunkit-magex. :maxdepth: 2 :caption: Contents: +<<<<<<< +======= + whatsnew/index + +Indices and tables +================== + +>>>>>>> installing heritage generated/gallery/index diff --git a/docs/whatsnew/changelog.rst b/docs/whatsnew/changelog.rst new file mode 100644 index 0000000..a3678c4 --- /dev/null +++ b/docs/whatsnew/changelog.rst @@ -0,0 +1,10 @@ +.. _changelog: + +************** +Full Changelog +************** + +.. changelog:: + :towncrier: ../../ + :towncrier-skip-if-empty: + :changelog_file: ../../CHANGELOG.rst diff --git a/docs/whatsnew/index.rst b/docs/whatsnew/index.rst new file mode 100644 index 0000000..bd08a51 --- /dev/null +++ b/docs/whatsnew/index.rst @@ -0,0 +1,12 @@ +.. _whatsnew: + +*************** +Release History +*************** + +This page documents the releases for sunkit-magex + +.. toctree:: + :maxdepth: 1 + + changelog diff --git a/pyproject.toml b/pyproject.toml index c669772..81c79a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,8 +40,20 @@ tests = [ docs = [ "sphinx", "sphinx-automodapi", + "sphinx-changelog", "sunpy-sphinx-theme", "packaging", +<<<<<<< +======= +] + +[project.urls] +Homepage = "https://sunpy.org" +Download = "https://pypi.org/project/sunkit-magex" + +[tool.setuptools] +zip-safe = false +>>>>>>> "pillow", "reproject", "sphinx-gallery", @@ -77,3 +89,63 @@ exclude = ["sunkit_magex._dev*"] [tool.setuptools_scm] write_to = "sunkit_magex/_version.py" + +[tool.gilesbot] + [tool.gilesbot.pull_requests] + enabled = true + + [tool.gilesbot.towncrier_changelog] + enabled = true + verify_pr_number = true + changelog_skip_label = "No Changelog Entry Needed" + help_url = "https://github.com//blob/main/changelog/README.rst" + + changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com//blob/main/changelog/README.rst)." + + type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com//blob/main/changelog/README.rst)" + + number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." + +# TODO: This should be in towncrier.toml but Giles currently only works looks in +# pyproject.toml we should move this back when it's fixed. +[tool.towncrier] + package = "sunkit-magex" + filename = "CHANGELOG.rst" + directory = "changelog/" + issue_format = "`#{issue} https:github.com//changelog/pull/{issue}>`__" + title_format = "{version} ({project_date})" + + [[tool.towncrier.type]] + directory = "breaking" + name = "Breaking Changes" + showcontent = true + + [[tool.towncrier.type]] + directory = "deprecation" + name = "Deprecations" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "Removals" + showcontent = true + + [[tool.towncrier.type]] + directory = "feature" + name = "New Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bug Fixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "trivial" + name = "Internal Changes" + showcontent = true From 16c97a6f5d0a626ca25809eb080254fe7f08c96d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:19:57 -0800 Subject: [PATCH 2/4] Update conf.py --- docs/conf.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 0c076bd..30a3942 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,11 +46,8 @@ "sphinx.ext.mathjax", "sphinx_automodapi.automodapi", "sphinx_automodapi.smart_resolver", -<<<<<<< - 'sphinx_gallery.gen_gallery', -======= + "sphinx_gallery.gen_gallery", "sphinx_changelog", ->>>>>>> ] # Add any paths that contain templates here, relative to this directory. From 8eda8ac54da81868f78879bbbbc624100595c6e2 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:20:10 -0800 Subject: [PATCH 3/4] Update index.rst --- docs/index.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 573af54..50aafa4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,14 +8,6 @@ This is the documentation for sunkit-magex. :maxdepth: 2 :caption: Contents: -<<<<<<< -======= - whatsnew/index - -Indices and tables -================== - ->>>>>>> installing heritage generated/gallery/index @@ -23,4 +15,4 @@ Indices and tables performance numerical_methods_pfss/index.rst synoptic_fits - changelog + whatsnew/index From 092edfd170dfeb1b44d3e3c2486b7a6b83e8b977 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:21:34 -0800 Subject: [PATCH 4/4] Update pyproject.toml --- pyproject.toml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 81c79a6..8348297 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,17 +43,6 @@ docs = [ "sphinx-changelog", "sunpy-sphinx-theme", "packaging", -<<<<<<< -======= -] - -[project.urls] -Homepage = "https://sunpy.org" -Download = "https://pypi.org/project/sunkit-magex" - -[tool.setuptools] -zip-safe = false ->>>>>>> "pillow", "reproject", "sphinx-gallery", @@ -98,12 +87,9 @@ write_to = "sunkit_magex/_version.py" enabled = true verify_pr_number = true changelog_skip_label = "No Changelog Entry Needed" - help_url = "https://github.com//blob/main/changelog/README.rst" - + help_url = "https://github.com/sunpy/sunkit-magex/blob/main/changelog/README.rst" changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com//blob/main/changelog/README.rst)." - type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com//blob/main/changelog/README.rst)" - number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file." # TODO: This should be in towncrier.toml but Giles currently only works looks in @@ -112,7 +98,7 @@ write_to = "sunkit_magex/_version.py" package = "sunkit-magex" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} https:github.com//changelog/pull/{issue}>`__" + issue_format = "`#{issue} https://github.com/sunpy/sunkit-magex/pull/{issue}>`__" title_format = "{version} ({project_date})" [[tool.towncrier.type]]