From 733868ff875a4a284cef77bd3e013d69ebef3c3e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 3 Dec 2021 15:32:38 +0100 Subject: scripts: Run 'twine check' --- scripts/dev/build_release.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/dev/build_release.py b/scripts/dev/build_release.py index ddad1b607..d82c162b0 100755 --- a/scripts/dev/build_release.py +++ b/scripts/dev/build_release.py @@ -600,8 +600,18 @@ def github_upload(artifacts, tag, gh_token): def pypi_upload(artifacts): """Upload the given artifacts to PyPI using twine.""" utils.print_title("Uploading to PyPI...") + run_twine('upload', artifacts) + + +def twine_check(artifacts): + """Check packages using 'twine check'.""" + utils.print_title("Running twine check...") + run_twine('check', artifacts, '--strict') + + +def run_twine(command, artifacts, *args): filenames = [a[0] for a in artifacts] - subprocess.run([sys.executable, '-m', 'twine', 'upload'] + filenames, + subprocess.run([sys.executable, '-m', 'twine', command] + list(args) + filenames, check=True) @@ -664,6 +674,7 @@ def main(): else: test_makefile() artifacts = build_sdist() + twine_check(artifacts) upload_to_pypi = True if args.upload: -- cgit v1.2.3-54-g00ecf