1- import os
21import pathlib
32import subprocess
43import shlex
54import shutil
65import sys
76import tempfile
8- import textwrap
97import typing as T
108
119from packaging .requirements import Requirement
@@ -45,14 +43,9 @@ def is_meson_project(self) -> bool:
4543 # Tasks
4644 #
4745
48- def _cmd (self , * args : str , cwd = None , env = None ):
46+ def _cmd (self , * args : str , cwd = None ):
4947 print ("+" , shlex .join (args ))
50- if env :
51- envc = os .environ .copy ()
52- envc .update (env )
53- env = envc
54-
55- subprocess .check_call (args , cwd = cwd , env = env )
48+ subprocess .check_call (args , cwd = cwd )
5649
5750 def _run_pip (self , * args : str , cwd = None ):
5851 self ._cmd (
@@ -126,8 +119,6 @@ def build_wheel(
126119 # TODO: eventually it would be nice to use build isolation
127120
128121 with tempfile .TemporaryDirectory () as td :
129- tdp = pathlib .Path (td )
130-
131122 # I wonder if we should use hatch build instead?
132123 self ._cmd (
133124 sys .executable ,
@@ -140,39 +131,9 @@ def build_wheel(
140131 cwd = self .path ,
141132 )
142133
143- # On macOS we need to build two wheels and merge them together to build
144- # a universal wheel. Fun?
145- # - Since this script is for CI, we assume that we are building on arm64
146- if sys .platform == "darwin" and self .is_meson_project ():
147-
148- self ._cmd (
149- sys .executable ,
150- "-m" ,
151- "build" ,
152- "--no-isolation" ,
153- "--outdir" ,
154- td ,
155- * config_args ,
156- cwd = self .path ,
157- env = dict (ARCHFLAGS = "-arch x86_64" , SEMIWRAP_SKIP_PYI = "1" ),
158- )
159-
160- native_wheels = list (map (str , tdp .glob ("*.whl" )))
161-
162- self ._cmd (
163- sys .executable ,
164- "-m" ,
165- "delocate.cmd.delocate_merge" ,
166- "-vv" ,
167- * native_wheels ,
168- )
169-
170- twhl = (set (map (str , tdp .glob ("*.whl" ))) - set (native_wheels )).pop ()
171- dst_whl = wheel_path / pathlib .Path (twhl ).name
172- else :
173- twhl = list (tdp .glob ("*.whl" ))[0 ]
174- dst_whl = wheel_path / self ._fix_wheel_name (twhl .name )
175-
134+ tdp = pathlib .Path (td )
135+ twhl = list (tdp .glob ("*.whl" ))[0 ]
136+ dst_whl = wheel_path / self ._fix_wheel_name (twhl .name )
176137 shutil .move (twhl , dst_whl )
177138
178139 if install :
0 commit comments