docs: improve changelog to be automatically generated by towncrier #921
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a subset of #885, introducing minimal modifications to start using towncrier.
Instead of generating all of
docs/release_notes.rst
, a skeleton is checked in git. The skeleton includes two files:news.inc
: generated by towncrier.release_notes.inc
: generated by the existing logic increate_release_notes.py
.towncrier
is executed increate_release_notes
. Hence, in the same function all the news fragments are combined intonews.inc
and all the release notes are combined intorelease_notes.inc
. This works even if no news fragments exist (right after a release) because towncrier will produce a sentence telling that no relevant news exist yet.When a release needs to be done, a maintainer renames the
news.inc
torelease_notes/X.Y.Z.rst
and removes the news fragments before executingrelease.py
.It is to be noted that towncrier tries to add the generated file to git. It seems not possible to prevent it through the configuration nor the CLI. The only alternative seems to be
--draft
, which prints to stdout instead of writing to the file. That's why this PR uses a fixed file name for towncrier and it is added to.gitignore
. The output of towncrier is always temporary (e.g. generated in CI) until a maintainer renames the file to be treated as release notes./cc @GlenNicholls