Skip to content

Commit 647939a

Browse files
committed
Set up towncrier for release note management
This copies all the settings from Trio (they seem very reasonable), and allows for a new release-notes management system that should make releases easier.
1 parent b040c37 commit 647939a

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ how to get started:
111111
* [How to contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
112112

113113

114+
### Release notes
115+
116+
We use towncrier to manage our release notes. Basically, every pull
117+
request that has a user visible effect should add a short file to the
118+
newsfragments/ directory describing the change, with a name like
119+
<ISSUE NUMBER>.<TYPE>.rst. See newsfragments/README.rst for
120+
details. This way we can keep a good list of changes as we go, which
121+
makes the release manager happy, which means we get more frequent
122+
releases, which means your change gets into users’ hands faster.
123+
124+
114125
## After you submit a PR
115126

116127
We'll try to review it promptly and give feedback -- but if you

docs/source/changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ History of changes
33

44
.. currentmodule:: h11
55

6+
.. towncrier release notes start
7+
68
v0.9.0 (2019-05-15)
79
-------------------
810

newsfragments/.gitkeep

Whitespace-only changes.

newsfragments/README.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
This directory collects "newsfragments": short files that each contain
2+
a snippet of ReST-formatted text that will be added to the next
3+
release notes. This should be a description of aspects of the change
4+
(if any) that are relevant to users. (This contrasts with your commit
5+
message and PR description, which are a description of the change as
6+
relevant to people working on the code itself.)
7+
8+
Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
9+
``<ISSUE>`` is an issue numbers, and ``<TYPE>`` is one of:
10+
11+
* ``feature``
12+
* ``bugfix``
13+
* ``doc``
14+
* ``removal``
15+
* ``misc``
16+
17+
So for example: ``123.feature.rst``, ``456.bugfix.rst``
18+
19+
If your PR fixes an issue, use that number here. If there is no issue,
20+
then after you submit the PR and get the PR number you can add a
21+
newsfragment using that instead.
22+
23+
Note that the ``towncrier`` tool will automatically
24+
reflow your text, so don't try to do any fancy formatting. You can
25+
install ``towncrier`` and then run ``towncrier --draft`` if you want
26+
to get a preview of how your change will look in the final release
27+
notes.

pyproject.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[tool.towncrier]
2+
# Usage:
3+
# - PRs should drop a file like "issuenumber.feature" in newsfragments
4+
# (or "bugfix", "doc", "removal", "misc"; misc gets no text, we can
5+
# customize this)
6+
# - At release time after bumping version number, run: towncrier
7+
# (or towncrier --draft)
8+
package = "h11"
9+
filename = "docs/source/changes.rst"
10+
directory = "newsfragments"
11+
underlines = ["-", "~", "^"]
12+
issue_format = "`#{issue} <https://github.com/python-hyper/h11/issues/{issue}>`__"
13+
14+
# Unfortunately there's no way to simply override
15+
# tool.towncrier.type.misc.showcontent
16+
17+
[[tool.towncrier.type]]
18+
directory = "feature"
19+
name = "Features"
20+
showcontent = true
21+
22+
[[tool.towncrier.type]]
23+
directory = "bugfix"
24+
name = "Bugfixes"
25+
showcontent = true
26+
27+
[[tool.towncrier.type]]
28+
directory = "doc"
29+
name = "Improved Documentation"
30+
showcontent = true
31+
32+
[[tool.towncrier.type]]
33+
directory = "removal"
34+
name = "Deprecations and Removals"
35+
showcontent = true
36+
37+
[[tool.towncrier.type]]
38+
directory = "misc"
39+
name = "Miscellaneous internal changes"
40+
showcontent = true

0 commit comments

Comments
 (0)