@@ -74,7 +74,7 @@ def checkTools():
74
74
def getPackageLinks ():
75
75
compressedReqs = ["pyopengl" , "pysdl2" , "pysidesix-frameless-window" ]
76
76
extensionReqs = ["pyopengl-accelerate" , "pysdl2-dll" , "pillow" , "pyglm" ,
77
- "pyside6" , "shiboken6" , "pyside6-essentials" , "pywin32" ]
77
+ "pyside6" , "shiboken6" , "pyside6-essentials" , "pywin32" ]
78
78
79
79
if parse (VERSION ) < parse ("3.9" ):
80
80
compressedReqs .append ("importlib-metadata" )
@@ -150,8 +150,7 @@ def addPackage(zf, name, path, orig, distInfo=True):
150
150
paths .extend (glob .glob ("*.dist-info\\ **\\ *" , recursive = True ))
151
151
for file in paths :
152
152
if file .endswith (".py" ):
153
- py_compile .compile (file , file + "c" , file ,
154
- doraise = True )
153
+ py_compile .compile (file , file + "c" , file , doraise = True )
155
154
zf .write (file + "c" )
156
155
elif not file .endswith (".pyc" ):
157
156
zf .write (file )
@@ -168,29 +167,29 @@ def getEmbedPackage():
168
167
def getPyUnity ():
169
168
# Do not cache
170
169
url = "https://github.com/pyunity/pyunity/archive/refs/heads/develop.zip"
171
- print ("GET" , url , "-> pyunity.zip" , flush = True )
172
- urllib .request .urlretrieve (url , "pyunity.zip" )
173
- with zipfile .ZipFile ("pyunity.zip" ) as zf :
174
- print ("EXTRACT pyunity.zip" , flush = True )
170
+ print ("GET" , url , "-> pyunity-develop .zip" , flush = True )
171
+ urllib .request .urlretrieve (url , "pyunity-develop .zip" )
172
+ with zipfile .ZipFile ("pyunity-develop .zip" ) as zf :
173
+ print ("EXTRACT pyunity-develop .zip" , flush = True )
175
174
zf .extractall ()
176
175
177
176
def buildSrcPackage (name , directory , outDir ):
178
177
print ("BUILD" , name , flush = True )
179
178
with open (os .path .join (originalFolder , "build.log" ), "a+" ) as log :
180
- subprocess .call ([sys .executable , "-m" , "build" , directory ],
181
- stdout = log , stderr = sys .stderr ,
182
- env = {** os .environ , "cython" : "0" })
179
+ subprocess .check_call ([sys .executable , "-m" , "build" , directory ],
180
+ stdout = log , stderr = sys .stderr ,
181
+ env = {** os .environ , "cython" : "0" })
183
182
shutil .move (glob .glob (directory + "/dist/*.whl" )[0 ], name + ".whl" )
184
183
185
184
with zipfile .ZipFile (name + ".whl" ) as zf :
186
- print ("EXTRACT" , name + ".whl" , flush = True )
185
+ print ("EXTRACT" , name + ".whl" , flush = True )
187
186
zf .extractall (outDir )
188
187
189
188
def getBinaryPackage (name , url ):
190
189
if url .endswith (".tar.gz" ):
191
190
download (url , "..\\ " + name + ".tar.gz" )
192
- subprocess .call ([sys .executable , "-m" , "pip" , "wheel" ,
193
- "--no-deps" , "..\\ " + name + ".tar.gz" ])
191
+ subprocess .check_call ([sys .executable , "-m" , "pip" , "wheel" ,
192
+ "--no-deps" , "..\\ " + name + ".tar.gz" ])
194
193
shutil .move (glob .glob ("*.whl" )[0 ], "..\\ " + name + ".whl" )
195
194
else :
196
195
download (url , "..\\ " + name + ".whl" )
@@ -267,16 +266,16 @@ def copyExeInfoFiles():
267
266
268
267
def compileMsvc ():
269
268
print ("COMPILE icons.o" , flush = True )
270
- subprocess .call ([
269
+ subprocess .check_call ([
271
270
"rc.exe" , "/fo..\\ icons.res" , "..\\ icons.rc"
272
271
], stdout = sys .stdout , stderr = sys .stderr )
273
272
print ("COMPILE version.o" , flush = True )
274
- subprocess .call ([
273
+ subprocess .check_call ([
275
274
"rc.exe" , "/fo..\\ version.res" , "..\\ version.rc"
276
275
], stdout = sys .stdout , stderr = sys .stderr )
277
276
278
277
print ("COMPILE pyunity-editor.exe" , flush = True )
279
- subprocess .call ([
278
+ subprocess .check_call ([
280
279
"cl.exe" , "/nologo" , "/O2" , "/Wall" ,
281
280
"/Tc..\\ pyunity-editor.c" , "/Fo..\\ pyunity-editor.obj" ,
282
281
f"/I{ sys .base_prefix } \\ include" , "/DNOCONSOLE" ,
@@ -288,33 +287,33 @@ def compileMsvc():
288
287
289
288
def compileMinGW ():
290
289
print ("COMPILE icons.o" , flush = True )
291
- subprocess .call ([
290
+ subprocess .check_call ([
292
291
"windres.exe" , "-O" , "coff" ,
293
292
"..\\ icons.rc" , "..\\ icons.o"
294
293
], stdout = sys .stdout , stderr = sys .stderr )
295
294
print ("COMPILE version.o" , flush = True )
296
- subprocess .call ([
295
+ subprocess .check_call ([
297
296
"windres.exe" , "-O" , "coff" ,
298
297
"..\\ version.rc" , "..\\ version.o"
299
298
], stdout = sys .stdout , stderr = sys .stderr )
300
299
301
300
print ("COMPILE pyunity-editor.exe" , flush = True )
302
- subprocess .call ([
301
+ subprocess .check_call ([
303
302
"gcc.exe" , "-O2" , "-Wall" , "-mwindows" , "-DNOCONSOLE" ,
304
303
"-o" , "pyunity-editor.exe" , "..\\ pyunity-editor.c" , "..\\ icons.o" , "..\\ version.o" ,
305
304
"-L." , f"-l{ zipName } " , f"-I{ sys .base_prefix } \\ include" ,
306
305
], stdout = sys .stdout , stderr = sys .stderr )
307
306
308
307
def archiveFolder ():
309
308
print (f"ZIP pyunity-editor.zip" , flush = True )
310
- subprocess .call ([
309
+ subprocess .check_call ([
311
310
"7z.exe" , "a" , "-mx=9" ,
312
311
f"pyunity-editor.zip" , mainFolder
313
312
], stdout = sys .stdout , stderr = sys .stderr )
314
313
shutil .copy (f"pyunity-editor.zip" , originalFolder )
315
314
316
315
print (f"7Z pyunity-editor.7z" , flush = True )
317
- subprocess .call ([
316
+ subprocess .check_call ([
318
317
"7z.exe" , "a" , "-mx=9" ,
319
318
f"pyunity-editor.7z" , mainFolder
320
319
], stdout = sys .stdout , stderr = sys .stderr )
0 commit comments