8000 `update`: numpy, pandas, sdl2 · kivy/python-for-android@edea820 · GitHub
[go: up one dir, main page]

Skip to content

Commit edea820

Browse files
committed
update: numpy, pandas, sdl2
1 parent be3de2e commit edea820

File tree

15 files changed

+33
-31
lines changed

15 files changed

+33
-31
lines changed

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 ?= 27c
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 ?= 33
1010

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

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 r27c:**
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="33" # 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 @@ Us 685C ing 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=33 \
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=33 \
179179
--arch=arm64-v8a \
180180
--debug
181181

pythonforandroid/recipe.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ class Recipe(metaclass=RecipeMeta):
155155
starting from NDK r18 the `gnustl_shared` lib has been deprecated.
156156
'''
157157

158+
min_ndk_api_support = 20
159+
'''
160+
Minimum ndk api recipe will support.
161+
'''
162+
158163
def get_stl_library(self, arch):
159164
return join(
160165
arch.ndk_lib_dir,
@@ -375,6 +380,9 @@ def get_recipe_dir(self):
375380
# Public Recipe API to be subclassed if needed
376381

377382
def download_if_necessary(self):
383+
if self.ctx.ndk_api < self.min_ndk_api_support:
384+
error(f"In order to build '{self.name}', you must set minimum ndk api (minapi) to `{self.min_ndk_api_support}`.\n")
385+
exit(1)
378386
info_main('Downloading {}'.format(self.name))
379387
user_dir = environ.get('P4A_{}_DIR'.format(self.name.lower()))
380388
if user_dir is not None:

pythonforandroid/recipes/numpy/__init__.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from pythonforandroid.recipe import Recipe, MesonRecipe
2-
from pythonforandroid.logger import error
32
from os.path import join
43
import shutil
54

65
NUMPY_NDK_MESSAGE = "In order to build numpy, you must set minimum ndk api (minapi) to `24`.\n"
76

87

98
class NumpyRecipe(MesonRecipe):
10-
version = 'v1.26.5'
9+
version = 'v2.3.0'
1110
url = 'git+https://github.com/numpy/numpy'
12-
hostpython_prerequisites = ["Cython>=3.0.6"] # meson does not detects venv's cython
11+
hostpython_prerequisites = ["Cython==3.0.6"] # meson does not detects venv's cython
1312
extra_build_args = ['-Csetup-args=-Dblas=none', '-Csetup-args=-Dlapack=none']
1413
need_stl_shared = True
14+
min_ndk_api_support = 24
1515

1616
def get_recipe_meson_options(self, arch):
1717
options = super().get_recipe_meson_options(arch)
@@ -36,13 +36,6 @@ def get_recipe_env(self, arch, **kwargs):
3636
"python3", self.ctx).get_build_dir(arch.arch), "android-build", "python")
3737
return env
3838

39-
def download_if_necessary(self):
40-
# NumPy requires complex math functions which were added in api 24
41-
if self.ctx.ndk_api < 24:
42-
error(NUMPY_NDK_MESSAGE)
43-
exit(1)
44-
super().download_if_necessary()
45-
4639
def build_arch(self, arch):
4740
super().build_arch(arch)
4841
self.restore_hostpython_prerequisites(["cython"])

pythonforandroid/recipes/pandas/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44

55
class PandasRecipe(MesonRecipe):
6-
version = 'v2.2.1'
7-
url = 'git+https://github.com/pandas-dev/pandas' # noqa
6+
version = 'v2.3.0'
7+
url = 'git+https://github.com/pandas-dev/pandas'
88
depends = ['numpy', 'libbz2', 'liblzma']
9-
hostpython_prerequisites = ["Cython~=3.0.5"] # meson does not detects venv's cython
9+
hostpython_prerequisites = ["Cython<4.0.0a0", "versioneer", "numpy"] # meson does not detects venv's cython
1010
patches = ['fix_numpy_includes.patch']
1111
python_depends = ['python-dateutil', 'pytz']
1212
need_stl_shared = True
@@ -17,7 +17,7 @@ def get_recipe_env(self, arch, **kwargs):
1717
# because we need some includes generated at numpy's compile time
1818

1919
env['NUMPY_INCLUDES'] = join(
20-
self.ctx.get_python_install_dir(arch.arch), "numpy/core/include",
20+
self.ctx.get_python_install_dir(arch.arch), "numpy/_core/include",
2121
)
2222
env["PYTHON_INCLUDE_DIR"] = self.ctx.python_recipe.include_root(arch)
2323

pythonforandroid/recipes/python3/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ class Python3Recipe(TargetPythonRecipe):
141141

142142
site_packages_dir_blacklist = {
143143
'__pycache__',
144-
'tests'
145144
}
146145
'''The directories from site packages dir that we don't want to be included
147146
in our python bundle.'''

pythonforandroid/recipes/sdl2/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77

88
class LibSDL2Recipe(BootstrapNDKRecipe):
9-
version = "2.28.5"
9+
version = "2.30.11"
1010
url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL2-{version}.tar.gz"
11-
md5sum = 'a344eb827a03045c9b399e99af4af13d'
11+
md5sum = 'bea190b480f6df249db29eb3bacfe41e'
1212

1313
conflicts = ['sdl3']
1414

pythonforandroid/recommendations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
MAX_NDK_VERSION = 25
1414

1515
# DO NOT CHANGE LINE FORMAT: buildozer parses the existence of a RECOMMENDED_NDK_VERSION
16-
RECOMMENDED_NDK_VERSION = "25b"
16+
RECOMMENDED_NDK_VERSION = "27c"
1717

1818
NDK_DOWNLOAD_URL = "https://developer.android.com/ndk/downloads/"
1919

testapps/on_device_unit_tests/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'requirements':
4343
'sqlite3,libffi,openssl,pyjnius,kivy,python3,requests,urllib3,'
4444
'chardet,idna',
45-
'android-api': 27,
45+
'android-api': 33,
4646
'ndk-api': 24,
4747
'dist-name': 'bdist_unit_tests_app',
4848
'arch': 'armeabi-v7a',
@@ -56,7 +56,7 @@
5656
'requirements':
5757
'sqlite3,libffi,openssl,pyjnius,kivy,python3,requests,urllib3,'
5858
'chardet,idna',
59-
'android-api': 27,
59+
'android-api': 33,
6060
'ndk-api': 24,
6161
'dist-name': 'bdist_unit_tests_app',
6262
'arch': 'armeabi-v7a',
@@ -68,7 +68,7 @@
6868
'aar':
6969
{
7070
'requirements' : 'python3',
71-
'android-api': 27,
71+
'android-api': 33,
7272
'ndk-api': 24,
7373
'dist-name': 'bdist_unit_tests_app',
7474
'arch': 'arm64-v8a',

testapps/setup_testapp_python3_sqlite_openssl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33
options = {'apk': {'requirements': 'requests,peewee,sdl2,pyjnius,kivy,python3',
4-
'android-api': 27,
4+
'android-api': 33,
55
'ndk-api': 21,
66
'bootstrap': 'sdl2',
77
'dist-name': 'bdisttest_python3_sqlite_openssl_googlendk',

testapps/setup_vispy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
options = {'apk': {'debug': None,
44
'requirements': 'python3,vispy',
55
'blacklist-requirements': 'openssl,sqlite3',
6-
'android-api': 27,
6+
'android-api': 33,
77
'ndk-api': 21,
88
'bootstrap': 'empty',
99
'ndk-dir': '/home/asandy/android/android-ndk-r17c',

testapps/testlauncherreboot_setup/sdl2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
# 'cymunk,lxml,pil,openssl,pyopenssl,'
5555
# 'twisted,audiostream,ffmpeg,numpy'
5656

57-
'android-api': 27,
57+
'android-api': 33,
5858
'ndk-api': 21,
5959
'dist-name': 'bdisttest_python3launcher_sdl2_googlendk',
6060
'name': 'TestLauncherPy3-sdl2',

tests/recipes/test_pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_get_recipe_env(
3535
self.ctx.recipe_build_order
3636
)
3737
numpy_includes = join(
38-
self.ctx.get_python_install_dir(self.arch.arch), "numpy/core/include",
38+
self.ctx.get_python_install_dir(self.arch.arch), "numpy/_core/include",
3939
)
4040
env = self.recipe.get_recipe_env(self.arch)
4141
self.assertIn(numpy_includes, env["NUMPY_INCLUDES"])

tests/test_recipe.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def test_download_if_necessary(self):
9393
"""
9494
# download should happen as the environment variable is not set
9595
recipe = DummyRecipe()
96+
recipe.ctx = Context()
97+
recipe.ctx._ndk_api = 36
9698
with mock.patch.object(Recipe, 'download') as m_download:
9799
recipe.download_if_necessary()
98100
assert m_download.call_args_list == [mock.call()]

0 commit comments

Comments
 (0)
0