Skip to content

Commit 0441028

Browse files
authored
Adopt towncrier for the changelog (#718)
* Add towncrier and changes since 3.2.0 * Generate example changelog * Remove releases tooling * Reformat existing changelog * Fix long lines * Add new changelog to existing changelog * Generate example changelog entry * Group entries by type * Document SemVer * Add changelog entry * Remove releases from docs requirements * Remove example changelog entry * Add changelog instructions * Move changelog instructions to contributing.rst * Update release instructions
1 parent 35e40d9 commit 0441028

18 files changed

+490
-234
lines changed

changelog/.gitignore

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

changelog/670.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Print files to be uploaded using ``upload --verbose``

changelog/675.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Print configuration file location when using ``upload --verbose``

changelog/678.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make password optional when using ``upload --client-cert``

changelog/680.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adopt PSF code of conduct

changelog/685.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Print source and values of credentials when using ``upload --verbose``

changelog/693.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support more Nexus versions with ``upload --skip-existing``

changelog/698.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support Gitlab Enterprise with ``upload --skip-existing``

changelog/708.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for Python 3.9

changelog/714.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Show a better error message for malformed files

changelog/715.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Turn warnings into errors when using ``check --strict``

changelog/718.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adopt towncrier for the changleog

docs/changelog.rst

Lines changed: 419 additions & 216 deletions
Large diffs are not rendered by default.

docs/conf.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# -- General configuration ----------------------------------------------------
2525

2626
# If your documentation needs a minimal Sphinx version, state it here.
27-
needs_sphinx = '1.7.0'
27+
needs_sphinx = "1.7.0"
2828

2929
# Add any Sphinx extension module names here, as strings. They can be
3030
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
@@ -34,15 +34,8 @@
3434
"sphinx.ext.intersphinx",
3535
"sphinx.ext.coverage",
3636
"sphinx.ext.viewcode",
37-
"releases",
3837
]
3938

40-
# 'releases' (changelog) settings
41-
releases_issue_uri = "https://github.com/pypa/twine/issues/%s"
42-
releases_release_uri = "https://github.com/pypa/twine/tree/%s"
43-
44-
releases_debug = False # Change to True to see debug output
45-
4639
# Add any paths that contain templates here, relative to this directory.
4740
templates_path = ["_templates"]
4841

@@ -188,10 +181,8 @@
188181
latex_elements = {
189182
# The paper size ('letterpaper' or 'a4paper').
190183
# 'papersize': 'letterpaper',
191-
192184
# The font size ('10pt', '11pt' or '12pt').
193185
# 'pointsize': '10pt',
194-
195186
# Additional stuff for the LaTeX preamble.
196187
# 'preamble': '',
197188
}

docs/contributing.rst

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,51 @@ and build the documentation, run:
130130
131131
132132
Submitting changes
133-
^^^^^^^^^^^^^^^^^^
133+
------------------
134134

135135
1. Fork `the GitHub repository`_.
136136
2. Make a branch off of ``master`` and commit your changes to it.
137137
3. Run the tests, check code style, and build the docs as described above.
138-
4. Ensure that your name is added to the end of the :file:`AUTHORS`
138+
4. Optionally, add your name to the end of the :file:`AUTHORS`
139139
file using the format ``Name <[email protected]> (url)``, where the
140140
``(url)`` portion is optional.
141-
5. Submit a pull request to the ``master`` branch on GitHub.
141+
5. Submit a pull request to the ``master`` branch on GitHub, referencing an
142+
open issue.
143+
6. Add a changelog entry.
144+
145+
Changelog entries
146+
^^^^^^^^^^^^^^^^^
147+
148+
The ``docs/changelog.rst`` file is built by `towncrier`_ from files in the
149+
``changelog/`` directory. To add an entry, create a file in that directory
150+
named ``{number}.{type}.rst``, where ``{number}`` is the pull request number,
151+
and ``{type}`` is ``feature``, ``bugfix``, ``doc``, ``removal``, or ``misc``.
152+
153+
For example, if your PR number is 1234 and it's fixing a bug, then you
154+
would create ``changelog/1234.bugfix.rst``. PRs can span multiple categories by
155+
creating multiple files: if you added a feature and deprecated/removed an old
156+
feature in PR #5678, you would create ``changelog/5678.feature.rst`` and
157+
``changelog/5678.removal.rst``.
158+
159+
A changelog entry is meant for end users and should only contain details
160+
relevant to them. In order to maintain a consistent style, please keep the
161+
entry to the point, in sentence case, shorter than 80 characters, and in an
162+
imperative tone. An entry should complete the sentence "This change will ...".
163+
If one line is not enough, use a summary line in an imperative tone, followed
164+
by a description of the change in one or more paragraphs, each wrapped at 80
165+
characters and separated by blank lines.
166+
167+
You don't need to reference the pull request or issue number in a changelog
168+
entry, since towncrier will add a link using the number in the file name,
169+
and the pull request should reference an issue number. Similarly, you don't
170+
need to add your name to the entry, since that will be associated with the pull
171+
request.
172+
173+
Changelog entries are rendered using `reStructuredText`_, but they should only
174+
have minimal formatting (such as ````monospaced text````).
175+
176+
.. _`towncrier`: https://pypi.org/project/towncrier/
177+
.. _`reStructuredText`: https://www.writethedocs.org/guide/writing/reStructuredText/
142178

143179

144180
Architectural overview
@@ -196,9 +232,9 @@ Making a new release
196232

197233
A checklist for creating, testing, and distributing a new version.
198234

199-
#. Add user-facing changes to :file:`docs/changelog.rst`.
200-
#. Choose a version number, e.g. ``3.2.0``.
201-
#. Add a ``:release:`` line to :file:`docs/changelog.rst`.
235+
#. Choose a version number, e.g. ``3.3.0``.
236+
#. Run ``tox -e changelog -- --version {version}`` to build
237+
:file:`docs/changelog.rst`.
202238
#. Commit and open a pull request for review.
203239
#. Merge the pull request, and ensure the `GitHub Actions`_ build passes.
204240
#. Create a new git tag with ``git tag -m "Release v{version}" {version}``.
@@ -228,6 +264,5 @@ merge into a single tool; see `ongoing discussion
228264
.. _`black`: https://black.readthedocs.io/
229265
.. _`flake8`: https://flake8.pycqa.org/
230266
.. _`mypy`: https://mypy.readthedocs.io/
231-
.. _`plugin`: https://github.com/bitprophet/releases
232267
.. _`projects`: https://packaging.python.org/glossary/#term-Project
233268
.. _`open issues`: https://github.com/pypa/twine/issues

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
doc8>=0.8.0
22
readme-renderer>=17.4
3-
releases>=1.4.0
43
Sphinx>=1.7.0
54
sphinx_rtd_theme>=0.2.4

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
[build-system]
22
requires = ["setuptools>=40.8", "wheel", "setuptools_scm>=1.15"]
33
build-backend = "setuptools.build_meta:__legacy__"
4+
5+
[tool.towncrier]
6+
package = "twine"
7+
filename = "docs/changelog.rst"
8+
directory = "changelog"
9+
title_format = "{version} ({project_date})"
10+
issue_format = "`#{issue} <https://github.com/pypa/twine/issues/{issue}>`_"
11+
underlines = ["-", "^"]

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ commands =
7777
mypy --html-report mypy --txt-report mypy {posargs:twine}
7878
python -c 'with open("mypy/index.txt") as f: print(f.read())'
7979

80+
[testenv:changelog]
81+
basepython = python3
82+
skip_install = true
83+
deps =
84+
towncrier
85+
commands =
86+
towncrier {posargs}
87+
8088
[testenv:release]
8189
# disabled for twine to cause it to upload itself
8290
# skip_install = True

0 commit comments

Comments
 (0)