8000 [CORE FIX/ENHANCEMENT] Speedup copy that can be very very long (up to 2 minutes) by opacam · Pull Request #1585 · kivy/python-for-android · GitHub
[go: up one dir, main page]

Skip to content

[CORE FIX/ENHANCEMENT] Speedup copy that can be very very long (up to 2 minutes) #1585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions pythonforandroid/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'''

from os.path import dirname, exists, join
from shutil import copy2
from os import environ
import glob
import sh
Expand Down Expand Up @@ -266,16 +267,19 @@ def create_python_bundle(self, dirn, arch):
'2' if self.version[0] == '2' else '',
self.major_minor_version_string
))
module_filens = (glob.glob(join(modules_build_dir, '*.so')) +
glob.glob(join(modules_build_dir, '*.py')))
module_filens = list(glob.glob(join(modules_build_dir, '*.so')) +
glob.glob(join(modules_build_dir, '*.py')))
info("Copy {} files into the bundle".format(len(module_filens)))
for filen in module_filens:
shprint(sh.cp, filen, modules_dir)
info(" - copy {}".format(filen))
copy2(filen, modules_dir)

# zip up the standard library
stdlib_zip = join(dirn, 'stdlib.zip')
with current_directory(join(self.get_build_dir(arch.arch), 'Lib')):
stdlib_filens = walk_valid_filens(
'.', self.stdlib_dir_blacklist, self.stdlib_filen_blacklist)
stdlib_filens = list(walk_valid_filens(
'.', self.stdlib_dir_blacklist, self.stdlib_filen_blacklist))
info("Zip {} files into the bundle".format(len(stdlib_filens)))
shprint(sh.zip, stdlib_zip, *stdlib_filens)

# copy the site-packages into place
Expand All @@ -286,9 +290,11 @@ def create_python_bundle(self, dirn, arch):
filens = list(walk_valid_filens(
'.', self.site_packages_dir_blacklist,
self.site_packages_filen_blacklist))
info("Copy {} files into the site-packages".format(len(filens)))
for filen in filens:
info(" - copy {}".format(filen))
ensure_dir(join(dirn, 'site-packages', dirname(filen)))
sh.cp(filen, join(dirn, 'site-packages', filen))
copy2(filen, join(dirn, 'site-packages', filen))

# copy the python .so files into place
python_build_dir = join(self.get_build_dir(arch.arch),
Expand Down
0