Skip to content

Use towncrier for changelog generation #2736

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

Merged
merged 10 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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: 4 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
needs release notes:
- all: ['!docs/release-notes.rst']
- needs release notes:
- all:
- changed-files:
- any-glob-to-any-file: 'changes/*.rst'
5 changes: 4 additions & 1 deletion .github/workflows/needs_release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ on:
- pull_request_target

jobs:
triage:
labeler:
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} && ${{ github.event.pull_request.user.login != 'pre-commit-ci[bot]' }}
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ repos:
rev: v1.8.0
hooks:
- id: numpydoc-validation
- repo: https://github.com/twisted/towncrier
rev: 23.11.0
hooks:
- id: towncrier-check
7 changes: 7 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ build:
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
pre_build:
- |
if [ "$READTHEDOCS_VERSION_TYPE" != "tag" ];
then
towncrier build --version Unreleased --yes;
fi

sphinx:
configuration: docs/conf.py
Expand Down
1 change: 1 addition & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
2 changes: 2 additions & 0 deletions changes/2736.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Changed the machinery for creating changelog entries.
Now individual entries should be added as files to the `changes` directory in the `zarr-python` repository, instead of directly to the changelog file.
14 changes: 14 additions & 0 deletions changes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Writing a changelog entry
-------------------------

Please put a new file in this directory named `xxxx.<type>.rst`, where

- `xxxx` is the pull request number associated with this entry
- `<type>` is one of:
- feature
- bugfix
- doc
- removal
- misc

Inside the file, please write a short description of what you have changed, and how it impacts users of `zarr-python`.
8 changes: 3 additions & 5 deletions docs/developers/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,9 @@ Release procedure

Pre-release
"""""""""""
1. Make sure that all pull requests which will be
included in the release have been properly documented in
:file:`docs/release-notes.rst`.
2. Rename the "Unreleased" section heading in :file:`docs/release-notes.rst`
to the version you are about to release.
1. Make sure that all pull requests which will be included in the release
have been properly documented as changelog files in :file:`changes`.
2. Run ``towncrier build --version x.y.z`` to create the changelog.

Releasing
"""""""""
Expand Down
15 changes: 1 addition & 14 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
Release notes
=============

Unreleased
----------

Bug fixes
~~~~~~~~~

Features
~~~~~~~~

Documentation
~~~~~~~~~~~~~

Other
~~~~~
.. towncrier release notes start

3.0.1 (Jan. 17, 2025)
---------------------
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ test = [
]
optional = ["rich", "universal-pathlib"]
docs = [
# Doc building
'sphinx==8.1.3',
'sphinx-autobuild>=2021.3.14',
'sphinx-autoapi==3.4.0',
Expand All @@ -94,6 +95,9 @@ docs = [
'sphinx-reredirects',
'pydata-sphinx-theme',
'numpydoc',
# Changelog generation
'towncrier',
# Optional dependencies to run examples
'numcodecs[msgpack]',
'rich',
's3fs',
Expand Down Expand Up @@ -415,3 +419,9 @@ checks = [
"PR05",
"PR06",
]

[tool.towncrier]
directory = 'changes'
filename = "docs/release-notes.rst"
underlines = ["-", "~", "^"]
issue_format = ":issue:`{issue}`"
Loading