Skip to content

Commit

Permalink
try workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Jun 11, 2024
1 parent ff0d792 commit 8a7e8b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/fix-wheels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import sys
import pathlib
import sysconfig
import platform
from wheel.cli.tags import tags


Expand All @@ -18,9 +19,15 @@ def main(wheel_dir):
# PyPi rejects non-manylinux wheels. Change the tag according to PEP-513
if platform_tag.startswith("linux"):
platform_tag = platform_tag.replace("linux", "manylinux1")
if platform_tag.startswith("macosx"):
print(f"platform: {platform.machine()}")
if platform.machine() == "x86_64":
platform_tag = platform_tag.replace("universal2", "x86_64")
else:
platform_tag = platform_tag.replace("universal2", "arm64")
for f in pathlib.Path(wheel_dir).glob("**/*"):
print("Processing file: {}".format(f.name))
if f.name.endswith("any.whl") or f.name.endswith("universal2.whl"):
if f.name.endswith("any.whl"):
print(f"Fixing wheel {f.name} with new tag {platform_tag}")
tags(str(f.absolute()), None, None, platform_tag, None, True)

Expand Down

0 comments on commit 8a7e8b4

Please sign in to comment.