File: test_all_newsfragments_used.py

package info (click to toggle)
numpy 1%3A2.3.4%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 86,072 kB
  • sloc: python: 255,800; asm: 232,483; ansic: 212,593; cpp: 157,465; f90: 1,575; sh: 845; fortran: 567; makefile: 431; sed: 139; xml: 109; java: 97; perl: 82; cs: 62; javascript: 53; objc: 33; lex: 13; yacc: 9
file content (23 lines) | stat: -rwxr-xr-x 445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3

import os
import sys

import toml


def main():
    path = toml.load("pyproject.toml")["tool"]["towncrier"]["directory"]

    fragments = os.listdir(path)
    fragments.remove("README.rst")
    fragments.remove("template.rst")

    if fragments:
        print("The following files were not found by towncrier:")
        print("    " + "\n    ".join(fragments))
        sys.exit(1)


if __name__ == "__main__":
    main()