PYTHON-3639 Release Build is Failing to Create Universal Wheels for MacOS (#1174)

This commit is contained in:
Steven Silvester 2023-03-27 11:31:51 -05:00 committed by GitHub
parent 880f3dd8ea
commit 1d052cb706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,10 +32,11 @@ if not pymongo.has_c() or not bson.has_c():
if os.environ.get("ENSURE_UNIVERSAL2") == "1":
parent_dir = os.path.dirname(pymongo.__path__[0])
for so_file in glob.glob(f"{parent_dir}/**/*.so"):
print(f"Checking universal2 compatibility in {so_file}...")
output = subprocess.check_output(["file", so_file])
if "arm64" not in output.decode("utf-8"):
sys.exit("Universal wheel was not compiled with arm64 support")
if "x86_64" not in output.decode("utf-8"):
sys.exit("Universal wheel was not compiled with x86_64 support")
for pkg in ["pymongo", "bson", "grifs"]:
for so_file in glob.glob(f"{parent_dir}/{pkg}/*.so"):
print(f"Checking universal2 compatibility in {so_file}...")
output = subprocess.check_output(["file", so_file])
if "arm64" not in output.decode("utf-8"):
sys.exit("Universal wheel was not compiled with arm64 support")
if "x86_64" not in output.decode("utf-8"):
sys.exit("Universal wheel was not compiled with x86_64 support")