mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Setup towncrier to generate release notes
This commit is contained in:
26
newsfragments/README.md
Normal file
26
newsfragments/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
This directory collects "newsfragments": short files that each contain
|
||||
a snippet of ReST-formatted text that will be added to the next
|
||||
release notes. This should be a description of aspects of the change
|
||||
(if any) that are relevant to users. (This contrasts with the
|
||||
commit message and PR description, which are a description of the change as
|
||||
relevant to people working on the code itself.)
|
||||
|
||||
Each file should be named like `<ISSUE>.<TYPE>.rst`, where
|
||||
`<ISSUE>` is an issue numbers, and `<TYPE>` is one of:
|
||||
|
||||
* `feature`
|
||||
* `bugfix`
|
||||
* `performance`
|
||||
* `doc`
|
||||
* `removal`
|
||||
* `misc`
|
||||
|
||||
So for example: `123.feature.rst`, `456.bugfix.rst`
|
||||
|
||||
If the PR fixes an issue, use that number here. If there is no issue,
|
||||
then open up the PR first and use the PR number for the newsfragment.
|
||||
|
||||
Note that the `towncrier` tool will automatically
|
||||
reflow your text, so don't try to do any fancy formatting. Run
|
||||
`towncrier --draft` to get a preview of what the release notes entry
|
||||
will look like in the final release notes.
|
||||
32
newsfragments/validate_files.py
Executable file
32
newsfragments/validate_files.py
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Towncrier silently ignores files that do not match the expected ending.
|
||||
# We use this script to ensure we catch these as errors in CI.
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
ALLOWED_EXTENSIONS = {
|
||||
'.bugfix.rst',
|
||||
'.doc.rst',
|
||||
'.feature.rst',
|
||||
'.misc.rst',
|
||||
'.performance.rst',
|
||||
'.removal.rst',
|
||||
}
|
||||
|
||||
ALLOWED_FILES = {
|
||||
'validate_files.py',
|
||||
'README.md',
|
||||
}
|
||||
|
||||
THIS_DIR = pathlib.Path(__file__).parent
|
||||
|
||||
for fragment_file in THIS_DIR.iterdir():
|
||||
|
||||
if fragment_file.name in ALLOWED_FILES:
|
||||
continue
|
||||
|
||||
full_extension = "".join(fragment_file.suffixes)
|
||||
if full_extension not in ALLOWED_EXTENSIONS:
|
||||
raise Exception(f"Unexpected file: {fragment_file}")
|
||||
Reference in New Issue
Block a user