Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit ac88d89

Browse files
committed
Merge remote-tracking branch 'origin/dev' into 3.7
2 parents 6e8e1b2 + 56d4944 commit ac88d89

File tree

5 files changed

+79
-4
lines changed

5 files changed

+79
-4
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
22
dist
33
.git
4-
.github
4+
.github
5+
tmp

3.7.Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,12 @@ RUN cd rubicon-java-${RUBICON_JAVA_VERSION} && \
198198
RUN mv rubicon-java-${RUBICON_JAVA_VERSION}/build/librubicon.so $JNI_LIBS
199199
RUN mkdir -p /opt/python-build/app/libs/ && mv rubicon-java-${RUBICON_JAVA_VERSION}/build/rubicon.jar $APPROOT/app/libs/
200200

201-
# Create output artifacts.
201+
# Create rubicon.zip and pythonhome.zip for this CPU architecture, filtering
202+
# pythonhome.zip using pythonhome-excludes to remove the CPython test suite, etc.
202203
ENV ASSETS_DIR $APPROOT/app/src/main/assets/
203204
ARG COMPRESS_LEVEL
204-
RUN mkdir -p "$ASSETS_DIR" && cd "$PYTHON_INSTALL_DIR" && zip -$COMPRESS_LEVEL -q "$ASSETS_DIR"/pythonhome.${TARGET_ABI_SHORTNAME}.zip -r .
205+
ADD 3.7.pythonhome-excludes /opt/python-build/
206+
RUN mkdir -p "$ASSETS_DIR" && cd "$PYTHON_INSTALL_DIR" && zip -x@/opt/python-build/3.7.pythonhome-excludes -$COMPRESS_LEVEL -q "$ASSETS_DIR"/pythonhome.${TARGET_ABI_SHORTNAME}.zip -r .
205207
RUN cd rubicon-java-${RUBICON_JAVA_VERSION} && zip -$COMPRESS_LEVEL -q "$ASSETS_DIR"/rubicon.zip -r rubicon
206208

207209
RUN apt-get update -qq && apt-get -qq install rsync

3.7.excludes

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# You can add patterns to this file to remove them
2+
# from the Python-Android-support.zip file. Note that
3+
# if you are removing files from the Python standard library,
4+
# you need to use the 3.7.pythonhome-excludes file.
5+
#
6+
# Examples:
7+
#
8+
# libs/*/libssl*
9+
# libs/*/libcrypto*
10+
#
11+
# These lines would remove OpenSSL. The libs/ directory contains
12+
# JNI libraries for the Android app. The first asterisk is needed
13+
# to match the pattern in all Android ABIs. The second asterisk
14+
# is present for convenience, to avoid having to specify the full
15+
# OpenSSL library name.
16+
#
17+
# libs/*/*xz*
18+
#
19+
# This line would remove the "xz" compression library. This might
20+
# be appropriate if you don't use that compression format in your
21+
# code.

3.7.pythonhome-excludes

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This is a list of Python standard library path patterns
2+
# we exclude from the Python-Android-support ZIP file. It is
3+
# used by `zip -i@this_file` in `Dockerfile` to filter the pythonhome.zip
4+
# we generate for each Android ABI.
5+
#
6+
# Remove standard library test suites.
7+
lib/python*/ctypes/test/*
8+
lib/python*/distutils/tests/*
9+
lib/python*/lib2to3/tests/*
10+
lib/python*/sqlite3/test/*
11+
lib/python*/test/*
12+
# Remove compiled test and example modules.
13+
lib/python*/lib-dynload/_test*.so
14+
lib/python*/lib-dynload/_ctypes_test*.so
15+
lib/python*/lib-dynload/xxlimited*.so
16+
lib/python*/lib-dynload/_xxtestfuzz.so
17+
# Remove wsgiref web app module; it's unusual that mobile apps would
18+
# start a web app server with it.
19+
lib/python*/wsgiref/*
20+
# Remove command-line curses toolkit.
21+
lib/python*/curses/*
22+
# Remove config-* directory, which is used for compiling C extension modules.
23+
lib/python*/config-*
24+
# Remove ensurepip. If user code needs pip, it can add it to
25+
lib/python*/ensurepip/*
26+
# Remove Tcl/Tk GUI code. We don't build against Tcl/Tk at the moment, so this
27+
# will not work.
28+
lib/python*/idlelib/*
29+
lib/python*/tkinter/*
30+
lib/python*/turtle.py
31+
lib/python*/turtledemo/*
32+
# Remove lib/pkgconfig files. These are used for compiling C extension modules.
33+
lib/pkgconfig/*
34+
# Remove site-packages directory. The Android template unpacks user code and
35+
# dependencies to a different path.
36+
lib/python*/site-packages/*
37+
# Remove include/ directory, only useful for compiling C extension modules.
38+
include/*
39+
# Remove bin/ directory, which contains executables like 2to3
40+
# (not useful in the app) and python3, which could possibly be useful,
41+
# except Python-Android-support doesn't support launching Python as a
42+
# subprocess very well at the moment.
43+
bin/*
44+
# Remove share/ directory, which contains user documentation (man pages).
45+
share/*
46+
# Remove libpython.so from the stdlib package. We rely on the libpython.so
47+
# in the JNI libs directory instead.
48+
lib/libpython3*.so
49+
# Remove pyc files. These take up space, but since most stdlib modules are
50+
# never imported by user code, they mostly have no value.
51+
*/*.pyc

3.7.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function main() {
190190
# Make a ZIP file.
191191
fix_permissions
192192
pushd build/3.7/app > /dev/null
193-
zip -r -"${COMPRESS_LEVEL}" "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip" .
193+
zip -x@../../../3.7.excludes -r -"${COMPRESS_LEVEL}" "../../../dist/Python-3.7-Android-support${BUILD_TAG}.zip" .
194194
popd
195195
}
196196

0 commit comments

Comments
 (0)