@@ -161,35 +161,42 @@ def build_wheels(pip):
161161
162162def repair_wheels ():
163163 whls = glob ("*graalpy*.whl" )
164- if sys .platform == "win32" :
165- ensure_installed ("delvewheel" )
166- env = os .environ .copy ()
167- env ["PYTHONUTF8" ] = "1"
168- subprocess .check_call (
169- [
170- sys .executable ,
171- "-m" ,
172- "delvewheel" ,
173- "repair" ,
174- "-v" ,
175- "--exclude" ,
176- "python-native.dll" ,
177- "-w" ,
178- "wheelhouse" ,
179- * whls ,
180- ],
181- env = env ,
182- )
183- elif sys .platform == "linux" :
184- ensure_installed ("auditwheel" )
185- subprocess .check_call (
186- [join (dirname (sys .executable ), "auditwheel" ), "repair" , "-w" , "wheelhouse" , * whls ]
187- )
188- elif sys .platform == "darwin" :
189- ensure_installed ("delocate" )
190- subprocess .check_call (
191- [join (dirname (sys .executable ), "delocate-wheel" ), "-v" , "-w" , "wheelhouse" , * whls ]
192- )
164+ for whl in whls :
165+ if sys .platform == "win32" :
166+ ensure_installed ("delvewheel" )
167+ env = os .environ .copy ()
168+ env ["PYTHONUTF8" ] = "1"
169+ p = subprocess .run (
170+ [
171+ sys .executable ,
172+ "-m" ,
173+ "delvewheel" ,
174+ "repair" ,
175+ "-v" ,
176+ "--exclude" ,
177+ "python-native.dll" ,
178+ "-w" ,
179+ "wheelhouse" ,
180+ whl ,
181+ ],
182+ env = env ,
183+ )
184+ elif sys .platform == "linux" :
185+ ensure_installed ("auditwheel" )
186+ p = subprocess .run (
187+ [join (dirname (sys .executable ), "auditwheel" ), "repair" , "-w" , "wheelhouse" , whl ]
188+ )
189+ elif sys .platform == "darwin" :
190+ ensure_installed ("delocate" )
191+ p = subprocess .run (
192+ [join (dirname (sys .executable ), "delocate-wheel" ), "-v" , "-w" , "wheelhouse" , whl ]
193+ )
194+ if p .returncode != 0 :
195+ print ("Repairing" , whl , "failed, copying as is." )
196+ try :
197+ shutil .copy (whl , "wheelhouse" )
198+ except :
199+ pass
193200
194201
195202if __name__ == "__main__" :
0 commit comments