Skip to content

Commit 40a1983

Browse files
committed
🔥 Remove make_python_zip
Because we don't use it anymore. We used to package `python2` but our `python3` was never zipped with that function, so there is no point to maintain it now that we get rid of python2.
1 parent fdfe0f0 commit 40a1983

File tree

1 file changed

+0
-47
lines changed
  • pythonforandroid/bootstraps/common/build

1 file changed

+0
-47
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import tarfile
1717
import tempfile
1818
import time
19-
from zipfile import ZipFile
2019

2120
from distutils.version import LooseVersion
2221
from fnmatch import fnmatch
@@ -152,48 +151,6 @@ def listfiles(d):
152151
yield fn
153152

154153

155-
def make_python_zip():
156-
'''
157-
Search for all the python related files, and construct the pythonXX.zip
158-
According to
159-
# http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html
160-
site-packages, config and lib-dynload will be not included.
161-
'''
162-
163-
if not exists('private'):
164-
print('No compiled python is present to zip, skipping.')
165-
return
166-
167-
global python_files
168-
d = realpath(join('private', 'lib', 'python2.7'))
169-
170-
def select(fn):
171-
if is_blacklist(fn):
172-
return False
173-
fn = realpath(fn)
174-
assert(fn.startswith(d))
175-
fn = fn[len(d):]
176-
if (fn.startswith('/site-packages/')
177-
or fn.startswith('/config/')
178-
or fn.startswith('/lib-dynload/')
179-
or fn.startswith('/libpymodules.so')):
180-
return False
181-
return fn
182-
183-
# get a list of all python file
184-
python_files = [x for x in listfiles(d) if select(x)]
185-
186-
# create the final zipfile
187-
zfn = join('private', 'lib', 'python27.zip')
188-
zf = ZipFile(zfn, 'w')
189-
190-
# put all the python files in it
191-
for fn in python_files:
192-
afn = fn[len(d):]
193-
zf.write(fn, afn)
194-
zf.close()
195-
196-
197154
def make_tar(tfn, source_dirs, ignore_path=[], optimize_python=True):
198155
'''
199156
Make a zip file `fn` from the contents of source_dis.
@@ -288,10 +245,6 @@ def make_package(args):
288245
try_unlink(join(assets_dir, 'private.mp3'))
289246
ensure_dir(assets_dir)
290247

291-
# In order to speedup import and initial depack,
292-
# construct a python27.zip
293-
make_python_zip()
294-
295248
# Add extra environment variable file into tar-able directory:
296249
env_vars_tarpath = tempfile.mkdtemp(prefix="p4a-extra-env-")
297250
with open(os.path.join(env_vars_tarpath, "p4a_env_vars.txt"), "w") as f:

0 commit comments

Comments
 (0)