Skip to content

Commit 227a765

Browse files
authored
Merge pull request #2561 from misl6/release-2022.03.13
Release 2022.03.13
2 parents 17aa3e2 + a6b8715 commit 227a765

File tree

99 files changed

+1112
-544
lines changed

Some content is hidden

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

99 files changed

+1112
-544
lines changed

Diff for: .coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[run]
2+
relative_files = True
23
omit =
34
*test*
45

Diff for: .github/workflows/push.yml

+54-17
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
steps:
1111
- name: Checkout python-for-android
1212
uses: actions/checkout@v2
13-
- name: Set up Python 3.7
14-
uses: actions/setup-python@v2.2.1
13+
- name: Set up Python 3.x
14+
uses: actions/setup-python@v2
1515
with:
16-
python-version: 3.7
16+
python-version: 3.x
1717
- name: Run flake8
1818
run: |
1919
python -m pip install --upgrade pip
@@ -26,29 +26,31 @@ jobs:
2626
runs-on: ${{ matrix.os }}
2727
strategy:
2828
matrix:
29-
python-version: [3.6, 3.7]
29+
python-version: ['3.7', '3.8', '3.9', '3.10']
3030
os: [ubuntu-latest, macOs-latest]
3131
steps:
3232
- name: Checkout python-for-android
3333
uses: actions/checkout@v2
3434
- name: Set up Python ${{ matrix.python-version }}
35-
uses: actions/setup-python@v2.2.1
35+
uses: actions/setup-python@v2
3636
with:
3737
python-version: ${{ matrix.python-version }}
3838
- name: Tox tests
3939
run: |
4040
python -m pip install --upgrade pip
4141
pip install tox>=2.0
4242
make test
43+
- name: Coveralls
44+
uses: AndreMiras/coveralls-python-action@develop
45+
if: ${{ matrix.os == 'ubuntu-latest' }}
46+
with:
47+
parallel: true
48+
flag-name: run-${{ matrix.os }}-${{ matrix.python-version }}
4349

44-
build:
50+
build_apk:
4551
name: Unit test apk
4652
needs: [flake8]
4753
runs-on: ubuntu-latest
48-
strategy:
49-
fail-fast: false
50-
matrix:
51-
build-arch: ['arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86']
5254
steps:
5355
- name: Checkout python-for-android
5456
uses: actions/checkout@v2
@@ -64,26 +66,52 @@ jobs:
6466
- name: Pull docker image
6567
run: |
6668
make docker/pull
67-
- name: Build apk Python 3 ${{ matrix.build-arch }}
69+
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
6870
run: |
6971
mkdir -p apks
70-
make docker/run/make/with-artifact/testapps-with-numpy/${{ matrix.build-arch }}
72+
make docker/run/make/with-artifact/apk/testapps-with-numpy
7173
- uses: actions/upload-artifact@v1
7274
with:
73-
name: bdist_test_app_unittests__${{ matrix.build-arch }}-debug-1.1.apk
75+
name: bdist_unit_tests_app-debug-1.1-.apk
7476
path: apks
7577

78+
build_aab:
79+
name: Unit test aab
80+
needs: [flake8]
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Checkout python-for-android
84+
uses: actions/checkout@v2
85+
# helps with GitHub runner getting out of space
86+
- name: Free disk space
87+
run: |
88+
df -h
89+
sudo swapoff -a
90+
sudo rm -f /swapfile
91+
sudo apt -y clean
92+
docker rmi $(docker image ls -aq)
93+
df -h
94+
- name: Pull docker image
95+
run: |
96+
make docker/pull
97+
- name: Build Android App Bundle Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
98+
run: |
99+
mkdir -p aabs
100+
make docker/run/make/with-artifact/aab/testapps-with-numpy-aab
101+
- uses: actions/upload-artifact@v1
102+
with:
103+
name: bdist_unit_tests_app-release-1.1-.aab
104+
path: aabs
105+
76106
rebuild_updated_recipes:
77107
name: Test updated recipes
78108
needs: [flake8]
79109
runs-on: ubuntu-latest
80110
steps:
81-
- name: Checkout python-for-android (current branch)
82-
uses: actions/checkout@v2
83-
- name: Checkout python-for-android (develop branch)
111+
- name: Checkout python-for-android
84112
uses: actions/checkout@v2
85113
with:
86-
ref: 'develop'
114+
fetch-depth: 0
87115
# helps with GitHub runner getting out of space
88116
- name: Free disk space
89117
run: |
@@ -99,3 +127,12 @@ jobs:
99127
- name: Rebuild updated recipes
100128
run: |
101129
make docker/run/make/rebuild_updated_recipes
130+
131+
coveralls_finish:
132+
needs: test
133+
runs-on: ubuntu-latest
134+
steps:
135+
- name: Coveralls Finished
136+
uses: AndreMiras/coveralls-python-action@develop
137+
with:
138+
parallel-finished: true

Diff for: .github/workflows/support.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Support Requests'
2+
3+
on:
4+
issues:
5+
types: [labeled, unlabeled, reopened]
6+
7+
permissions:
8+
issues: write
9+
10+
jobs:
11+
action:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: dessant/support-requests@v2
15+
with:
16+
github-token: ${{ github.token }}
17+
support-label: 'support'
18+
issue-comment: >
19+
👋 We use the issue tracker exclusively for bug reports and feature requests.
20+
However, this issue appears to be a support request. Please use our
21+
[support channels](https://github.com/kivy/python-for-android/blob/master/README.md#support)
22+
to get help with the project.
23+
24+
25+
If you're having trouble installing or using python-for-android,
26+
maybe you could be interested in our [quickstart](https://python-for-android.readthedocs.io/en/latest/quickstart) guide.
27+
28+
29+
Let us know if this comment was made in error, and we'll be happy
30+
to reopen the issue.
31+
close-issue: true
32+
lock-issue: false

Diff for: CHANGELOG.md

+61
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
11
# Changelog
22

3+
## [v2022.03.13](https://github.com/kivy/python-for-android/tree/v2022.03.13) (2022-03-13)
4+
5+
[Full Changelog](https://github.com/kivy/python-for-android/compare/v2021.09.05...v2022.03.13)
6+
7+
**Closed issues:**
8+
9+
- ModuleNotFoundError: No module named 'msvcrt' [\#2536](https://github.com/kivy/python-for-android/issues/2536)
10+
- Pyarrow module do not working [\#2531](https://github.com/kivy/python-for-android/issues/2531)
11+
- Error when building Android Application with Google modules [\#2530](https://github.com/kivy/python-for-android/issues/2530)
12+
- arm64-v8a \(apk and aab lib\) crashes [\#2524](https://github.com/kivy/python-for-android/issues/2524)
13+
- Python for android [\#2521](https://github.com/kivy/python-for-android/issues/2521)
14+
- ValueError: name is too long [\#2517](https://github.com/kivy/python-for-android/issues/2517)
15+
- With the target API 31, I got an error on Android 12 phone and cannot install it. [\#2511](https://github.com/kivy/python-for-android/issues/2511)
16+
- How to get libnumpy.so & numpy py libs [\#2510](https://github.com/kivy/python-for-android/issues/2510)
17+
- pydantic compiling in Buildozer with 'crypt.h' file not found [\#2507](https://github.com/kivy/python-for-android/issues/2507)
18+
- p4a built x86\_64 library\(psutil, "ELF 64-bit LSB shared object, x86-64"\) for ARM [\#2506](https://github.com/kivy/python-for-android/issues/2506)
19+
- matplotlib's recipe problem [\#2502](https://github.com/kivy/python-for-android/issues/2502)
20+
- cffi's recipe problem in aab generation [\#2501](https://github.com/kivy/python-for-android/issues/2501)
21+
- Pillow's recipe problem in aab generation [\#2497](https://github.com/kivy/python-for-android/issues/2497)
22+
- Python compilation error: LXMLRecipe' object has no attribute 'ndk\_include\_dir' [\#2493](https://github.com/kivy/python-for-android/issues/2493)
23+
- Android App crashing at launch - SDL seems crashing [\#2491](https://github.com/kivy/python-for-android/issues/2491)
24+
- build an android app with ffpyplayer [\#2453](https://github.com/kivy/python-for-android/issues/2453)
25+
- How to change "PythonActivity.java" to load mp4 file on presplash [\#2439](https://github.com/kivy/python-for-android/issues/2439)
26+
- Kivy app krashes on android 10 [\#2434](https://github.com/kivy/python-for-android/issues/2434)
27+
- Kivy app crashing on android after installation, what is the issue here? [\#2433](https://github.com/kivy/python-for-android/issues/2433)
28+
- Build failed [\#2366](https://github.com/kivy/python-for-android/issues/2366)
29+
- Reportlab bitbucket link is not working anymore [\#2310](https://github.com/kivy/python-for-android/issues/2310)
30+
- Need to be able to create App Bundles \(.aab\) files in addition to APK files [\#2084](https://github.com/kivy/python-for-android/issues/2084)
31+
- What exactly is mangling p4a's output with `[lots of missing output]... (and X more)`? [\#1939](https://github.com/kivy/python-for-android/issues/1939)
32+
- Unable to compile. [\#1710](https://github.com/kivy/python-for-android/issues/1710)
33+
34+
**Merged pull requests:**
35+
36+
- Upgrading the flask version to avoid exception at the start of webview application [\#2560](https://github.com/kivy/python-for-android/pull/2560) ([Prashanth-BC](https://github.com/Prashanth-BC))
37+
- add recipe for freetype-py to not include the prebuilt .so for the wr… [\#2558](https://github.com/kivy/python-for-android/pull/2558) ([domedave](https://github.com/domedave))
38+
- Update to Kivy 2.1.0 [\#2557](https://github.com/kivy/python-for-android/pull/2557) ([RobertFlatt](https://github.com/RobertFlatt))
39+
- tflite-runtime recipe [\#2554](https://github.com/kivy/python-for-android/pull/2554) ([RobertFlatt](https://github.com/RobertFlatt))
40+
- Update AndroidManifest.tmpl.xml [\#2551](https://github.com/kivy/python-for-android/pull/2551) ([drahba](https://github.com/drahba))
41+
- Update recipe.py \(\#2544\) [\#2546](https://github.com/kivy/python-for-android/pull/2546) ([misl6](https://github.com/misl6))
42+
- Update python versions matrix on CI [\#2534](https://github.com/kivy/python-for-android/pull/2534) ([misl6](https://github.com/misl6))
43+
- Add ifaddr recipe [\#2527](https://github.com/kivy/python-for-android/pull/2527) ([syrykh](https://github.com/syrykh))
44+
- Remove websocket-client recipe [\#2526](https://github.com/kivy/python-for-android/pull/2526) ([syrykh](https://github.com/syrykh))
45+
- Fix build [\#2525](https://github.com/kivy/python-for-android/pull/2525) ([correa](https://github.com/correa))
46+
- Add aaptOptions noCompress [\#2523](https://github.com/kivy/python-for-android/pull/2523) ([RobertFlatt](https://github.com/RobertFlatt))
47+
- Updated version of pygame from 2.0.1 to 2.1.0 [\#2520](https://github.com/kivy/python-for-android/pull/2520) ([CAPTAIN1947](https://github.com/CAPTAIN1947))
48+
- Bump Pillow version to 8.4.0 [\#2516](https://github.com/kivy/python-for-android/pull/2516) ([misl6](https://github.com/misl6))
49+
- Moved support-request to v2. v1 has been shut down. [\#2515](https://github.com/kivy/python-for-android/pull/2515) ([misl6](https://github.com/misl6))
50+
- Add support-requests configuration. [\#2514](https://github.com/kivy/python-for-android/pull/2514) ([misl6](https://github.com/misl6))
51+
- proper --host for libsecp256k1, libogg, libvorbis, libcurl [\#2512](https://github.com/kivy/python-for-android/pull/2512) ([accumulator](https://github.com/accumulator))
52+
- Fix broken Contribute link [\#2505](https://github.com/kivy/python-for-android/pull/2505) ([daMatz](https://github.com/daMatz))
53+
- Makes pep8 happy on sdl2 recipe [\#2504](https://github.com/kivy/python-for-android/pull/2504) ([misl6](https://github.com/misl6))
54+
- Fix broken recipes with missing arch.arch in get\_site\_packages\_dir [\#2503](https://github.com/kivy/python-for-android/pull/2503) ([misl6](https://github.com/misl6))
55+
- added android permission ACCESS\_BACKGROUND\_LOCATION [\#2500](https://github.com/kivy/python-for-android/pull/2500) ([xloem](https://github.com/xloem))
56+
- GitHub Actions: Fixes wrong actions/checkout@v2 usage [\#2496](https://github.com/kivy/python-for-android/pull/2496) ([misl6](https://github.com/misl6))
57+
- Fixes ndk\_include\_dir on lxml recipe. [\#2495](https://github.com/kivy/python-for-android/pull/2495) ([misl6](https://github.com/misl6))
58+
- Move coveralls to github actions [\#2490](https://github.com/kivy/python-for-android/pull/2490) ([misl6](https://github.com/misl6))
59+
- Master [\#2489](https://github.com/kivy/python-for-android/pull/2489) ([misl6](https://github.com/misl6))
60+
- Add should\_build method to sdl2 recipe [\#2482](https://github.com/kivy/python-for-android/pull/2482) ([AndyRusso](https://github.com/AndyRusso))
61+
- AAB support related changes [\#2467](https://github.com/kivy/python-for-android/pull/2467) ([misl6](https://github.com/misl6))
62+
- services: fix START\_STICKY [\#2401](https://github.com/kivy/python-for-android/pull/2401) ([mzakharo](https://github.com/mzakharo))
63+
364
## [v2021.09.05](https://github.com/kivy/python-for-android/tree/v2021.09.05) (2021-09-05)
465

566
[Full Changelog](https://github.com/kivy/python-for-android/compare/v2020.06.02...v2021.09.05)

Diff for: Makefile

+17-8
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ rebuild_updated_recipes: virtualenv
3434
ANDROID_SDK_HOME=$(ANDROID_SDK_HOME) ANDROID_NDK_HOME=$(ANDROID_NDK_HOME) \
3535
$(PYTHON) ci/rebuild_updated_recipes.py
3636

37-
testapps-with-numpy/%: virtualenv
38-
$(eval $@_APP_ARCH := $(shell basename $*))
37+
testapps-with-numpy: virtualenv
3938
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
4039
python setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
4140
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
42-
--arch=$($@_APP_ARCH)
41+
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86
42+
43+
testapps-with-numpy-aab: virtualenv
44+
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
45+
python setup.py aab --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
46+
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
47+
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86 --release
4348

4449
testapps/%: virtualenv
4550
$(eval $@_APP_ARCH := $(shell basename $*))
@@ -69,14 +74,18 @@ docker/run/test: docker/build
6974
docker/run/command: docker/build
7075
docker run --rm --env-file=.env $(DOCKER_IMAGE) /bin/sh -c "$(COMMAND)"
7176

72-
docker/run/make/%: docker/build
73-
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*
77+
docker/run/make/with-artifact/apk/%: docker/build
78+
docker run --name p4a-latest --env-file=.env $(DOCKER_IMAGE) make $*
79+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app-debug-1.1-.apk ./apks
80+
docker rm -fv p4a-latest
7481

75-
docker/run/make/with-artifact/%: docker/build
76-
$(eval $@_APP_ARCH := $(shell basename $*))
82+
docker/run/make/with-artifact/aab/%: docker/build
7783
docker run --name p4a-latest --env-file=.env $(DOCKER_IMAGE) make $*
78-
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app__$($@_APP_ARCH)-debug-1.1-.apk ./apks
84+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/bdist_unit_tests_app-release-1.1-.aab ./aabs
7985
docker rm -fv p4a-latest
8086

87+
docker/run/make/%: docker/build
88+
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*
89+
8190
docker/run/shell: docker/build
8291
docker run --rm --env-file=.env -it $(DOCKER_IMAGE)

Diff for: README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ python-for-android
88

99
python-for-android is a packaging tool for Python apps on Android. You can
1010
create your own Python distribution including the modules and
11-
dependencies you want, and bundle it in an APK along with your own code.
11+
dependencies you want, and bundle it in an APK or AAB along with your own code.
1212

1313
Features include:
1414

@@ -19,6 +19,7 @@ Features include:
1919
sqlalchemy.
2020
- Multiple architecture targets, for APKs optimised on any given
2121
device.
22+
- AAB: Android App Bundle support.
2223

2324
For documentation and support, see:
2425

@@ -30,7 +31,7 @@ For documentation and support, see:
3031

3132
Follow the [quickstart
3233
instructions](<https://python-for-android.readthedocs.org/en/latest/quickstart/>)
33-
to install and begin creating APKs.
34+
to install and begin creating APKs and AABs.
3435

3536
**Quick instructions**: install python-for-android with:
3637

@@ -52,6 +53,8 @@ With everything installed, build an APK with SDL2 with e.g.:
5253

5354
p4a apk --requirements=kivy --private /home/username/devel/planewave_frozen/ --package=net.inclem.planewavessdl2 --name="planewavessdl2" --version=0.5 --bootstrap=sdl2
5455

56+
**If you need to deploy your app on Google Play, Android App Bundle (aab) is required since 1 August 2021:**
57+
5558
**For full instructions and parameter options,** see [the
5659
documentation](https://python-for-android.readthedocs.io/en/latest/quickstart/#usage).
5760

@@ -67,7 +70,7 @@ We also have [#support Discord channel](https://chat.kivy.org/).
6770
## Contributing
6871

6972
We love pull requests and discussing novel ideas. Check out the Kivy
70-
project [contribution guide](http://kivy.org/docs/contribute.html) and
73+
project [contribution guide](https://kivy.org/doc/stable/contribute.html) and
7174
feel free to improve python-for-android.
7275

7376
See [our
@@ -109,9 +112,12 @@ api level below 21, you should use an older version of python-for-android
109112
On March of 2020 we dropped support for creating apps that use Python 2. The latest
110113
python-for-android release that supported building Python 2 was version 2019.10.6.
111114

115+
On August of 2021, we added support for Android App Bundle (aab). As a collateral,
116+
now We support multi-arch apk.
117+
112118
## Contributors
113119

114-
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
120+
This project exists thanks to all the people who contribute. [[Contribute](https://kivy.org/doc/stable/contribute.html)].
115121
<a href="https://github.com/kivy/python-for-android/graphs/contributors"><img src="https://opencollective.com/kivy/contributors.svg?width=890&button=false" /></a>
116122

117123

Diff for: ci/constants.py

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class TargetPython(Enum):
2828
'vlc',
2929
# need extra gfortran NDK system add-on
3030
'lapack', 'scipy',
31+
# Outdated and there's a chance that is now useless.
32+
'zope_interface',
33+
# Requires zope_interface, which is broken.
34+
'twisted',
3135
])
3236

3337
BROKEN_RECIPES = {

Diff for: doc/source/commands.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ supply those that you need.
7171
Whether the distribution must be compiled from scratch.
7272

7373
``--arch``
74-
The architecture to build for. Currently only one architecture can be
75-
targeted at a time, and a given distribution can only include one architecture.
74+
The architecture to build for. You can specify multiple architectures to build for
75+
at the same time. As an example ``p4a ... --arch arm64-v8a --arch armeabi-v7a ...``
76+
will build a distribution for both ``arm64-v8a`` and ``armeabi-v7a``.
7677

7778
``--bootstrap BOOTSTRAP``
7879
The Java bootstrap to use for your application. You mostly don't

Diff for: doc/source/quickstart.rst

+18
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,24 @@ You can also replace flask with another web framework.
213213
Replace ``--port=5000`` with the port on which your app will serve a
214214
website. The default for Flask is 5000.
215215

216+
Exporting the Android App Bundle (aab) for distributing it on Google Play
217+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218+
219+
Starting from August 2021 for new apps and from November 2021 for updates to existings apps,
220+
Google Play Console will require the Android App Bundle instead of the long lived apk.
221+
222+
python-for-android handles by itself the needed work to accomplish the new requirements:
223+
224+
p4a aab --private $HOME/code/myapp --package=org.example.myapp --name="My App" --version 0.1 --bootstrap=sdl2 --requirements=python3,kivy --arch=arm64-v8a --arch=armeabi-v7a --release
225+
226+
This `p4a aab ...` command builds a distribution with `python3`,
227+
`kivy`, and everything else you specified in the requirements.
228+
It will be packaged using a SDL2 bootstrap, and produce
229+
an `.aab` file that contains binaries for both `armeabi-v7a` and `arm64-v8a` ABIs.
230+
231+
The Android App Bundle, is supposed to be used for distributing your app.
232+
If you need to test it locally, on your device, you can use `bundletool <https://developer.android.com/studio/command-line/bundletool>`
233+
216234
Other options
217235
~~~~~~~~~~~~~
218236

0 commit comments

Comments
 (0)