Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Analytics] Pypi validations. Add call to check-wheel-contents #1689

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion analytics/validate_pypi_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import os.path
import shutil
import subprocess
import tempfile
import zipfile

import boto3
import botocore


PLATFORMS = [
"manylinux1_x86_64",
"manylinux2014_aarch64",
Expand Down Expand Up @@ -72,6 +73,22 @@ def validate_file_metadata(build: str, package: str, version: str):
tmp_file = f"{temp_dir}/{os.path.basename(build)}"
s3.download_file(Bucket=S3_PYPI_STAGING, Key=build, Filename=tmp_file)
print(f"Downloaded: {tmp_file} {get_size(tmp_file)}")

try:
check_wheels = subprocess.run(
["check-wheel-contents", tmp_file, "--ignore", "W002,W009,W004"],
capture_output=True,
text=True,
check=True,
encoding="utf-8",
)
print(check_wheels.stdout)
print(check_wheels.stderr)
except subprocess.CalledProcessError as e:
exit_code = e.returncode
stderror = e.stderr
print(exit_code, stderror)

with zipfile.ZipFile(f"{temp_dir}/{os.path.basename(build)}", "r") as zip_ref:
zip_ref.extractall(f"{temp_dir}")

Expand Down
Loading