7
7
import tempfile
8
8
from pathlib import Path
9
9
10
- from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
11
-
12
10
13
11
def main ():
14
12
if sys .platform .startswith ("linux" ):
@@ -55,9 +53,10 @@ def main():
55
53
assert len (files ) == 1 , files
56
54
file = files [0 ]
57
55
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 = []
60
58
if os_ == "macos" :
59
+ additional_platforms = []
61
60
# first, get the target macOS deployment target from the wheel
62
61
match = re .match (r"^.*-macosx_(\d+)_(\d+)_.*\.whl$" , file .name )
63
62
assert match is not None , f"Couldn't match on { file .name } "
@@ -78,13 +77,18 @@ def main():
78
77
# They're were also issues with pip not picking up some universal2 wheels, tag twice
79
78
additional_platforms .append ("macosx_11_0_universal2" )
80
79
80
+ platform_tag_args = ["--platform-tag" , f".{ '.' .join (additional_platforms )} " ]
81
+
81
82
# 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 ,
87
87
)
88
+ files = list (tmpdir .glob ("*.whl" ))
89
+ assert len (files ) == 1 , files
90
+ file = files [0 ]
91
+ file .rename (wheelhouse / file .name )
88
92
89
93
90
94
if __name__ == "__main__" :
0 commit comments