Skip to content

Commit 9d5ebb6

Browse files
authored
Update numpy to v1.18.1 (add cython recipe) (kivy#2077)
* [recipes] Update `numpy` to v1.18.1 (add `cython` recipe) * [recipes] Move CI `numpy` tests to Python 3 Because the latest version of numpy requires Python>=3.5 * [recipes] Move CI `numpy` tests to Python 3 (linux)
1 parent 6b73f52 commit 9d5ebb6

File tree

6 files changed

+23
-37
lines changed

6 files changed

+23
-37
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
after_success:
4848
- coveralls
4949
- &testapps
50-
name: Python 3 arm64-v8a
50+
name: Python 3 arm64-v8a (with numpy)
5151
stage: build testapps
5252
before_script: make docker/pull
5353
script: make docker/run/make/testapps/python3/arm64-v8a
@@ -61,7 +61,7 @@ jobs:
6161
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
6262
script: make testapps/python3/armeabi-v7a PYTHON_WITH_VERSION=python3
6363
- <<: *testapps
64-
name: Python 2 armeabi-v7a (with numpy)
64+
name: Python 2 armeabi-v7a
6565
script: make docker/run/make/testapps/python2/armeabi-v7a
6666
- <<: *testapps
6767
name: Rebuild updated recipes

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ rebuild_updated_recipes: virtualenv
3838
testapps/python2/armeabi-v7a: virtualenv
3939
. $(ACTIVATE) && cd testapps/ && \
4040
python setup_testapp_python2_sqlite_openssl.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
41-
--requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3,setuptools,numpy
41+
--requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3,setuptools
4242

4343
testapps/python3/arm64-v8a: virtualenv
4444
. $(ACTIVATE) && cd testapps/ && \
4545
python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
46+
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools,numpy \
4647
--arch=arm64-v8a
4748

4849
testapps/python3/armeabi-v7a: virtualenv
4950
. $(ACTIVATE) && cd testapps/ && \
5051
python setup_testapp_python3_sqlite_openssl.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
51-
--requirements libffi,sdl2,pyjnius,kivy,python3,openssl,requests,sqlite3,setuptools \
5252
--arch=armeabi-v7a
5353

5454
clean:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2+
3+
4+
class CythonRecipe(CompiledComponentsPythonRecipe):
5+
6+
version = '0.29.15'
7+
url = 'https://github.com/cython/cython/archive/{version}.tar.gz'
8+
site_packages_name = 'cython'
9+
depends = ['setuptools']
10+
call_hostpython_via_targetpython = False
11+
install_in_hostpython = True
12+
13+
14+
recipe = CythonRecipe()

pythonforandroid/recipes/numpy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
class NumpyRecipe(CompiledComponentsPythonRecipe):
77

8-
version = '1.16.4'
8+
version = '1.18.1'
99
url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'
1010
site_packages_name = 'numpy'
11-
depends = ['setuptools']
11+
depends = ['setuptools', 'cython']
1212

1313
patches = [
1414
join('patches', 'add_libm_explicitly_to_build.patch'),
Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,20 @@
1-
diff --git a/numpy/fft/setup.py b/numpy/fft/setup.py
2-
index cd99a82..cd7c1ef 100644
3-
--- a/numpy/fft/setup.py
4-
+++ b/numpy/fft/setup.py
5-
@@ -9,7 +9,8 @@ def configuration(parent_package='',top_path=None):
6-
7-
# Configure fftpack_lite
8-
config.add_extension('fftpack_lite',
9-
- sources=['fftpack_litemodule.c', 'fftpack.c']
10-
+ sources=['fftpack_litemodule.c', 'fftpack.c'],
11-
+ libraries=['m'],
12-
)
13-
14-
return config
151
diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py
162
index 66c07c9..d34bd93 100644
173
--- a/numpy/linalg/setup.py
184
+++ b/numpy/linalg/setup.py
19-
@@ -43,6 +43,7 @@ def configuration(parent_package='', top_path=None):
5+
@@ -46,6 +46,7 @@ def configuration(parent_package='', top_path=None):
206
sources=['lapack_litemodule.c', get_lapack_lite_sources],
217
depends=['lapack_lite/f2c.h'],
228
extra_info=lapack_info,
239
+ libraries=['m'],
2410
)
2511

2612
# umath_linalg module
27-
@@ -51,7 +52,7 @@ def configuration(parent_package='', top_path=None):
13+
@@ -54,7 +54,7 @@ def configuration(parent_package='', top_path=None):
2814
sources=['umath_linalg.c.src', get_lapack_lite_sources],
2915
depends=['lapack_lite/f2c.h'],
3016
extra_info=lapack_info,
3117
- libraries=['npymath'],
3218
+ libraries=['npymath', 'm'],
3319
)
3420
return config
35-
36-
diff --git a/numpy/random/setup.py b/numpy/random/setup.py
37-
index 394a70e..44af180 100644
38-
--- a/numpy/random/setup.py
39-
+++ b/numpy/random/setup.py
40-
@@ -39,7 +39,7 @@ def configuration(parent_package='',top_path=None):
41-
if needs_mingw_ftime_workaround():
42-
defs.append(("NPY_NEEDS_MINGW_TIME_WORKAROUND", None))
43-
44-
- libs = []
45-
+ libs = ['m']
46-
# Configure mtrand
47-
config.add_extension('mtrand',
48-
sources=[join('mtrand', x) for x in

pythonforandroid/recipes/numpy/patches/do_not_use_system_libs.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
22
index 806f4f7..0d51cfa 100644
33
--- a/numpy/distutils/system_info.py
44
+++ b/numpy/distutils/system_info.py
5-
@@ -734,6 +734,7 @@ class system_info(object):
5+
@@ -823,6 +823,7 @@ class system_info(object):
66
return self.get_paths(self.section, key)
77

88
def get_libs(self, key, default):

0 commit comments

Comments
 (0)