Skip to content

Commit 688d1d7

Browse files
committed
Try wheel cli
Try using pypa/wheel#422
1 parent 450d8bb commit 688d1d7

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

requirements-repair.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+https://github.com/jcfr/wheeltools.git@wheeltools-2018-10-28-a2f174d0e
1+
git+https://github.com/henryiii/wheel.git@deb2a78012b41bb3a9ebdef9e139261d62ce6be5

scripts/repair_wheel.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import zipfile
99
from pathlib import Path
1010

11-
from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
12-
1311

1412
def main():
1513
if sys.platform.startswith("linux"):
@@ -56,8 +54,8 @@ def main():
5654
assert len(files) == 1, files
5755
file = files[0]
5856

59-
# we need to handle macOS x86_64 & arm64 here for now, let's use additional_platforms for this.
60-
additional_platforms = []
57+
# we need to handle macOS x86_64 & arm64 here for now, let's use platform_tag_args for this.
58+
platform_tag_args = []
6159
if os_ == "macos":
6260
# delocate-wheel --require-archs does not seem to check executables...
6361
with tempfile.TemporaryDirectory() as tmpdir2_:
@@ -67,7 +65,7 @@ def main():
6765
exe = list(tmpdir2.glob("**/bin/ninja"))
6866
assert len(exe) == 1, exe
6967
subprocess.run(["lipo", str(exe[0]), "-verify_arch", "x86_64", "arm64"], check=True, stdout=subprocess.PIPE)
70-
68+
additional_platforms = []
7169
# first, get the target macOS deployment target from the wheel
7270
match = re.match(r"^.*-macosx_(\d+)_(\d+)_.*\.whl$", file.name)
7371
assert match is not None, f"Couldn't match on {file.name}"
@@ -88,13 +86,18 @@ def main():
8886
# They're were also issues with pip not picking up some universal2 wheels, tag twice
8987
additional_platforms.append("macosx_11_0_universal2")
9088

89+
platform_tag_args = ["--platform-tag", f".{'.'.join(additional_platforms)}"]
90+
9191
# make this a py2.py3 wheel
92-
convert_to_generic_platform_wheel(
93-
str(file),
94-
out_dir=str(wheelhouse),
95-
py2_py3=True,
96-
additional_platforms=additional_platforms,
92+
subprocess.run(
93+
["wheel", "tags", "--python-tag", "py2.py3", "--abi-tag", "none", *platform_tag_args, "--remove", str(file)],
94+
check=True,
95+
stdout=subprocess.PIPE,
9796
)
97+
files = list(tmpdir.glob("*.whl"))
98+
assert len(files) == 1, files
99+
file = files[0]
100+
file.rename(wheelhouse / file.name)
98101

99102

100103
if __name__ == "__main__":

0 commit comments

Comments
 (0)