Skip to content

Commit c1105f3

Browse files
committed
Use towncrier for changelog generation
1 parent e9772ac commit c1105f3

File tree

7 files changed

+34
-19
lines changed

7 files changed

+34
-19
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ repos:
4949
rev: v1.8.0
5050
hooks:
5151
- id: numpydoc-validation
52+
- repo: https://github.com/twisted/towncrier
53+
rev: 23.11.0
54+
hooks:
55+
- id: towncrier-check

changes/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

changes/1234.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Changed the machinery for creating changelog entries.
2+
Now individual entries should be added as files to the `changes` directory in the `zarr-python` repository, instead of directly to the changelog file.

changes/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Writing a changelog entry
2+
-------------------------
3+
4+
Please put a new file in this directory named `xxxx.<type>.rst`, where
5+
6+
- `xxxx` is the pull request number associated with this entry
7+
- `<type>` is one of:
8+
- feature
9+
- bugfix
10+
- doc
11+
- removal
12+
- misc
13+
14+
Inside the file, please write a short description of what you have changed, and how it impacts users of `zarr-python`.

docs/developers/contributing.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,9 @@ Release procedure
335335

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

344342
Releasing
345343
"""""""""

docs/release-notes.rst

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
Release notes
22
=============
33

4-
Unreleased
5-
----------
6-
7-
Bug fixes
8-
~~~~~~~~~
9-
10-
Features
11-
~~~~~~~~
12-
13-
Documentation
14-
~~~~~~~~~~~~~
15-
16-
Other
17-
~~~~~
4+
.. towncrier release notes start
185
196
3.0.1 (Jan. 17, 2025)
207
---------------------

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ test = [
8585
]
8686
optional = ["rich", "universal-pathlib"]
8787
docs = [
88+
# Doc building
8889
'sphinx==8.1.3',
8990
'sphinx-autobuild>=2021.3.14',
9091
'sphinx-autoapi==3.4.0',
@@ -94,6 +95,9 @@ docs = [
9495
'sphinx-reredirects',
9596
'pydata-sphinx-theme',
9697
'numpydoc',
98+
# Changelog generation
99+
'towncrier',
100+
# Optional dependencies to run examples
97101
'numcodecs[msgpack]',
98102
'rich',
99103
's3fs',
@@ -415,3 +419,8 @@ checks = [
415419
"PR05",
416420
"PR06",
417421
]
422+
423+
[tool.towncrier]
424+
directory = 'changes'
425+
filename = "docs/release-notes.rst"
426+
underlines = ["-", "~", "^"]

0 commit comments

Comments
 (0)