4
4
'''
5
5
6
6
from os .path import dirname , exists , join
7
+ from shutil import copy2
7
8
from os import environ
8
9
import glob
9
10
import sh
@@ -266,16 +267,19 @@ def create_python_bundle(self, dirn, arch):
266
267
'2' if self .version [0 ] == '2' else '' ,
267
268
self .major_minor_version_string
268
269
))
269
- module_filens = (glob .glob (join (modules_build_dir , '*.so' )) +
270
- glob .glob (join (modules_build_dir , '*.py' )))
270
+ module_filens = list (glob .glob (join (modules_build_dir , '*.so' )) +
271
+ glob .glob (join (modules_build_dir , '*.py' )))
272
+ info ("Copy {} files into the bundle" .format (len (module_filens )))
271
273
for filen in module_filens :
272
- shprint (sh .cp , filen , modules_dir )
274
+ info (" - copy {}" .format (filen ))
275
+ copy2 (filen , modules_dir )
273
276
274
277
# zip up the standard library
275
278
stdlib_zip = join (dirn , 'stdlib.zip' )
276
279
with current_directory (join (self .get_build_dir (arch .arch ), 'Lib' )):
277
- stdlib_filens = walk_valid_filens (
278
- '.' , self .stdlib_dir_blacklist , self .stdlib_filen_blacklist )
280
+ stdlib_filens = list (walk_valid_filens (
281
+ '.' , self .stdlib_dir_blacklist , self .stdlib_filen_blacklist ))
282
+ info ("Zip {} files into the bundle" .format (len (stdlib_filens )))
279
283
shprint (sh .zip , stdlib_zip , * stdlib_filens )
280
284
281
285
# copy the site-packages into place
@@ -286,9 +290,11 @@ def create_python_bundle(self, dirn, arch):
286
290
filens = list (walk_valid_filens (
287
291
'.' , self .site_packages_dir_blacklist ,
288
292
self .site_packages_filen_blacklist ))
293
+ info ("Copy {} files into the site-packages" .format (len (filens )))
289
294
for filen in filens :
295
+ info (" - copy {}" .format (filen ))
290
296
ensure_dir (join (dirn , 'site-packages' , dirname (filen )))
291
- sh . cp (filen , join (dirn , 'site-packages' , filen ))
297
+ copy2 (filen , join (dirn , 'site-packages' , filen ))
292
298
293
299
# copy the python .so files into place
294
300
python_build_dir = join (self .get_build_dir (arch .arch ),
0 commit comments