From d7acf7a3152fa578b2c26967a64cf73cd1fb98f9 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 23 Dec 2025 19:38:59 +0000 Subject: [PATCH] [release script] Auditwheel only on Linux. --- tools/release.py | 76 ++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/tools/release.py b/tools/release.py index 1fa6017..a5860f7 100644 --- a/tools/release.py +++ b/tools/release.py @@ -1,11 +1,13 @@ #!/usr/bin/env python3 """Build wheels for all supported Python versions using uv.""" +import platform +import shutil import subprocess import sys -import tomllib from pathlib import Path -import shutil + +import tomllib from packaging.specifiers import SpecifierSet from packaging.version import Version @@ -211,42 +213,46 @@ def main(): wheel = wheels[0] - # Repair wheel with auditwheel for manylinux compatibility - repair_cmd = [ - "uv", - "run", - "auditwheel", - "repair", - str(wheel), - "-w", - str(dist_dir), - ] - if not run_command( - repair_cmd, f"Repairing wheel for Python {py_version} with auditwheel" - ): - print( - f"✗ Auditwheel repair failed for Python {py_version}", file=sys.stderr + # Repair wheel with auditwheel for manylinux compatibility (Linux only) + if platform.system() == "Linux": + repair_cmd = [ + "uv", + "run", + "auditwheel", + "repair", + str(wheel), + "-w", + str(dist_dir), + ] + if not run_command( + repair_cmd, f"Repairing wheel for Python {py_version} with auditwheel" + ): + print( + f"✗ Auditwheel repair failed for Python {py_version}", + file=sys.stderr, + ) + failed_builds.append(py_version) + continue + + # Find the repaired wheel (it will have a different name) + all_wheels = list( + dist_dir.glob(f"aeg-*-cp{py_version.replace('.', '')}-*.whl") ) - failed_builds.append(py_version) - continue + repaired_wheels = [w for w in all_wheels if "linux_x86_64" not in str(w)] + if not repaired_wheels: + print( + f"✗ Could not find repaired (manylinux) wheel for Python {py_version}", + file=sys.stderr, + ) + failed_builds.append(py_version) + continue - # Find the repaired wheel (it will have a different name) - all_wheels = list(dist_dir.glob(f"aeg-*-cp{py_version.replace('.', '')}-*.whl")) - repaired_wheels = [w for w in all_wheels if "linux_x86_64" not in str(w)] - if not repaired_wheels: - print( - f"✗ Could not find repaired (manylinux) wheel for Python {py_version}", - file=sys.stderr, - ) - failed_builds.append(py_version) - continue + wheel = repaired_wheels[0] # Use the repaired wheel for testing - wheel = repaired_wheels[0] # Use the repaired wheel for testing - - # Remove the unrepaired linux_x86_64 wheels - for w in all_wheels: - if "linux_x86_64" in str(w): - w.unlink() + # Remove the unrepaired linux_x86_64 wheels + for w in all_wheels: + if "linux_x86_64" in str(w): + w.unlink() # Test the wheel with pytest (use --isolated to avoid .venv conflicts) test_cmd = [