tools/ci/test_all_newsfragments_used.py
raw| 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | import os |
| 4 | import sys |
| 5 | |
| 6 | import toml |
| 7 | |
| 8 | |
| 9 | def main(): |
| 10 | path = toml.load("pyproject.toml")["tool"]["towncrier"]["directory"] |
| 11 | |
| 12 | fragments = os.listdir(path) |
| 13 | fragments.remove("README.rst") |
| 14 | fragments.remove("template.rst") |
| 15 | |
| 16 | if fragments: |
| 17 | print("The following files were not found by towncrier:") |
| 18 | print(" " + "\n ".join(fragments)) |
| 19 | sys.exit(1) |
| 20 | |
| 21 | |
| 22 | if __name__ == "__main__": |
| 23 | main() |