Skip to content

Commit 4559a86

Browse files
committed
Try wheel cli
Try using pypa/wheel#422
1 parent 70e37a4 commit 4559a86

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
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 & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import tempfile
88
from pathlib import Path
99

10-
from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
11-
1210

1311
def main():
1412
if sys.platform.startswith("linux"):
@@ -55,9 +53,10 @@ def main():
5553
assert len(files) == 1, files
5654
file = files[0]
5755

58-
# we need to handle macOS x86_64 & arm64 here for now, let's use additional_platforms for this.
59-
additional_platforms = []
56+
# we need to handle macOS x86_64 & arm64 here for now, let's use platform_tag_args for this.
57+
platform_tag_args = []
6058
if os_ == "macos":
59+
additional_platforms = []
6160
# first, get the target macOS deployment target from the wheel
6261
match = re.match(r"^.*-macosx_(\d+)_(\d+)_.*\.whl$", file.name)
6362
assert match is not None, f"Couldn't match on {file.name}"
@@ -78,13 +77,18 @@ def main():
7877
# They're were also issues with pip not picking up some universal2 wheels, tag twice
7978
additional_platforms.append("macosx_11_0_universal2")
8079

80+
platform_tag_args = ["--platform-tag", f".{'.'.join(additional_platforms)}"]
81+
8182
# make this a py2.py3 wheel
82-
convert_to_generic_platform_wheel(
83-
str(file),
84-
out_dir=str(wheelhouse),
85-
py2_py3=True,
86-
additional_platforms=additional_platforms,
83+
subprocess.run(
84+
["wheel", "tags", "--python-tag", "py2.py3", "--abi-tag", "none", *platform_tag_args, "--remove", str(file)],
85+
check=True,
86+
stdout=subprocess.PIPE,
8787
)
88+
files = list(tmpdir.glob("*.whl"))
89+
assert len(files) == 1, files
90+
file = files[0]
91+
file.rename(wheelhouse / file.name)
8892

8993

9094
if __name__ == "__main__":

0 commit comments

Comments
 (0)