Skip to content

Commit 6819d41

Browse files
author
Jussi Kukkonen
committed
verify_release: Be specific about expected artifacts
Use a hard-coded list of artifacts that we expect to find in a release. Specifically check that each of those files matches the corresponding file in locally built release. Also add two missing annotations. Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
1 parent 65d6503 commit 6819d41

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

verify_release

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ def verify_github_release(version: str, compare_dir: str) -> bool:
8484
for data in response.iter_content():
8585
f.write(data)
8686

87-
return not dircmp(github_dir, compare_dir).diff_files
87+
same = dircmp(github_dir, compare_dir).same_files
88+
return sorted(same) == [wheel, tar]
8889

8990

9091
def verify_pypi_release(version: str, compare_dir: str) -> bool:
9192
"""Verify that given PyPI version artifacts match expected artifacts"""
93+
tar = f"{PYPI_PROJECT}-{version}.tar.gz"
94+
wheel = f"{PYPI_PROJECT}-{version}-py3-none-any.whl"
95+
9296
with TemporaryDirectory() as pypi_dir:
9397
cmd = ["pip", "download", "--no-deps", "--dest", pypi_dir]
9498
target = f"{PYPI_PROJECT}=={version}"
@@ -98,16 +102,17 @@ def verify_pypi_release(version: str, compare_dir: str) -> bool:
98102
subprocess.run(binary_download, stdout=subprocess.DEVNULL, check=True)
99103
subprocess.run(source_download, stdout=subprocess.DEVNULL, check=True)
100104

101-
return not dircmp(pypi_dir, compare_dir).diff_files
105+
same = dircmp(pypi_dir, compare_dir).same_files
106+
return sorted(same) == [wheel, tar]
102107

103108

104-
def finished(s: str):
109+
def finished(s: str) -> None:
105110
# clear line
106111
sys.stdout.write("\033[K")
107112
print(f"* {s}")
108113

109114

110-
def progress(s: str):
115+
def progress(s: str) -> None:
111116
# clear line
112117
sys.stdout.write("\033[K")
113118
# carriage return but no newline: next print will overwrite this one

0 commit comments

Comments
 (0)