Skip to content

Commit 85f7789

Browse files
author
Robert Pfeiffer
committed
Merge branch 'adding-more-assets' into develop
2 parents 6a1fdcc + bcee016 commit 85f7789

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+880
-523
lines changed

.deepsource.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version = 1
2+
3+
test_patterns = ["tests/**"]
4+
5+
exclude_patterns = ["testapps/**"]
6+
7+
[[analyzers]]
8+
name = "python"
9+
enabled = true
10+
11+
[analyzers.meta]
12+
runtime_version = "3.x.x"

.github/workflows/push.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ jobs:
5252
steps:
5353
- name: Checkout python-for-android
5454
uses: actions/checkout@v2
55+
# helps with GitHub runner getting out of space
56+
- name: Free disk space
57+
run: |
58+
df -h
59+
sudo swapoff -a
60+
sudo rm -f /swapfile
61+
sudo apt -y clean
62+
docker rmi $(docker image ls -aq)
63+
df -h
5564
- name: Pull docker image
5665
run: |
5766
make docker/pull
@@ -75,6 +84,15 @@ jobs:
7584
uses: actions/checkout@v2
7685
with:
7786
ref: 'develop'
87+
# helps with GitHub runner getting out of space
88+
- name: Free disk space
89+
run: |
90+
df -h
91+
sudo swapoff -a
92+
sudo rm -f /swapfile
93+
sudo apt -y clean
94+
docker rmi $(docker image ls -aq)
95+
df -h
7896
- name: Pull docker image
7997
run: |
8098
make docker/pull

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ python_for_android.egg-info
1818
/build/
1919
doc/build
2020
__pycache__/
21+
venv/
2122

2223
#idea/pycharm
2324
.idea/

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ jobs:
2323
# See also: https://github.com/travis-ci/travis-ci/issues/8589
2424
- type -t deactivate && deactivate || true
2525
- export PATH=/opt/python/3.7/bin:$PATH
26-
# Install tox & virtualenv
27-
# Note: venv/virtualenv are both used by tests/test_pythonpackage.py
28-
- pip3.7 install -U virtualenv
26+
# Install tox
2927
- pip3.7 install tox>=2.0
3028
# Install coveralls & dependencies
3129
# Note: pyOpenSSL needed to send the coveralls reports
@@ -54,7 +52,19 @@ jobs:
5452
# installs java 1.8, android's SDK/NDK and p4a
5553
- make -f ci/makefiles/osx.mk
5654
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
57-
script: make testapps/armeabi-v7a PYTHON_WITH_VERSION=python3
55+
script: make testapps-no-venv/armeabi-v7a
5856
- <<: *testapps
5957
name: Rebuild updated recipes
6058
script: travis_wait 30 make docker/run/make/rebuild_updated_recipes
59+
60+
# Deploy to PyPI using token set in `PYPI_PASSWORD` environment variable
61+
# https://pypi.org/manage/account/token/
62+
# https://travis-ci.org/github/kivy/python-for-android/settings
63+
deploy:
64+
provider: pypi
65+
distributions: sdist bdist_wheel
66+
user: "__token__"
67+
on:
68+
tags: true
69+
repo: kivy/python-for-android
70+
python: 3.7

Dockerfile.py3 renamed to Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# - python-for-android dependencies
44
#
55
# Build with:
6-
# docker build --tag=p4a --file Dockerfile.py3 .
6+
# docker build --tag=p4a --file Dockerfile .
77
#
88
# Run with:
99
# docker run -it --rm p4a /bin/sh -c '. venv/bin/activate && p4a apk --help'
@@ -66,20 +66,18 @@ RUN dpkg --add-architecture i386 \
6666
libncurses5:i386 \
6767
libpangox-1.0-0:i386 \
6868
libpangoxft-1.0-0:i386 \
69+
libssl-dev \
6970
libstdc++6:i386 \
7071
libtool \
7172
openjdk-8-jdk \
7273
patch \
7374
pkg-config \
74-
python \
75-
python-pip \
7675
python3 \
7776
python3-dev \
7877
python3-pip \
7978
python3-venv \
8079
sudo \
8180
unzip \
82-
virtualenv \
8381
wget \
8482
zip \
8583
zlib1g-dev \
@@ -95,10 +93,6 @@ RUN useradd --create-home --shell /bin/bash ${USER}
9593
RUN usermod -append --groups sudo ${USER}
9694
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
9795

98-
# install cython for python 2 (for python 3 it's inside the venv)
99-
RUN pip2 install --upgrade Cython==0.28.6 \
100-
&& rm -rf ~/.cache/
101-
10296
WORKDIR ${WORK_DIR}
10397
RUN mkdir ${ANDROID_HOME} && chown --recursive ${USER} ${HOME_DIR} ${ANDROID_HOME}
10498
USER ${USER}

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
include LICENSE README.md
3+
include *.toml
34

45
recursive-include doc *
56
prune doc/build

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ANDROID_NDK_HOME ?= $(HOME)/.android/android-ndk
1919
all: virtualenv
2020

2121
$(VIRTUAL_ENV):
22-
virtualenv --python=$(PYTHON_WITH_VERSION) $(VIRTUAL_ENV)
22+
python3 -m venv $(VIRTUAL_ENV)
2323
$(PIP) install Cython==0.28.6
2424
$(PIP) install -e .
2525

@@ -28,7 +28,6 @@ virtualenv: $(VIRTUAL_ENV)
2828
# ignores test_pythonpackage.py since it runs for too long
2929
test:
3030
$(TOX) -- tests/ --ignore tests/test_pythonpackage.py
31-
@if test -n "$$CI"; then .tox/py$(PYTHON_MAJOR_MINOR)/bin/coveralls; fi; \
3231

3332
rebuild_updated_recipes: virtualenv
3433
. $(ACTIVATE) && \
@@ -48,6 +47,14 @@ testapps/%: virtualenv
4847
python setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
4948
--arch=$($@_APP_ARCH)
5049

50+
testapps-no-venv/%:
51+
pip3 install Cython==0.28.6
52+
pip3 install -e .
53+
$(eval $@_APP_ARCH := $(shell basename $*))
54+
cd testapps/on_device_unit_tests/ && \
55+
python3 setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
56+
--arch=$($@_APP_ARCH)
57+
5158
clean:
5259
find . -type d -name "__pycache__" -exec rm -r {} +
5360
find . -type d -name "*.egg-info" -exec rm -r {} +
@@ -59,7 +66,7 @@ docker/pull:
5966
docker pull $(DOCKER_IMAGE):latest || true
6067

6168
docker/build:
62-
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) --file=Dockerfile.py3 .
69+
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) .
6370

6471
docker/push:
6572
docker push $(DOCKER_IMAGE)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ python-for-android
22
==================
33

44
[![Build Status](https://travis-ci.org/kivy/python-for-android.svg?branch=develop)](https://travis-ci.org/kivy/python-for-android)
5+
[![Unit tests & build apps](https://github.com/kivy/python-for-android/workflows/Unit%20tests%20&%20build%20apps/badge.svg?branch=develop)](https://github.com/kivy/python-for-android/actions?query=workflow%3A%22Unit+tests+%26+build+apps%22)
56
[![Coverage Status](https://coveralls.io/repos/github/kivy/python-for-android/badge.svg?branch=develop&kill_cache=1)](https://coveralls.io/github/kivy/python-for-android?branch=develop)
67
[![Backers on Open Collective](https://opencollective.com/kivy/backers/badge.svg)](#backers)
78
[![Sponsors on Open Collective](https://opencollective.com/kivy/sponsors/badge.svg)](#sponsors)

doc/source/testing_pull_requests.rst

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,28 @@ Fetch the pull request by number
4343
For the example, we will use `1901` for the example) and the pull request
4444
branch that we will use is `feature-fix-numpy`, then you will use a variation
4545
of the following git command:
46-
`git fetch origin pull/<#>/head:<local_branch_name>`, eg.::
46+
`git fetch origin pull/<#>/head:<local_branch_name>`, e.g.:
4747

48-
.. codeblock:: bash
48+
.. code-block:: bash
4949
50-
git fetch upstream pull/1901/head:feature-fix-numpy
50+
git fetch upstream pull/1901/head:feature-fix-numpy
5151
5252
.. note:: Notice that we fetch from `upstream`, since that is the original
5353
project, where the pull request is supposed to be
5454

5555
.. tip:: The amount of work of some users maybe worth it to add his remote
5656
to your fork's git configuration, to do so with the imaginary
5757
github user `Obi-Wan Kenobi` which nickname is `obiwankenobi`, you
58-
will do::
58+
will do:
5959

60-
.. codeblock:: bash
60+
.. code-block:: bash
6161
6262
git remote add obiwankenobi https://github.com/obiwankenobi/python-for-android.git
6363
6464
And to fetch the pull request branch that we put as example, you
65-
would do::
65+
would do:
6666

67-
.. codeblock:: bash
67+
.. code-block:: bash
6868
6969
git fetch obiwankenobi
7070
git checkout obiwankenobi/feature-fix-numpy
@@ -74,9 +74,9 @@ Clone the pull request branch from the user's fork
7474
--------------------------------------------------
7575
Sometimes you may prefer to use directly the fork of the user, so you will get
7676
the nickname of the user who created the pull request, let's take the same
77-
imaginary user than before `obiwankenobi`::
77+
imaginary user than before `obiwankenobi`:
7878

79-
.. codeblock:: bash
79+
.. code-block:: bash
8080
8181
git clone -b feature-fix-numpy \
8282
--single-branch \
@@ -103,25 +103,25 @@ Using python-for-android commands directly from the pull request files
103103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104104

105105
- Enter inside the directory of the cloned repository in the above
106-
step and run p4a command with proper args, eg (to test an modified
107-
`pycryptodome` recipe)::
108-
109-
.. codeblock:: bash
110-
111-
cd p4a-feature-fix-numpy
112-
PYTHONPATH=. python3 -m pythonforandroid.toolchain apk \
113-
--private=testapps/on_device_unit_tests/test_app \
114-
--dist-name=dist_unit_tests_app_pycryptodome \
115-
--package=org.kivy \
116-
--name=unit_tests_app_pycryptodome \
117-
--version=0.1 \
118-
--requirements=sdl2,pyjnius,kivy,python3,pycryptodome \
119-
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
120-
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
121-
--android-api=27 \
122-
--arch=arm64-v8a \
123-
--permission=VIBRATE \
124-
--debug
106+
step and run p4a command with proper args, e.g. (to test an modified
107+
`pycryptodome` recipe)
108+
109+
.. code-block:: bash
110+
111+
cd p4a-feature-fix-numpy
112+
PYTHONPATH=. python3 -m pythonforandroid.toolchain apk \
113+
--private=testapps/on_device_unit_tests/test_app \
114+
--dist-name=dist_unit_tests_app_pycryptodome \
115+
--package=org.kivy \
116+
--name=unit_tests_app_pycryptodome \
117+
--version=0.1 \
118+
--requirements=sdl2,pyjnius,kivy,python3,pycryptodome \
119+
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
120+
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
121+
--android-api=27 \
122+
--arch=arm64-v8a \
123+
--permission=VIBRATE \
124+
--debug
125125
126126
Things that you should know:
127127

@@ -153,31 +153,31 @@ Installing python-for-android using the github's branch of the pull request
153153
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154154

155155
- Enter inside the directory of the cloned repository mentioned in
156-
`Common steps` and install it via pip, eg.::
156+
`Common steps` and install it via pip, e.g.:
157157

158-
.. codeblock:: bash
158+
.. code-block:: bash
159159
160-
cd p4a-feature-fix-numpy
161-
pip3 install . --upgrade --user
160+
cd p4a-feature-fix-numpy
161+
pip3 install . --upgrade --user
162162
163163
- Now, go inside the `testapps/on_device_unit_tests` directory (we assume that
164-
you still are inside the cloned repository)::
164+
you still are inside the cloned repository)
165165

166-
.. codeblock:: bash
166+
.. code-block:: bash
167167
168-
cd testapps/on_device_unit_tests
168+
cd testapps/on_device_unit_tests
169169
170170
- Run the build of the apk via the freshly installed copy of python-for-android
171-
by running a similar command than below::
171+
by running a similar command than below
172172

173-
.. code-block:: bash
173+
.. code-block:: bash
174174
175-
python3 setup.py apk \
176-
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
177-
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
178-
--android-api=27 \
179-
--arch=arm64-v8a \
180-
--debug
175+
python3 setup.py apk \
176+
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
177+
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
178+
--android-api=27 \
179+
--arch=arm64-v8a \
180+
--debug
181181
182182
183183
Things that you should know:
@@ -207,7 +207,7 @@ Using buildozer with a custom app
207207

208208
p4a.source_dir = /home/user/p4a_pull_requests/p4a-feature-fix-numpy
209209

210-
- Run you buildozer command as usual, eg.::
210+
- Run you buildozer command as usual, e.g.::
211211

212212
buildozer android debug p4a --dist-name=dist-test-feature-fix-numpy
213213

@@ -223,4 +223,4 @@ Using buildozer with a custom app
223223
.. tip:: this method it's useful for developing pull requests since you can
224224
edit `p4a.source_dir` to point to your python-for-android fork and you
225225
can test any branch you want only switching branches with:
226-
`git checkout <branch-name>` from inside your python-for-android fork
226+
`git checkout <branch-name>` from inside your python-for-android fork

pythonforandroid/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2019.10.06.post0'
1+
__version__ = '2020.03.30'

0 commit comments

Comments
 (0)