From 8e725f8a1aed892827b21ab6c439260f2732f14e Mon Sep 17 00:00:00 2001 From: Stuart Mumford Date: Fri, 6 Dec 2024 13:31:41 +0000 Subject: [PATCH 1/5] Update cruft with batchpr --- .cruft.json | 8 +++- .github/workflows/ci.yml | 35 +++++++++++++++++- .pre-commit-config.yaml | 2 +- .ruff.toml | 1 - CHANGELOG.rst | 0 changelog/README.rst | 34 +++++++++++++++++ docs/conf.py | 4 ++ docs/index.rst | 7 ++++ docs/whatsnew/changelog.rst | 10 +++++ docs/whatsnew/index.rst | 12 ++++++ pyproject.toml | 73 +++++++++++++++++++++++++++++++++++++ 11 files changed, 182 insertions(+), 4 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 7ace490..d0093aa 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 Developers", "author_email": "sunpy@googlegroups.com", "project_url": "https://docs.sunpy.org/projects/mpl-animators", + "github_repo": "", + "sourcecode_url": "", + "download_url": "https://pypi.org/project/mpl_animators", + "documentation_url": "", + "changelog_url": "", + "issue_tracker_url": "", "license": "BSD 3-Clause", "minimum_python_version": "3.10", "use_compiled_extensions": "n", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74058fd..7fdb4e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +<<<<<<< +======= +# Main CI Workflow +>>>>>>> name: CI on: @@ -21,7 +25,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 @@ -44,9 +48,15 @@ jobs: - run: python -m pip install -U --user twine - run: python -m twine check dist/* +<<<<<<< docs: needs: [core] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main +======= + test: + needs: [core, sdist_verify] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 +>>>>>>> with: default_python: '3.12' submodules: false @@ -58,6 +68,15 @@ jobs: envs: | - linux: build_docs +<<<<<<< +======= + docs: + needs: [core] + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + default_python: '3.12' + submodules: false +>>>>>>> publish: # 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 @@ -67,8 +86,22 @@ jobs: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Run publish') ) +<<<<<<< +======= + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + default_python: '3.12' + submodules: false +>>>>>>> needs: [sdist_verify, docs] +<<<<<<< uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main +======= + contains(github.event.pull_request.labels.*.name, 'Run publish') + ) + needs: [test, docs] + 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 f3f4079..b759f67 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: ".*(.csv|.fits|.fts|.fit|.header|.txt|tca.*|.json|.asdf)$|^CITATION.rst 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 4aa06e5..0f6b1fc 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -22,7 +22,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 42adb3a..cd18fa0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,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 7f7bd24..ff6e16a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,14 @@ The ``mpl_animators`` package provides a set of classes which allow the easy con "Out of the box" classes are provided for making line or image plots from numpy arrays, with sliders to control the animation automatically added for all dimensions not on the axes of the plot. +<<<<<<< As well as this there is a specialized `.ArrayAnimatorWCS` class which can make line or image plots for a numpy array and associated World Coordinate System (WCS) object from `astropy`. +======= + whatsnew/index + +Indices and tables +================== +>>>>>>> Finally, there are two base classes: `.BaseFuncAnimator` which can be extended to generate an interactive visualization from any data structure and set of functions to update the plot, and `.ArrayAnimator` which can be extended to generate any visualization based on the axes of a numpy array. 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..a2ae0db --- /dev/null +++ b/docs/whatsnew/index.rst @@ -0,0 +1,12 @@ +.. _whatsnew: + +*************** +Release History +*************** + +This page documents the releases for mpl_animators + +.. toctree:: + :maxdepth: 1 + + changelog diff --git a/pyproject.toml b/pyproject.toml index d7b2d1d..a7fc1aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,12 +33,20 @@ tests = [ docs = [ "sphinx", "sphinx-automodapi", + "sphinx-changelog", "sunpy-sphinx-theme", "packaging", "sphinx_gallery", "sunpy", "scipy", ] +<<<<<<< +======= + +[project.urls] +Homepage = "https://docs.sunpy.org/projects/mpl-animators" +Download = "https://pypi.org/project/mpl_animators" +>>>>>>> [project.urls] Homepage = "https://sunpy.org" @@ -73,7 +81,72 @@ write_to = "mpl_animators/_version.py" message = "Click details to see the figure test comparisons for py310-figure-oldestdeps." report_on_fail = true +<<<<<<< [ tool.gilesbot.circleci_artifacts.py312-figure-devdeps_report ] url = ".tmp/py311-figure-devdeps/figure_test_images/fig_comparison.html" message = "Click details to see the figure test comparisons for py312-figure-devdeps." report_on_fail = true +======= +[tool.setuptools_scm] +write_to = "mpl_animators/_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 = "mpl_animators" + 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 133f40357800ee1ae4af3303a3f8f9547d758b61 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:54:47 -0800 Subject: [PATCH 2/5] 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 cd18fa0..bbb801d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,11 +47,8 @@ "sphinx.ext.mathjax", "sphinx_automodapi.automodapi", "sphinx_automodapi.smart_resolver", -<<<<<<< - "sphinx_gallery.gen_gallery", -======= "sphinx_changelog", ->>>>>>> + "sphinx_gallery.gen_gallery", ] # Add any paths that contain templates here, relative to this directory. From e560f3577f766d5e13e12c0b971af6519221ba3e Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:55:03 -0800 Subject: [PATCH 3/5] Update index.rst --- docs/index.rst | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index ff6e16a..de2a399 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,14 +6,7 @@ The ``mpl_animators`` package provides a set of classes which allow the easy con "Out of the box" classes are provided for making line or image plots from numpy arrays, with sliders to control the animation automatically added for all dimensions not on the axes of the plot. -<<<<<<< As well as this there is a specialized `.ArrayAnimatorWCS` class which can make line or image plots for a numpy array and associated World Coordinate System (WCS) object from `astropy`. -======= - whatsnew/index - -Indices and tables -================== ->>>>>>> Finally, there are two base classes: `.BaseFuncAnimator` which can be extended to generate an interactive visualization from any data structure and set of functions to update the plot, and `.ArrayAnimator` which can be extended to generate any visualization based on the axes of a numpy array. @@ -22,3 +15,4 @@ Finally, there are two base classes: `.BaseFuncAnimator` which can be extended t generated/gallery/index api + whatsnew/index From 8c4732dfca81b04f32650beb810a401c15f84b45 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:56:25 -0800 Subject: [PATCH 4/5] Update pyproject.toml --- pyproject.toml | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a7fc1aa..846f8c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,17 +40,10 @@ docs = [ "sunpy", "scipy", ] -<<<<<<< -======= [project.urls] Homepage = "https://docs.sunpy.org/projects/mpl-animators" Download = "https://pypi.org/project/mpl_animators" ->>>>>>> - -[project.urls] -Homepage = "https://sunpy.org" -Download = "https://pypi.org/project/mpl-animators/" "Source Code" = "https://github.com/sunpy/mpl-animators/" Documentation = "https://docs.sunpy.org/projects/mpl-animators" Changelog = "https://github.com/sunpy/mpl-animators/releases" @@ -67,7 +60,10 @@ exclude = ["mpl_animators._dev*"] [tool.setuptools_scm] write_to = "mpl_animators/_version.py" -[ tool.gilesbot ] +[tool.gilesbot] + [tool.gilesbot.pull_requests] + enabled = true + [ tool.gilesbot.circleci_artifacts ] enabled = true @@ -81,29 +77,18 @@ write_to = "mpl_animators/_version.py" message = "Click details to see the figure test comparisons for py310-figure-oldestdeps." report_on_fail = true -<<<<<<< [ tool.gilesbot.circleci_artifacts.py312-figure-devdeps_report ] url = ".tmp/py311-figure-devdeps/figure_test_images/fig_comparison.html" message = "Click details to see the figure test comparisons for py312-figure-devdeps." report_on_fail = true -======= -[tool.setuptools_scm] -write_to = "mpl_animators/_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" - + help_url = "https://github.com/sunpy/mpl-animators/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 +97,7 @@ write_to = "mpl_animators/_version.py" package = "mpl_animators" filename = "CHANGELOG.rst" directory = "changelog/" - issue_format = "`#{issue} https:github.com//changelog/pull/{issue}>`__" + issue_format = "`#{issue} https:github.com/mpl-animators/pull/{issue}>`__" title_format = "{version} ({project_date})" [[tool.towncrier.type]] @@ -149,4 +134,3 @@ write_to = "mpl_animators/_version.py" directory = "trivial" name = "Internal Changes" showcontent = true ->>>>>>> From ed71462c4a83dc0cf2e7b3eacde255eaf64559ed Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 6 Dec 2024 20:58:02 -0800 Subject: [PATCH 5/5] Update ci.yml --- .github/workflows/ci.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fdb4e5..ac721ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,4 @@ -<<<<<<< -======= # Main CI Workflow ->>>>>>> name: CI on: @@ -48,15 +45,9 @@ jobs: - run: python -m pip install -U --user twine - run: python -m twine check dist/* -<<<<<<< docs: - needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main -======= - test: needs: [core, sdist_verify] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 ->>>>>>> with: default_python: '3.12' submodules: false @@ -68,15 +59,6 @@ jobs: envs: | - linux: build_docs -<<<<<<< -======= - docs: - needs: [core] - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - with: - default_python: '3.12' - submodules: false ->>>>>>> publish: # 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 @@ -86,22 +68,8 @@ jobs: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Run publish') ) -<<<<<<< -======= - uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 - with: - default_python: '3.12' - submodules: false ->>>>>>> needs: [sdist_verify, docs] -<<<<<<< - uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main -======= - contains(github.event.pull_request.labels.*.name, 'Run publish') - ) - needs: [test, docs] uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1 ->>>>>>> with: python-version: '3.12' test_extras: 'tests'