From e0f82fd2602cca9d6697fb213039cbb15a058b6f Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Fri, 1 Feb 2019 18:06:48 -0800 Subject: [PATCH] Fix building python 3.7 wheel by installing newer numpy. (#3927) --- python/build-wheel-manylinux1.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/python/build-wheel-manylinux1.sh b/python/build-wheel-manylinux1.sh index 500fe5c49..ee13d50c3 100755 --- a/python/build-wheel-manylinux1.sh +++ b/python/build-wheel-manylinux1.sh @@ -6,6 +6,19 @@ echo 10 EOF chmod +x /usr/bin/nproc +PYTHONS=("cp27-cp27mu" + "cp34-cp34m" + "cp35-cp35m" + "cp36-cp36m" + "cp37-cp37m") + +# On python 3.7, a newer version of numpy seems to be necessary. +NUMPY_VERSIONS=("1.10.4" + "1.10.4" + "1.10.4" + "1.10.4" + "1.14.5") + # Remove this old Python 2.4.3 executable, and make the "python2" command find # a newer version of Python. We need this for autogenerating some files for the # UI. @@ -13,7 +26,9 @@ rm -f /usr/bin/python2 ln -s /opt/python/cp27-cp27m/bin/python2 /usr/bin/python2 mkdir .whl -for PYTHON in cp27-cp27mu cp34-cp34m cp35-cp35m cp36-cp36m cp37-cp37m; do +for ((i=0; i<${#PYTHONS[@]}; ++i)); do + PYTHON=${PYTHONS[i]} + NUMPY_VERSION=${NUMPY_VERSIONS[i]} # The -f flag is passed twice to also run git clean in the arrow subdirectory. # The -d flag removes directories. The -x flag ignores the .gitignore file, # and the -e flag ensures that we don't remove the .whl directory. @@ -21,7 +36,7 @@ for PYTHON in cp27-cp27mu cp34-cp34m cp35-cp35m cp36-cp36m cp37-cp37m; do pushd python # Fix the numpy version because this will be the oldest numpy version we can # support. - /opt/python/${PYTHON}/bin/pip install -q numpy==1.10.4 cython==0.29.0 + /opt/python/${PYTHON}/bin/pip install -q numpy==${NUMPY_VERSION} cython==0.29.0 INCLUDE_UI=1 PATH=/opt/python/${PYTHON}/bin:$PATH /opt/python/${PYTHON}/bin/python setup.py bdist_wheel # In the future, run auditwheel here. mv dist/*.whl ../.whl/