Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update numpy to v1.18.1 (add cython recipe) #2077

Merged
merged 3 commits into from
Mar 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
after_success:
- coveralls
- &testapps
name: Python 3 arm64-v8a
name: Python 3 arm64-v8a (with numpy)
stage: build testapps
before_script: make docker/pull
script: make docker/run/make/testapps/python3/arm64-v8a
Expand All @@ -61,7 +61,7 @@ jobs:
- export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
script: make testapps/python3/armeabi-v7a PYTHON_WITH_VERSION=python3
- <<: *testapps
name: Python 2 armeabi-v7a (with numpy)
name: Python 2 armeabi-v7a
script: make docker/run/make/testapps/python2/armeabi-v7a
- <<: *testapps
name: Rebuild updated recipes
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ rebuild_updated_recipes: virtualenv
testapps/python2/armeabi-v7a: virtualenv
. $(ACTIVATE) && cd testapps/ && \
python setup_testapp_python2_sqlite_openssl.py apk --sdk-dir $(ANDROID_SDK_HOME) --ndk-dir $(ANDROID_NDK_HOME) \
--requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3,setuptools,numpy
--requirements sdl2,pyjnius,kivy,python2,openssl,requests,sqlite3,setuptools

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

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

clean:
Expand Down
14 changes: 14 additions & 0 deletions pythonforandroid/recipes/cython/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from pythonforandroid.recipe import CompiledComponentsPythonRecipe


class CythonRecipe(CompiledComponentsPythonRecipe):

version = '0.29.15'
url = 'https://github.com/cython/cython/archive/{version}.tar.gz'
site_packages_name = 'cython'
depends = ['setuptools']
call_hostpython_via_targetpython = False
install_in_hostpython = True


recipe = CythonRecipe()
4 changes: 2 additions & 2 deletions pythonforandroid/recipes/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

class NumpyRecipe(CompiledComponentsPythonRecipe):

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

patches = [
join('patches', 'add_libm_explicitly_to_build.patch'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,48 +1,20 @@
diff --git a/numpy/fft/setup.py b/numpy/fft/setup.py
index cd99a82..cd7c1ef 100644
--- a/numpy/fft/setup.py
+++ b/numpy/fft/setup.py
@@ -9,7 +9,8 @@ def configuration(parent_package='',top_path=None):

# Configure fftpack_lite
config.add_extension('fftpack_lite',
- sources=['fftpack_litemodule.c', 'fftpack.c']
+ sources=['fftpack_litemodule.c', 'fftpack.c'],
+ libraries=['m'],
)

return config
diff --git a/numpy/linalg/setup.py b/numpy/linalg/setup.py
index 66c07c9..d34bd93 100644
--- a/numpy/linalg/setup.py
+++ b/numpy/linalg/setup.py
@@ -43,6 +43,7 @@ def configuration(parent_package='', top_path=None):
@@ -46,6 +46,7 @@ def configuration(parent_package='', top_path=None):
sources=['lapack_litemodule.c', get_lapack_lite_sources],
depends=['lapack_lite/f2c.h'],
extra_info=lapack_info,
+ libraries=['m'],
)

# umath_linalg module
@@ -51,7 +52,7 @@ def configuration(parent_package='', top_path=None):
@@ -54,7 +54,7 @@ def configuration(parent_package='', top_path=None):
sources=['umath_linalg.c.src', get_lapack_lite_sources],
depends=['lapack_lite/f2c.h'],
extra_info=lapack_info,
- libraries=['npymath'],
+ libraries=['npymath', 'm'],
)
return config

diff --git a/numpy/random/setup.py b/numpy/random/setup.py
index 394a70e..44af180 100644
--- a/numpy/random/setup.py
+++ b/numpy/random/setup.py
@@ -39,7 +39,7 @@ def configuration(parent_package='',top_path=None):
if needs_mingw_ftime_workaround():
defs.append(("NPY_NEEDS_MINGW_TIME_WORKAROUND", None))

- libs = []
+ libs = ['m']
# Configure mtrand
config.add_extension('mtrand',
sources=[join('mtrand', x) for x in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 806f4f7..0d51cfa 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -734,6 +734,7 @@ class system_info(object):
@@ -823,6 +823,7 @@ class system_info(object):
return self.get_paths(self.section, key)

def get_libs(self, key, default):
Expand Down