diff options
Diffstat (limited to 'tools/finalize.py')
-rw-r--r-- | tools/finalize.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/finalize.py b/tools/finalize.py index 516a2fb5..5a4df5df 100644 --- a/tools/finalize.py +++ b/tools/finalize.py @@ -42,6 +42,7 @@ def update_changelog(): cmd = [ sys.executable, '-m', 'towncrier', + 'build', '--version', get_version(), '--yes', ] @@ -79,11 +80,18 @@ def check_changes(): """ allowed = 'deprecation', 'breaking', 'change', 'doc', 'misc' except_ = 'README.rst', '.gitignore' - assert all( - any(key in file.name for key in allowed) + news_fragments = ( + file for file in pathlib.Path('changelog.d').iterdir() if file.name not in except_ ) + unrecognized = [ + str(file) + for file in news_fragments + if not any(f".{key}" in file.suffixes for key in allowed) + ] + if unrecognized: + raise ValueError(f"Some news fragments have invalid names: {unrecognized}") if __name__ == '__main__': |