Skip to content

Commit 6f3530c

Browse files
authored
[Analytics] Pypi validations. Add call to check-wheel-contents (#1689)
1 parent 42852bb commit 6f3530c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

analytics/validate_pypi_staging.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
import os.path
44
import shutil
5+
import subprocess
56
import tempfile
67
import zipfile
8+
79
import boto3
810
import botocore
911

10-
1112
PLATFORMS = [
1213
"manylinux1_x86_64",
1314
"manylinux2014_aarch64",
@@ -72,6 +73,22 @@ def validate_file_metadata(build: str, package: str, version: str):
7273
tmp_file = f"{temp_dir}/{os.path.basename(build)}"
7374
s3.download_file(Bucket=S3_PYPI_STAGING, Key=build, Filename=tmp_file)
7475
print(f"Downloaded: {tmp_file} {get_size(tmp_file)}")
76+
77+
try:
78+
check_wheels = subprocess.run(
79+
["check-wheel-contents", tmp_file, "--ignore", "W002,W009,W004"],
80+
capture_output=True,
81+
text=True,
82+
check=True,
83+
encoding="utf-8",
84+
)
85+
print(check_wheels.stdout)
86+
print(check_wheels.stderr)
87+
except subprocess.CalledProcessError as e:
88+
exit_code = e.returncode
89+
stderror = e.stderr
90+
print(exit_code, stderror)
91+
7592
with zipfile.ZipFile(f"{temp_dir}/{os.path.basename(build)}", "r") as zip_ref:
7693
zip_ref.extractall(f"{temp_dir}")
7794

0 commit comments

Comments
 (0)