Skip to content

Commit 7c7b345

Browse files
Refactor Windows wheel repair to use auditwheel.
Replaced delvewheel with auditwheel for repairing wheels on Windows. Added a check to ensure wheels exist before attempting repair and removed unused code related to delvewheel.
1 parent 41364ee commit 7c7b345

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

scripts/wheelbuilder/build_wheels.py

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,24 +148,31 @@ def build_wheels(pip):
148148

149149
def repair_wheels():
150150
if sys.platform == "win32":
151-
ensure_installed("delvewheel")
152-
env = os.environ.copy()
153-
env["PYTHONUTF8"] = "1"
154-
subprocess.check_call(
155-
[
156-
sys.executable,
157-
"-m",
158-
"delvewheel",
159-
"repair",
160-
"-v",
161-
"--exclude",
162-
"python-native.dll",
163-
"-w",
164-
"wheelhouse",
165-
*glob("*.whl"),
166-
],
167-
env=env,
168-
)
151+
wheels = glob(join("wheelhouse", "*.whl"))
152+
if not wheels:
153+
print("No wheels found to repair.")
154+
return
155+
156+
for wheel in wheels:
157+
subprocess.check_call(["auditwheel", "repair", wheel, "-w", "wheelhouse/"])
158+
# ensure_installed("delvewheel")
159+
# env = os.environ.copy()
160+
# env["PYTHONUTF8"] = "1"
161+
# subprocess.check_call(
162+
# [
163+
# sys.executable,
164+
# "-m",
165+
# "delvewheel",
166+
# "repair",
167+
# "-v",
168+
# "--exclude",
169+
# "python-native.dll",
170+
# "-w",
171+
# "wheelhouse",
172+
# *glob("*.whl"),
173+
# ],
174+
# env=env,
175+
# )
169176
elif sys.platform == "linux":
170177
ensure_installed("auditwheel")
171178
subprocess.check_call(

0 commit comments

Comments
 (0)