Skip to content

Commit

Permalink
Merge pull request #2561 from misl6/release-2022.03.13
Browse files Browse the repository at this point in the history
Release 2022.03.13
  • Loading branch information
misl6 authored Mar 13, 2022
2 parents 17aa3e2 + a6b8715 commit 227a765
Show file tree
Hide file tree
Showing 99 changed files with 1,112 additions and 544 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[run]
relative_files = True
omit =
*test*

Expand Down
71 changes: 54 additions & 17 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2.2.1
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.x
- name: Run flake8
run: |
python -m pip install --upgrade pip
Expand All @@ -26,29 +26,31 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7]
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macOs-latest]
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Tox tests
run: |
python -m pip install --upgrade pip
pip install tox>=2.0
make test
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
parallel: true
flag-name: run-${{ matrix.os }}-${{ matrix.python-version }}

build:
build_apk:
name: Unit test apk
needs: [flake8]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build-arch: ['arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86']
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
Expand All @@ -64,26 +66,52 @@ jobs:
- name: Pull docker image
run: |
make docker/pull
- name: Build apk Python 3 ${{ matrix.build-arch }}
- name: Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
run: |
mkdir -p apks
make docker/run/make/with-artifact/testapps-with-numpy/${{ matrix.build-arch }}
make docker/run/make/with-artifact/apk/testapps-with-numpy
- uses: actions/upload-artifact@v1
with:
name: bdist_test_app_unittests__${{ matrix.build-arch }}-debug-1.1.apk
name: bdist_unit_tests_app-debug-1.1-.apk
path: apks

build_aab:
name: Unit test aab
needs: [flake8]
runs-on: ubuntu-latest
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
# helps with GitHub runner getting out of space
- name: Free disk space
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt -y clean
docker rmi $(docker image ls -aq)
df -h
- name: Pull docker image
run: |
make docker/pull
- name: Build Android App Bundle Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
run: |
mkdir -p aabs
make docker/run/make/with-artifact/aab/testapps-with-numpy-aab
- uses: actions/upload-artifact@v1
with:
name: bdist_unit_tests_app-release-1.1-.aab
path: aabs

rebuild_updated_recipes:
name: Test updated recipes
needs: [flake8]
runs-on: ubuntu-latest
steps:
- name: Checkout python-for-android (current branch)
uses: actions/checkout@v2
- name: Checkout python-for-android (develop branch)
- name: Checkout python-for-android
uses: actions/checkout@v2
with:
ref: 'develop'
fetch-depth: 0
# helps with GitHub runner getting out of space
- name: Free disk space
run: |
Expand All @@ -99,3 +127,12 @@ jobs:
- name: Rebuild updated recipes
run: |
make docker/run/make/rebuild_updated_recipes
coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
32 changes: 32 additions & 0 deletions .github/workflows/support.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Support Requests'

on:
issues:
types: [labeled, unlabeled, reopened]

permissions:
issues: write

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/support-requests@v2
with:
github-token: ${{ github.token }}
support-label: 'support'
issue-comment: >
👋 We use the issue tracker exclusively for bug reports and feature requests.
However, this issue appears to be a support request. Please use our
[support channels](https://github.com/kivy/python-for-android/blob/master/README.md#support)
to get help with the project.
If you're having trouble installing or using python-for-android,
maybe you could be interested in our [quickstart](https://python-for-android.readthedocs.io/en/latest/quickstart) guide.
Let us know if this comment was made in error, and we'll be happy
to reopen the issue.
close-issue: true
lock-issue: false
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,66 @@
# Changelog

## [v2022.03.13](https://github.com/kivy/python-for-android/tree/v2022.03.13) (2022-03-13)

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

**Closed issues:**

- ModuleNotFoundError: No module named 'msvcrt' [\#2536](https://github.com/kivy/python-for-android/issues/2536)
- Pyarrow module do not working [\#2531](https://github.com/kivy/python-for-android/issues/2531)
- Error when building Android Application with Google modules [\#2530](https://github.com/kivy/python-for-android/issues/2530)
- arm64-v8a \(apk and aab lib\) crashes [\#2524](https://github.com/kivy/python-for-android/issues/2524)
- Python for android [\#2521](https://github.com/kivy/python-for-android/issues/2521)
- ValueError: name is too long [\#2517](https://github.com/kivy/python-for-android/issues/2517)
- 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)
- How to get libnumpy.so & numpy py libs [\#2510](https://github.com/kivy/python-for-android/issues/2510)
- pydantic compiling in Buildozer with 'crypt.h' file not found [\#2507](https://github.com/kivy/python-for-android/issues/2507)
- 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)
- matplotlib's recipe problem [\#2502](https://github.com/kivy/python-for-android/issues/2502)
- cffi's recipe problem in aab generation [\#2501](https://github.com/kivy/python-for-android/issues/2501)
- Pillow's recipe problem in aab generation [\#2497](https://github.com/kivy/python-for-android/issues/2497)
- Python compilation error: LXMLRecipe' object has no attribute 'ndk\_include\_dir' [\#2493](https://github.com/kivy/python-for-android/issues/2493)
- Android App crashing at launch - SDL seems crashing [\#2491](https://github.com/kivy/python-for-android/issues/2491)
- build an android app with ffpyplayer [\#2453](https://github.com/kivy/python-for-android/issues/2453)
- How to change "PythonActivity.java" to load mp4 file on presplash [\#2439](https://github.com/kivy/python-for-android/issues/2439)
- Kivy app krashes on android 10 [\#2434](https://github.com/kivy/python-for-android/issues/2434)
- Kivy app crashing on android after installation, what is the issue here? [\#2433](https://github.com/kivy/python-for-android/issues/2433)
- Build failed [\#2366](https://github.com/kivy/python-for-android/issues/2366)
- Reportlab bitbucket link is not working anymore [\#2310](https://github.com/kivy/python-for-android/issues/2310)
- 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)
- 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)
- Unable to compile. [\#1710](https://github.com/kivy/python-for-android/issues/1710)

**Merged pull requests:**

- 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))
- 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))
- Update to Kivy 2.1.0 [\#2557](https://github.com/kivy/python-for-android/pull/2557) ([RobertFlatt](https://github.com/RobertFlatt))
- tflite-runtime recipe [\#2554](https://github.com/kivy/python-for-android/pull/2554) ([RobertFlatt](https://github.com/RobertFlatt))
- Update AndroidManifest.tmpl.xml [\#2551](https://github.com/kivy/python-for-android/pull/2551) ([drahba](https://github.com/drahba))
- Update recipe.py \(\#2544\) [\#2546](https://github.com/kivy/python-for-android/pull/2546) ([misl6](https://github.com/misl6))
- Update python versions matrix on CI [\#2534](https://github.com/kivy/python-for-android/pull/2534) ([misl6](https://github.com/misl6))
- Add ifaddr recipe [\#2527](https://github.com/kivy/python-for-android/pull/2527) ([syrykh](https://github.com/syrykh))
- Remove websocket-client recipe [\#2526](https://github.com/kivy/python-for-android/pull/2526) ([syrykh](https://github.com/syrykh))
- Fix build [\#2525](https://github.com/kivy/python-for-android/pull/2525) ([correa](https://github.com/correa))
- Add aaptOptions noCompress [\#2523](https://github.com/kivy/python-for-android/pull/2523) ([RobertFlatt](https://github.com/RobertFlatt))
- 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))
- Bump Pillow version to 8.4.0 [\#2516](https://github.com/kivy/python-for-android/pull/2516) ([misl6](https://github.com/misl6))
- 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))
- Add support-requests configuration. [\#2514](https://github.com/kivy/python-for-android/pull/2514) ([misl6](https://github.com/misl6))
- proper --host for libsecp256k1, libogg, libvorbis, libcurl [\#2512](https://github.com/kivy/python-for-android/pull/2512) ([accumulator](https://github.com/accumulator))
- Fix broken Contribute link [\#2505](https://github.com/kivy/python-for-android/pull/2505) ([daMatz](https://github.com/daMatz))
- Makes pep8 happy on sdl2 recipe [\#2504](https://github.com/kivy/python-for-android/pull/2504) ([misl6](https://github.com/misl6))
- 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))
- added android permission ACCESS\_BACKGROUND\_LOCATION [\#2500](https://github.com/kivy/python-for-android/pull/2500) ([xloem](https://github.com/xloem))
- GitHub Actions: Fixes wrong actions/checkout@v2 usage [\#2496](https://github.com/kivy/python-for-android/pull/2496) ([misl6](https://github.com/misl6))
- Fixes ndk\_include\_dir on lxml recipe. [\#2495](https://github.com/kivy/python-for-android/pull/2495) ([misl6](https://github.com/misl6))
- Move coveralls to github actions [\#2490](https://github.com/kivy/python-for-android/pull/2490) ([misl6](https://github.com/misl6))
- Master [\#2489](https://github.com/kivy/python-for-android/pull/2489) ([misl6](https://github.com/misl6))
- Add should\_build method to sdl2 recipe [\#2482](https://github.com/kivy/python-for-android/pull/2482) ([AndyRusso](https://github.com/AndyRusso))
- AAB support related changes [\#2467](https://github.com/kivy/python-for-android/pull/2467) ([misl6](https://github.com/misl6))
- services: fix START\_STICKY [\#2401](https://github.com/kivy/python-for-android/pull/2401) ([mzakharo](https://github.com/mzakharo))

## [v2021.09.05](https://github.com/kivy/python-for-android/tree/v2021.09.05) (2021-09-05)

[Full Changelog](https://github.com/kivy/python-for-android/compare/v2020.06.02...v2021.09.05)
Expand Down
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ rebuild_updated_recipes: virtualenv
ANDROID_SDK_HOME=$(ANDROID_SDK_HOME) ANDROID_NDK_HOME=$(ANDROID_NDK_HOME) \
$(PYTHON) ci/rebuild_updated_recipes.py

testapps-with-numpy/%: virtualenv
$(eval $@_APP_ARCH := $(shell basename $*))
testapps-with-numpy: virtualenv
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
python setup.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
--arch=$($@_APP_ARCH)
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86

testapps-with-numpy-aab: virtualenv
. $(ACTIVATE) && cd testapps/on_device_unit_tests/ && \
python setup.py aab --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,urllib3,chardet,idna,sqlite3,setuptools,numpy \
--arch=armeabi-v7a --arch=arm64-v8a --arch=x86_64 --arch=x86 --release

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

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

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

docker/run/make/%: docker/build
docker run --rm --env-file=.env $(DOCKER_IMAGE) make $*

docker/run/shell: docker/build
docker run --rm --env-file=.env -it $(DOCKER_IMAGE)
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python-for-android

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

Features include:

Expand All @@ -19,6 +19,7 @@ Features include:
sqlalchemy.
- Multiple architecture targets, for APKs optimised on any given
device.
- AAB: Android App Bundle support.

For documentation and support, see:

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

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

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

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

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

**If you need to deploy your app on Google Play, Android App Bundle (aab) is required since 1 August 2021:**

**For full instructions and parameter options,** see [the
documentation](https://python-for-android.readthedocs.io/en/latest/quickstart/#usage).

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

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

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

On August of 2021, we added support for Android App Bundle (aab). As a collateral,
now We support multi-arch apk.

## Contributors

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


Expand Down
4 changes: 4 additions & 0 deletions ci/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class TargetPython(Enum):
'vlc',
# need extra gfortran NDK system add-on
'lapack', 'scipy',
# Outdated and there's a chance that is now useless.
'zope_interface',
# Requires zope_interface, which is broken.
'twisted',
])

BROKEN_RECIPES = {
Expand Down
5 changes: 3 additions & 2 deletions doc/source/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ supply those that you need.
Whether the distribution must be compiled from scratch.

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

``--bootstrap BOOTSTRAP``
The Java bootstrap to use for your application. You mostly don't
Expand Down
18 changes: 18 additions & 0 deletions doc/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,24 @@ You can also replace flask with another web framework.
Replace ``--port=5000`` with the port on which your app will serve a
website. The default for Flask is 5000.

Exporting the Android App Bundle (aab) for distributing it on Google Play
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Starting from August 2021 for new apps and from November 2021 for updates to existings apps,
Google Play Console will require the Android App Bundle instead of the long lived apk.

python-for-android handles by itself the needed work to accomplish the new requirements:

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

This `p4a aab ...` command builds a distribution with `python3`,
`kivy`, and everything else you specified in the requirements.
It will be packaged using a SDL2 bootstrap, and produce
an `.aab` file that contains binaries for both `armeabi-v7a` and `arm64-v8a` ABIs.

The Android App Bundle, is supposed to be used for distributing your app.
If you need to test it locally, on your device, you can use `bundletool <https://developer.android.com/studio/command-line/bundletool>`

Other options
~~~~~~~~~~~~~

Expand Down
Loading

0 comments on commit 227a765

Please sign in to comment.