Skip to content

Commit 4f275ad

Browse files
author
Lukas Puehringer
committed
build: add skip-pypi flag to verify_release script
Add '--skip-pypi' flag to 'verify_release' script to allow for pre-release checks, when the automatic build job has uploaded the build assets to GitHub and is awaiting review/approval in order to upload it to PyPI eventually. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
1 parent a76ed28 commit 4f275ad

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

verify_release

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Builds a release from current commit and verifies that the release artifacts
99
on GitHub and PyPI match the built release artifacts.
1010
"""
1111

12+
import argparse
1213
import json
1314
import os
1415
import subprocess
@@ -126,6 +127,15 @@ def progress(s: str) -> None:
126127

127128

128129
def main() -> int:
130+
parser = argparse.ArgumentParser()
131+
parser.add_argument(
132+
"--skip-pypi",
133+
action="store_true",
134+
dest="skip_pypi",
135+
help="Skip PyPI release check.",
136+
)
137+
args = parser.parse_args()
138+
129139
success = True
130140
with TemporaryDirectory() as build_dir:
131141
progress("Building release")
@@ -142,16 +152,17 @@ def main() -> int:
142152
if github_version != build_version:
143153
finished(f"WARNING: GitHub latest version is {github_version}")
144154

145-
progress("Checking PyPI latest version")
146-
pypi_version = get_pypi_pip_version()
147-
if pypi_version != build_version:
148-
finished(f"WARNING: PyPI latest version is {pypi_version}")
149-
150-
progress("Downloading release from PyPI")
151-
if not verify_pypi_release(build_version, build_dir):
152-
# This is expected while build is not reproducible
153-
finished("ERROR: PyPI artifacts do not match built release")
154-
success = False
155+
if not args.skip_pypi:
156+
progress("Checking PyPI latest version")
157+
pypi_version = get_pypi_pip_version()
158+
if pypi_version != build_version:
159+
finished(f"WARNING: PyPI latest version is {pypi_version}")
160+
161+
progress("Downloading release from PyPI")
162+
if not verify_pypi_release(build_version, build_dir):
163+
# This is expected while build is not reproducible
164+
finished("ERROR: PyPI artifacts do not match built release")
165+
success = False
155166

156167
progress("Downloading release from GitHub")
157168
if not verify_github_release(build_version, build_dir):

0 commit comments

Comments
 (0)