@@ -286,54 +286,32 @@ RUN mkdir -p "${BUILD_DIR}" && cd "${BUILD_DIR}" \
286286 && ln -sf /opt/android/android-ndk/platforms/android-21/arch-arm/usr/lib/libc.so /opt/android/android-ndk/platforms/android-21/arch-arm/usr/lib/librt.so
287287
288288# Python and user packages
289-
290289ENV USER="user"
291290ENV HOME_DIR="/home/${USER}"
292291ENV WORK_DIR="${HOME_DIR}" \
293292 PATH="${HOME_DIR}/.local/bin:${PATH}"
294293
295- # Install python 3.7 dependencies
296- RUN ${RETRY} apt -y install -qq --no-install-recommends \
297- build-essential zlib1g-dev \
298- libncurses5-dev libgdbm-dev \
299- libnss3-dev libssl-dev \
300- libreadline-dev libffi-dev wget \
301- && apt -y autoremove
302-
303- # Install python 3.7
304- RUN wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz \
305- && tar -xf Python-3.7.3.tar.xz && cd Python-3.7.3 \
306- && ./configure --enable-optimizations \
307- && make -j "${N_JOBS}" \
308- && make altinstall
309-
310- RUN python3.7 --version
311- RUN pip --version
312-
313- # Install virtualenv
314- RUN pip install --upgrade virtualenv
315-
316-
317294# install system dependencies
318295RUN ${RETRY} apt -y install -qq --no-install-recommends \
319- wget lbzip2 patch sudo \
320- && apt -y autoremove
296+ python3 virtualenv python3-pip python3-venv \
297+ wget lbzip2 patch sudo \
298+ && apt -y autoremove
321299
322300# build dependencies
323301# https://buildozer.readthedocs.io/en/latest/installation.html#android-on-ubuntu-16-04-64bit
324302RUN dpkg --add-architecture i386 \
325- && ${RETRY} apt -y update -qq \
326- && ${RETRY} apt -y install -qq --no-install-recommends \
327- build-essential ccache git \
303+ && ${RETRY} apt -y update -qq \
304+ && ${RETRY} apt -y install -qq --no-install-recommends \
305+ build-essential ccache git python3 python3-dev \
328306 libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 \
329- libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 \
330- zip zlib1g-dev zlib1g:i386 \
331- && apt -y autoremove
307+ libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 \
308+ zip zlib1g-dev zlib1g:i386 \
309+ && apt -y autoremove
332310
333311# specific recipes dependencies (e.g. libffi requires autoreconf binary)
334312RUN ${RETRY} apt -y install -qq --no-install-recommends \
335- libffi-dev autoconf automake cmake gettext libltdl-dev libtool pkg-config \
336- && apt -y autoremove \
313+ libffi-dev autoconf automake cmake gettext libltdl-dev libtool pkg-config \
314+ && apt -y autoremove \
337315 && apt -y clean
338316
339317# prepare non root env
@@ -344,8 +322,8 @@ RUN usermod -append --groups sudo ${USER}
344322RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
345323
346324
347- RUN pip install --upgrade --ignore-installed setuptools
348- RUN pip install --upgrade cython==0.28.3
325+ RUN pip3 install --upgrade cython==0.28.3
326+ RUN pip3 install --upgrade --ignore-installed setuptools
349327
350328WORKDIR ${WORK_DIR}
351329COPY --chown=user:user . ${WORK_DIR}
@@ -355,4 +333,5 @@ USER ${USER}
355333# install python-for-android from current branch
356334RUN virtualenv --python=python3 venv \
357335 && . venv/bin/activate \
358- && pip install -e .
336+ && pip3 install --upgrade cython==0.28.3 \
337+ && pip3 install -e .
0 commit comments