Skip to content

Commit 7430aa4

Browse files
authored
Merge branch 'kivy:develop' into sdlsurface-patch
2 parents 2473dde + e1bd249 commit 7430aa4

File tree

85 files changed

+1386
-2321
lines changed

Some content is hidden

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

85 files changed

+1386
-2321
lines changed

.github/workflows/push.yml

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout python-for-android
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
- name: Set up Python 3.x
24-
uses: actions/setup-python@v5
24+
uses: actions/setup-python@v6
2525
with:
2626
python-version: 3.x
2727
- name: Run flake8
@@ -35,16 +35,18 @@ jobs:
3535
needs: flake8
3636
runs-on: ${{ matrix.os }}
3737
strategy:
38+
fail-fast: false
3839
matrix:
39-
python-version: ['3.8', '3.9', '3.10', '3.11']
40-
os: [ubuntu-latest, macOs-latest]
40+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
41+
os: [ubuntu-latest, macos-latest]
4142
steps:
4243
- name: Checkout python-for-android
43-
uses: actions/checkout@v4
44+
uses: actions/checkout@v5
4445
- name: Set up Python ${{ matrix.python-version }}
45-
uses: actions/setup-python@v5
46+
uses: actions/setup-python@v6
4647
with:
4748
python-version: ${{ matrix.python-version }}
49+
allow-prereleases: true
4850
- name: Tox tests
4951
run: |
5052
python -m pip install --upgrade pip
@@ -78,7 +80,7 @@ jobs:
7880
target: testapps-qt
7981
steps:
8082
- name: Checkout python-for-android
81-
uses: actions/checkout@v4
83+
uses: actions/checkout@v5
8284
- name: Build python-for-android docker image
8385
run: |
8486
docker build --tag=kivy/python-for-android .
@@ -114,9 +116,9 @@ jobs:
114116
continue-on-error: true
115117
strategy:
116118
matrix:
117-
# macos-latest (ATM macos-14) runs on Apple Silicon,
118-
# macos-13 runs on Intel
119-
runs_on: ['macos-latest', 'macos-13']
119+
# macos-latest (ATM macos-15) runs on Apple Silicon,
120+
# macos-15-intel runs on Intel
121+
runs_on: ['macos-latest', 'macos-15-intel']
120122
bootstrap:
121123
- name: sdl2
122124
target: testapps-with-numpy
@@ -129,14 +131,14 @@ jobs:
129131
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
130132
steps:
131133
- name: Checkout python-for-android
132-
uses: actions/checkout@v4
134+
uses: actions/checkout@v5
133135
- name: Set up Python 3.x
134-
uses: actions/setup-python@v5
136+
uses: actions/setup-python@v6
135137
with:
136138
python-version: 3.x
137139
- name: Install python-for-android
138140
run: |
139-
python3 -m pip install -e .
141+
python3 -m pip install --editable .
140142
- name: Install prerequisites via pythonforandroid/prerequisites.py (Experimental)
141143
run: |
142144
python3 pythonforandroid/prerequisites.py
@@ -162,6 +164,26 @@ jobs:
162164
name: ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-artifacts
163165
path: dist
164166

167+
test_on_emulator:
168+
name: Run App on Emulator
169+
needs: ubuntu_build
170+
runs-on: ubuntu-latest
171+
172+
steps:
173+
- uses: actions/checkout@v5
174+
- name: Download Artifacts
175+
uses: actions/download-artifact@v5
176+
with:
177+
name: ubuntu-latest-sdl2-artifacts
178+
path: dist/
179+
180+
- name: Setup and start Android Emulator
181+
uses: reactivecircus/android-emulator-runner@v2
182+
with:
183+
api-level: 30
184+
arch: x86_64
185+
script: ci/run_emulator_tests.sh
186+
165187
ubuntu_rebuild_updated_recipes:
166188
name: Test updated recipes for arch ${{ matrix.android_arch }} [ ubuntu-latest ]
167189
needs: [flake8]
@@ -174,7 +196,7 @@ jobs:
174196
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
175197
steps:
176198
- name: Checkout python-for-android (all-history)
177-
uses: actions/checkout@v4
199+
uses: actions/checkout@v5
178200
with:
179201
fetch-depth: 0
180202
# helps with GitHub runner getting out of space
@@ -201,9 +223,9 @@ jobs:
201223
strategy:
202224
matrix:
203225
android_arch: ["arm64-v8a", "armeabi-v7a", "x86_64", "x86"]
204-
# macos-latest (ATM macos-14) runs on Apple Silicon,
205-
# macos-13 runs on Intel
206-
runs_on: ['macos-latest', 'macos-13']
226+
# macos-latest (ATM macos-15) runs on Apple Silicon,
227+
# macos-15-intel runs on Intel
228+
runs_on: ['macos-latest', 'macos-15-intel']
207229
env:
208230
ANDROID_HOME: ${HOME}/.android
209231
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
@@ -212,16 +234,16 @@ jobs:
212234
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
213235
steps:
214236
- name: Checkout python-for-android (all-history)
215-
uses: actions/checkout@v4
237+
uses: actions/checkout@v5
216238
with:
217239
fetch-depth: 0
218240
- name: Set up Python 3.x
219-
uses: actions/setup-python@v5
241+
uses: actions/setup-python@v6
220242
with:
221243
python-version: 3.x
222244
- name: Install python-for-android
223245
run: |
224-
python3 -m pip install -e .
246+
python3 -m pip install --editable .
225247
- name: Install prerequisites via pythonforandroid/prerequisites.py (Experimental)
226248
run: |
227249
python3 pythonforandroid/prerequisites.py
@@ -244,7 +266,7 @@ jobs:
244266
documentation:
245267
runs-on: ubuntu-latest
246268
steps:
247-
- uses: actions/checkout@v4
269+
- uses: actions/checkout@v5
248270
- name: Requirements
249271
run: |
250272
python -m pip install --upgrade pip

.github/workflows/pypi-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
twine check dist/*
2020
- name: Publish package
2121
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
22-
uses: pypa/gh-action-pypi-publish@v1.4.2
22+
uses: pypa/gh-action-pypi-publish@v1.13.0
2323
with:
2424
user: __token__
2525
password: ${{ secrets.pypi_password }}

ci/constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ class TargetPython(Enum):
2525
# mpmath package with a version >= 0.19 required
2626
'sympy',
2727
'vlc',
28-
# need extra gfortran NDK system add-on
29-
'lapack', 'scipy',
28+
# GitHub CI runs out of storage while building it
29+
'scipy',
30+
'fortran',
3031
# Outdated and there's a chance that is now useless.
3132
'zope_interface',
3233
# Requires zope_interface, which is broken.

ci/makefiles/android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Downloads and installs the Android SDK depending on supplied platform: darwin or linux
22

33
# Those android NDK/SDK variables can be override when running the file
4-
ANDROID_NDK_VERSION ?= 25b
4+
ANDROID_NDK_VERSION ?= 28c
55
ANDROID_NDK_VERSION_LEGACY ?= 21e
66
ANDROID_SDK_TOOLS_VERSION ?= 6514223
77
ANDROID_SDK_BUILD_TOOLS_VERSION ?= 29.0.3
88
ANDROID_HOME ?= $(HOME)/.android
9-
ANDROID_API_LEVEL ?= 27
9+
ANDROID_API_LEVEL ?= 36
1010

1111
# per OS dictionary-like
1212
UNAME_S := $(shell uname -s)

ci/run_emulator_tests.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
4+
# Find the built APK file
5+
APK_FILE=$(find dist -name "*.apk" -print -quit)
6+
7+
if [ -z "$APK_FILE" ]; then
8+
echo "Error: No APK file found in dist/"
9+
exit 1
10+
fi
11+
12+
echo "Installing $APK_FILE..."
13+
adb install "$APK_FILE"
14+
15+
# Extract package and activity names
16+
AAPT2_PATH=$(find ${ANDROID_HOME}/build-tools/ -name aapt2 | sort -r | head -n 1)
17+
APP_PACKAGE=$(${AAPT2_PATH} dump badging "${APK_FILE}" | awk -F"'" '/package: name=/{print $2}')
18+
APP_ACTIVITY=$(${AAPT2_PATH} dump badging "${APK_FILE}" | awk -F"'" '/launchable-activity/ {print $2}')
19+
20+
echo "Launching $APP_PACKAGE/$APP_ACTIVITY..."
21+
adb shell am start -n "$APP_PACKAGE/$APP_ACTIVITY" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
22+
23+
# Poll for test completion with timeout
24+
MAX_WAIT=300
25+
POLL_INTERVAL=5
26+
elapsed=0
27+
28+
echo "Waiting for tests to complete (max ${MAX_WAIT}s)..."
29+
30+
while [ $elapsed -lt $MAX_WAIT ]; do
31+
# Dump current logs
32+
adb logcat -d -s python:I *:S > app_logs.txt
33+
34+
# Check if all success patterns are present
35+
if grep --extended-regexp --quiet "I python[ ]+: Initialized python" app_logs.txt && \
36+
grep --extended-regexp --quiet "I python[ ]+: Ran 14 tests in" app_logs.txt && \
37+
grep --extended-regexp --quiet "I python[ ]+: OK" app_logs.txt; then
38+
echo "✅ SUCCESS: App launched and all unit tests passed in ${elapsed}s."
39+
exit 0
40+
fi
41+
42+
# Check for early failure indicators
43+
if grep --extended-regexp --quiet "I python[ ]+: FAILED" app_logs.txt; then
44+
echo "❌ FAILURE: Tests failed after ${elapsed}s."
45+
echo "--- Full Logs ---"
46+
cat app_logs.txt
47+
echo "-----------------"
48+
exit 1
49+
fi
50+
51+
sleep $POLL_INTERVAL
52+
elapsed=$((elapsed + POLL_INTERVAL))
53+
echo "Still waiting... (${elapsed}s elapsed)"
54+
done
55+
56+
echo "❌ TIMEOUT: Tests did not complete within ${MAX_WAIT}s."
57+
echo "--- Full Logs ---"
58+
cat app_logs.txt
59+
echo "-----------------"
60+
exit 1

doc/source/quickstart.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ named ``tools``, and you will need to run extra commands to install
119119
the SDK packages needed.
120120

121121
For Android NDK, note that modern releases will only work on a 64-bit
122-
operating system. **The minimal, and recommended, NDK version to use is r25b:**
122+
operating system. **The minimal, and recommended, NDK version to use is r28c:**
123123

124124
- `Go to ndk downloads page <https://developer.android.com/ndk/downloads/>`_
125125
- Windows users should create a virtual machine with an GNU Linux os
@@ -154,7 +154,7 @@ variables necessary for building on android::
154154
# Adjust the paths!
155155
export ANDROIDSDK="$HOME/Documents/android-sdk-27"
156156
export ANDROIDNDK="$HOME/Documents/android-ndk-r23b"
157-
export ANDROIDAPI="27" # Target API version of your application
157+
export ANDROIDAPI="36" # Target API version of your application
158158
export NDKAPI="21" # Minimum supported API version of your application
159159
export ANDROIDNDKVER="r10e" # Version of the NDK you installed
160160

doc/source/testing_pull_requests.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Using python-for-android commands directly from the pull request files
118118
--requirements=sdl2,pyjnius,kivy,python3,pycryptodome \
119119
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
120120
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
121-
--android-api=27 \
121+
--android-api=36 \
122122
--arch=arm64-v8a \
123123
--permission=VIBRATE \
124124
--debug
@@ -175,7 +175,7 @@ Installing python-for-android using the github's branch of the pull request
175175
python3 setup.py apk \
176176
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
177177
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
178-
--android-api=27 \
178+
--android-api=36 \
179179
--arch=arm64-v8a \
180180
--debug
181181

pythonforandroid/archs.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ def get_env(self, with_flags_in_cc=True):
132132
env['CPPFLAGS'] = ' '.join(self.common_cppflags).format(
133133
ctx=self.ctx,
134134
command_prefix=self.command_prefix,
135-
python_includes=join(
136-
self.ctx.get_python_install_dir(self.arch),
137-
'include/python{}'.format(self.ctx.python_recipe.version[0:3]),
138-
),
135+
python_includes=join(Recipe.get_recipe("python3", self.ctx).include_root(self.arch))
139136
)
140137

141138
# LDFLAGS: Link the extra global link paths first before anything else

pythonforandroid/bootstraps/common/build/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip

0 commit comments

Comments
 (0)