Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use towncrier to handle changelog entries #284

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ This PR addresses ...

**Checklist**

- [ ] added entry in `CHANGES.rst` (either in `Bug Fixes` or `Changes to API`)
- [ ] for a public change, added a towncrier news fragment in `changes/`: <details><summary>`echo "changed something" > changes/<PR#>.<changetype>.rst`</summary>

- ``changes/<PR#>.apichange.rst``: change to public API
- ``changes/<PR#>.bugfix.rst``: fixes an issue
- ``changes/<PR#>.general.rst``: infrastructure or miscellaneous change
- [ ] updated relevant tests
- [ ] updated relevant documentation
- [ ] updated relevant milestone(s)
Comment on lines 15 to 24
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checklist

  • for a public change, added a towncrier news fragment in changes/:

    echo "changed something" > changes/<PR#>.<changetype>.rst

    • changes/<PR#>.apichange.rst: change to public API
    • changes/<PR#>.bugfix.rst: fixes an issue
    • changes/<PR#>.general.rst: infrastructure or miscellaneous change
  • updated relevant tests

  • updated relevant documentation

  • updated relevant milestone(s)

Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name: Ensure changelog
name: changelog

on:
pull_request:
types: [labeled, unlabeled, opened, synchronize, reopened]
types:
- labeled
- unlabeled
- opened
- synchronize
- reopened

# Only cancel in-progress jobs or runs for the current workflow
# This cancels the already triggered workflows for a specific PR without canceling
# other instances of this workflow (other PRs, scheduled triggers, etc) when something
# within that PR re-triggers this CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ensure_changelog:
name: Verify that a changelog entry exists for this pull request
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 }}'
3 changes: 3 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ build:
os: ubuntu-22.04
tools:
python: mambaforge-4.10
jobs:
post_install:
- towncrier build --keep

conda:
environment: docs/rtd_environment.yaml
Expand Down
23 changes: 0 additions & 23 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
1.8.1 (unreleased)
==================

General
-------

-

Changes to API
--------------

-

Bug Fixes
---------

-

ramp_fitting
~~~~~~~~~~~~

- Fixed memory leak in C-extension.[#281]

1.8.0 (2024-08-14)
==================

Expand Down
1 change: 1 addition & 0 deletions changes/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions changes/281.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed memory leak in C-extension.
1 change: 1 addition & 0 deletions changes/284.general.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use ``towncrier`` to handle changelog entries
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Package Documentation
:maxdepth: 1

stcal/package_index.rst
stcal/changes.rst
1 change: 1 addition & 0 deletions docs/rtd_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dependencies:
- pip
- graphviz
- sphinx_rtd_theme>1.2.0
- towncrier
7 changes: 7 additions & 0 deletions docs/stcal/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. currentmodule:: stcal

***********
Change Log
***********

.. include:: ../../CHANGES.rst
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,21 @@ archs = [
"auto",
"aarch64",
]

[tool.towncrier]
filename = "CHANGES.rst"
directory = "changes"
package = "stcal"
title_format = "{version} ({project_date})"
ignore = [".gitkeep"]
wrap = true
issue_format = "`#{issue} <https://github.com/spacetelescope/stcal/{issue}>`_"

[tool.towncrier.fragment.apichange]
name = "Changes to API"

[tool.towncrier.fragment.bugfix]
name = "Bug Fixes"

[tool.towncrier.fragment.general]
name = "General"
Loading