tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

towncrier-draft-to-file.py (489B)


      1 # mypy: disallow-untyped-defs
      2 from subprocess import call
      3 import sys
      4 
      5 
      6 def main() -> int:
      7    """
      8    Platform-agnostic wrapper script for towncrier.
      9    Fixes the issue (#7251) where Windows users are unable to natively run tox -e docs to build pytest docs.
     10    """
     11    with open(
     12        "doc/en/_changelog_towncrier_draft.rst", "w", encoding="utf-8"
     13    ) as draft_file:
     14        return call(("towncrier", "--draft"), stdout=draft_file)
     15 
     16 
     17 if __name__ == "__main__":
     18    sys.exit(main())