From ecd5ce5482d4862734e6ac6b76dc102788270a64 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 10 Sep 2024 11:27:18 -0400 Subject: [PATCH 1/7] use `towncrier` to handle change log entries --- .readthedocs.yaml | 3 +++ CHANGES.rst | 5 ----- changes/.gitkeep | 0 docs/rtd_environment.yaml | 1 + docs/source/changes.rst | 5 +++++ docs/source/index.rst | 1 + pyproject.toml | 23 +++++++++++++++++++++++ 7 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 changes/.gitkeep create mode 100644 docs/source/changes.rst diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ed048507..7100ad8a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,6 +9,9 @@ build: os: "ubuntu-20.04" tools: python: "mambaforge-4.10" + jobs: + post_install: + - towncrier build --keep conda: environment: docs/rtd_environment.yaml diff --git a/CHANGES.rst b/CHANGES.rst index fedadb9e..c3509a11 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,8 +1,3 @@ -0.7.1 (unreleased) -================== - -- - 0.7.0 (2024-08-13) ================== diff --git a/changes/.gitkeep b/changes/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/rtd_environment.yaml b/docs/rtd_environment.yaml index 3e133fe5..abc299dc 100644 --- a/docs/rtd_environment.yaml +++ b/docs/rtd_environment.yaml @@ -6,3 +6,4 @@ dependencies: - python=3.11 - pip - graphviz + - towncrier diff --git a/docs/source/changes.rst b/docs/source/changes.rst new file mode 100644 index 00000000..e7747328 --- /dev/null +++ b/docs/source/changes.rst @@ -0,0 +1,5 @@ +*********** +Change Log +*********** + +.. include:: ../CHANGES.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index c4a6d24a..328cbe6e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,6 +6,7 @@ Welcome to stpipe's documentation! :caption: Contents: model_library.rst + changes.rst API === diff --git a/pyproject.toml b/pyproject.toml index 44ac4cab..6ead3020 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,3 +142,26 @@ force-exclude = "^/(\n (\n \\.eggs\n | \\.git\n | \\.pytest_cache\n [tool.codespell] skip = "*.pdf,*.fits,*.asdf,.tox,build,./tags,.git,docs/_build" + +[tool.towncrier] +filename = "CHANGES.rst" +directory = "changes" +package = "stpipe" +title_format = "{version} ({project_date})" +ignore = [".gitkeep"] +wrap = true +issue_format = "`#{issue} `_" + +[tool.towncrier.fragment.feature] +name = "New Features" + +[tool.towncrier.fragment.bugfix] +name = "Bug Fixes" + +[tool.towncrier.fragment.doc] +name = "Documentation" + +[tool.towncrier.fragment.removal] +name = "Deprecations and Removals" + +[tool.towncrier.fragment.misc] From d70e95f6ca8d4f616c8e1887ae7f8334e3ac33b4 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 10 Sep 2024 11:32:23 -0400 Subject: [PATCH 2/7] add pull request checklist --- .github/pull_request_template.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..44d665f4 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,29 @@ + +Resolves [JP-nnnn](https://jira.stsci.edu/browse/JP-nnnn) +Resolves [RCAL-nnnn](https://jira.stsci.edu/browse/RCAL-nnnn) + + +Closes # + + +This PR addresses ... + + +## Tasks +- [ ] Does this PR change user-facing code / API? (if not, label with `no-changelog-entry-needed`) + - [ ] write news fragment(s) in `changes/`: `echo "changed something" > changes/..rst` (see below for change types) + - [ ] update or add relevant tests + - [ ] update relevant docstrings and / or `docs/` page + - [ ] run regression tests with this branch installed (`"git+https://github.com//stpipe@"`) + - [ ] [`jwst` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/jwst.yml) + - [ ] [`romancal` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/romancal.yml) + +
news fragment change types... + +- ``changes/.feature.rst``: new feature +- ``changes/.bugfix.rst``: fixes an issue +- ``changes/.doc.rst``: documentation change +- ``changes/.removal.rst``: deprecation or removal of public API +- ``changes/.misc.rst``: infrastructure or miscellaneous change +
Date: Tue, 10 Sep 2024 11:33:41 -0400 Subject: [PATCH 3/7] add change log entry --- changes/187.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/187.doc.rst diff --git a/changes/187.doc.rst b/changes/187.doc.rst new file mode 100644 index 00000000..72481759 --- /dev/null +++ b/changes/187.doc.rst @@ -0,0 +1 @@ +use ``towncrier`` to handle change log entries From ee49b1113ef9b4a8db95f83a9de98442a575ed29 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 10 Sep 2024 11:34:26 -0400 Subject: [PATCH 4/7] check changelog with towncrier --- .github/workflows/changelog.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 5827b36c..cb5c44f4 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,8 +1,13 @@ -name: confirm changelog entry +name: changelog on: pull_request: - types: [labeled, unlabeled, opened, synchronize, reopened] + types: + - labeled + - unlabeled + - opened + - synchronize + - reopened concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -10,10 +15,16 @@ concurrency: jobs: check: + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }} runs-on: ubuntu-latest steps: - - uses: scientific-python/action-check-changelogfile@0.2 - env: - CHANGELOG_FILENAME: CHANGES.rst - CHECK_MILESTONE: false - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/setup-python@v5 + with: + python-version: 3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: pip install . + - run: pip install towncrier + - run: towncrier check + - run: towncrier build --draft | grep -P '#${{ github.event.number }}' From ba10cfcf190c095f5a4dbe8d7c6b54a415f5940c Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 10 Sep 2024 11:35:15 -0400 Subject: [PATCH 5/7] fix --- .github/pull_request_template.md | 2 +- docs/source/changes.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 44d665f4..84fc57f3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -26,4 +26,4 @@ This PR addresses ... - ``changes/.doc.rst``: documentation change - ``changes/.removal.rst``: deprecation or removal of public API - ``changes/.misc.rst``: infrastructure or miscellaneous change - diff --git a/docs/source/changes.rst b/docs/source/changes.rst index e7747328..bc36f5d0 100644 --- a/docs/source/changes.rst +++ b/docs/source/changes.rst @@ -2,4 +2,4 @@ Change Log *********** -.. include:: ../CHANGES.rst +.. include:: ../../CHANGES.rst From aee291e9dfe20c2611e825a12f6dec593189ad66 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Wed, 11 Sep 2024 08:50:51 -0400 Subject: [PATCH 6/7] reorder checkboxes to handle internal library changes --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 84fc57f3..befd830d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,10 +11,10 @@ This PR addresses ... ## Tasks -- [ ] Does this PR change user-facing code / API? (if not, label with `no-changelog-entry-needed`) +- [ ] update or add relevant tests +- [ ] update relevant docstrings and / or `docs/` page +- [ ] Does this PR change the public API? (if not, label with `no-changelog-entry-needed`) - [ ] write news fragment(s) in `changes/`: `echo "changed something" > changes/..rst` (see below for change types) - - [ ] update or add relevant tests - - [ ] update relevant docstrings and / or `docs/` page - [ ] run regression tests with this branch installed (`"git+https://github.com//stpipe@"`) - [ ] [`jwst` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/jwst.yml) - [ ] [`romancal` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/romancal.yml) From 284d055e270474d71f2b82a0a62193d9441a062c Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Wed, 11 Sep 2024 10:45:35 -0400 Subject: [PATCH 7/7] reword public API to downstream API --- .github/pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index befd830d..d62ed91a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -13,7 +13,7 @@ This PR addresses ... ## Tasks - [ ] update or add relevant tests - [ ] update relevant docstrings and / or `docs/` page -- [ ] Does this PR change the public API? (if not, label with `no-changelog-entry-needed`) +- [ ] Does this PR change any API used downstream? (if not, label with `no-changelog-entry-needed`) - [ ] write news fragment(s) in `changes/`: `echo "changed something" > changes/..rst` (see below for change types) - [ ] run regression tests with this branch installed (`"git+https://github.com//stpipe@"`) - [ ] [`jwst` regression test](https://github.com/spacetelescope/RegressionTests/actions/workflows/jwst.yml)