Skip to content

Commit

Permalink
Use early numpy wheel for each neuron wheel. (#801)
Browse files Browse the repository at this point in the history
  Later numpy version on user machine should work.
  • Loading branch information
nrnhines committed Dec 10, 2020
1 parent b6852c9 commit 39c27cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
1 change: 0 additions & 1 deletion packaging/python/build_requirements.txt
@@ -1,3 +1,2 @@
cython
numpy

23 changes: 21 additions & 2 deletions packaging/python/build_wheels.bash
Expand Up @@ -23,9 +23,11 @@ if [ ! -f setup.py ]; then
exit 1
fi

py_ver=""

setup_venv() {
local py_bin="$1"
local py_ver=$("$py_bin" -c "import sys; print('%d%d' % tuple(sys.version_info)[:2])")
py_ver=$("$py_bin" -c "import sys; print('%d%d' % tuple(sys.version_info)[:2])")
local venv_dir="nrn_build_venv$py_ver"

if [ "$py_ver" -lt 35 ]; then
Expand All @@ -47,6 +49,21 @@ setup_venv() {
}


pip_numpy_install() {
# numpy is special as we want the minimum wheel version
numpy_ver="numpy"
case "$py_ver" in
35) numpy_ver="numpy==1.10.4" ;;
36) numpy_ver="numpy==1.12.1" ;;
37) numpy_ver="numpy==1.14.6" ;;
38) numpy_ver="numpy==1.17.5" ;;
39) numpy_ver="numpy==1.19.3" ;;
*) numpy_ver="numpy";;
esac
echo " - pip install $numpy_ver"
pip install $numpy_ver
}

build_wheel_linux() {
echo "[BUILD WHEEL] Building with interpreter $1"
local skip=
Expand All @@ -55,7 +72,8 @@ build_wheel_linux() {

echo " - Installing build requirements"
pip install git+https://github.com/ferdonline/auditwheel@fix/rpath_append
pip install -i https://nero-mirror.stanford.edu/pypi/web/simple -r packaging/python/build_requirements.txt
pip install -r packaging/python/build_requirements.txt
pip_numpy_install

echo " - Building..."
rm -rf dist build
Expand Down Expand Up @@ -85,6 +103,7 @@ build_wheel_osx() {

echo " - Installing build requirements"
pip install -U delocate -r packaging/python/build_requirements.txt
pip_numpy_install

echo " - Building..."
rm -rf dist build
Expand Down

0 comments on commit 39c27cd

Please sign in to comment.