Skip to content

Commit cd8cbf9

Browse files
authored
Fix macOS x86_64 wheel tag (#287)
1 parent 4304362 commit cd8cbf9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/fix_wheel.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,25 @@
2525
with open(wheel_files[0]) as f:
2626
wheel_lines = f.read().splitlines()
2727

28-
# Alter the "Tag" to use 3.7+ Python, ABI3 limited API, or if macOS ARM,
29-
# manually set as 11_0 w/ 3.8+
28+
# Alter the "Tag"
3029
found_wheel_tag = False
3130
for i, line in enumerate(wheel_lines):
3231
if line.startswith("Tag: "):
3332
pieces = line[len("Tag: ") :].split("-")
3433
if len(pieces) < 3:
3534
raise RuntimeError("Expecting at least 3 wheel tag pieces")
35+
# All tags need ABI3
3636
pieces[1] = "abi3"
3737
if pieces[2].startswith("macosx_") and pieces[2].endswith("_arm64"):
38+
# macOS ARM needs to be set to 3.8+ on 11+
3839
pieces[0] = "cp38"
3940
pieces[2] = "macosx_11_0_arm64"
41+
elif pieces[2].startswith("macosx_") and pieces[2].endswith("_x86_64"):
42+
# macOS x86 needs to be set to 3.7+ on 10.9+
43+
pieces[0] = "cp37"
44+
pieces[2] = "macosx_10_9_x86_64"
4045
else:
46+
# All others just need to be set to 3.7+
4147
pieces[0] = "cp37"
4248
wheel_lines[i] = "Tag: " + "-".join(pieces)
4349
found_wheel_tag = True

0 commit comments

Comments
 (0)