diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..d62ed91a --- /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 +- [ ] update or add relevant tests +- [ ] update relevant docstrings and / or `docs/` page +- [ ] 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) + - [ ] [`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 +
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 }}' 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/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 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..bc36f5d0 --- /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]