Skip to content

Commit 11d4e3b

Browse files
committed
numpy: update to 2.3.0
1 parent be3de2e commit 11d4e3b

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

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 & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77

88

99
class NumpyRecipe(MesonRecipe):
10-
version = 'v1.26.5'
10+
version = 'v2.3.0'
1111
url = 'git+https://github.com/numpy/numpy'
12-
hostpython_prerequisites = ["Cython>=3.0.6"] # meson does not detects venv's cython
12+
hostpython_prerequisites = ["Cython==3.0.6"] # meson does not detects venv's cython
1313
extra_build_args = ['-Csetup-args=-Dblas=none', '-Csetup-args=-Dlapack=none']
1414
need_stl_shared = True
15+
min_ndk_api_support = 24
1516

1617
def get_recipe_meson_options(self, arch):
1718
options = super().get_recipe_meson_options(arch)
@@ -36,13 +37,6 @@ def get_recipe_env(self, arch, **kwargs):
3637
"python3", self.ctx).get_build_dir(arch.arch), "android-build", "python")
3738
return env
3839

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-
4640
def build_arch(self, arch):
4741
super().build_arch(arch)
4842
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.2.3'
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==3.0.5"] # 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.'''

0 commit comments

Comments
 (0)