Skip to content

Commit 48d1c4c

Browse files
committed
Setup towncrier
1 parent 2ede7d7 commit 48d1c4c

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

CHANGES/README.rst

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.. _Adding change notes with your PRs:
2+
3+
Adding change notes with your PRs
4+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
6+
It is very important to maintain a log for news of how
7+
updating to the new version of the software will affect
8+
end-users. This is why we enforce collection of the change
9+
fragment files in pull requests as per `Towncrier philosophy`_.
10+
11+
The idea is that when somebody makes a change, they must record
12+
the bits that would affect end-users only including information
13+
that would be useful to them. Then, when the maintainers publish
14+
a new release, they'll automatically use these records to compose
15+
a change log for the respective version. It is important to
16+
understand that including unnecessary low-level implementation
17+
related details generates noise that is not particularly useful
18+
to the end-users most of the time. And so such details should be
19+
recorded in the Git history rather than a changelog.
20+
21+
Alright! So how to add a news fragment?
22+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
24+
``async-timeout`` uses `towncrier <https://pypi.org/project/towncrier/>`_
25+
for changelog management.
26+
To submit a change note about your PR, add a text file into the
27+
``CHANGES/`` folder. It should contain an
28+
explanation of what applying this PR will change in the way
29+
end-users interact with the project. One sentence is usually
30+
enough but feel free to add as many details as you feel necessary
31+
for the users to understand what it means.
32+
33+
**Use the past tense** for the text in your fragment because,
34+
combined with others, it will be a part of the "news digest"
35+
telling the readers **what changed** in a specific version of
36+
the library *since the previous version*. You should also use
37+
reStructuredText syntax for highlighting code (inline or block),
38+
linking parts of the docs or external sites.
39+
40+
Finally, name your file following the convention that Towncrier
41+
understands: it should start with the number of an issue or a
42+
PR followed by a dot, then add a patch type, like ``feature``,
43+
``doc``, ``misc`` etc., and add ``.rst`` as a suffix. If you
44+
need to add more than one fragment, you may add an optional
45+
sequence number (delimited with another period) between the type
46+
and the suffix.
47+
48+
In general the name will follow ``<pr_number>.<category>.rst`` pattern,
49+
where the categories are:
50+
51+
- ``feature``: Any new feature
52+
- ``bugfix``: A bug fix
53+
- ``doc``: A change to the documentation
54+
- ``misc``: Changes internal to the repo like CI, test and build changes
55+
- ``removal``: For deprecations and removals of an existing feature or behavior
56+
57+
A pull request may have more than one of these components, for example
58+
a code change may introduce a new feature that deprecates an old
59+
feature, in which case two fragments should be added. It is not
60+
necessary to make a separate documentation fragment for documentation
61+
changes accompanying the relevant code changes.
62+
63+
Examples for adding changelog entries to your Pull Requests
64+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
66+
File :file:`CHANGES/603.removal.1.rst`:
67+
68+
.. code-block:: rst
69+
70+
Droped Python 3.5 support; Python 3.6 is the minimal supported Python version.
71+
72+
File :file:`CHANGES/550.bugfix.rst`:
73+
74+
.. code-block:: rst
75+
76+
Started shipping Windows wheels for the x86 architecture.
77+
78+
File :file:`CHANGES/553.feature.rst`:
79+
80+
.. code-block:: rst
81+
82+
Added support for ``GenericAliases`` (``MultiDict[str]``) under Python 3.9 and higher.
83+
84+
85+
.. _Towncrier philosophy:
86+
https://towncrier.readthedocs.io/en/actual-freaking-docs/#philosophy

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ requires = [
44
"wheel",
55
]
66
build-backend = "setuptools.build_meta"
7+
8+
[tool.towncrier]
9+
package = "async_timeout"
10+
filename = "CHANGES.rst"
11+
directory = "CHANGES/"
12+
title_format = "{version} ({project_date})"
13+
issue_format = "`#{issue} <https://github.com/aio-libs/async-timeout/issues/{issue}>`_"

0 commit comments

Comments
 (0)