diff --git a/.travis.yml b/.travis.yml index 350b973b..e3766925 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,13 +20,11 @@ before_install: - export WHEELHOUSE="--no-index --find-links=http://travis-wheels.scikit-image.org/" - sudo apt-get update - - virtualenv -p python ~/venv + - travis_retry tools/travis_setup.sh + - source ~/venv/bin/activate - which python - python --version - - - travis_retry tools/travis_setup.sh - - python check_bento_build.py - tools/header.py "Dependency versions" diff --git a/requirements.txt b/requirements.txt index 9e5c9ba4..189b627b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ cython>=0.19.2 -matplotlib>=1.1.1 -numpy>=1.6.0 +matplotlib>=1.1.0 +numpy>=1.6.1 scipy>=0.9 six>=1.3 networkx>=1.8 diff --git a/tools/travis_install_optional.sh b/tools/travis_install_optional.sh index b1de66de..582503bd 100755 --- a/tools/travis_install_optional.sh +++ b/tools/travis_install_optional.sh @@ -7,6 +7,21 @@ tools/header.py "Install optional dependencies" if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install -q python-qt4 + # http://stackoverflow.com/a/9716100 + LIBS=( PyQt4 sip.so ) + + PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") + VAR=( $(which -a $PYTHON_VERSION) ) + + GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())" + LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD") + LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD") + + for LIB in ${LIBS[@]} + do + ln -s $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB + done + else sudo apt-get install -q libqt4-dev pip install -q PySide $WHEELHOUSE @@ -25,7 +40,7 @@ if [[ $TRAVIS_PYTHON_VERSION != 3.4 ]]; then fi sudo apt-get install -q libfreeimage3 -pip install -q astropy +pip install -q astropy $WHEELHOUSE if [[ $TRAVIS_PYTHON_VERSION == 2.* ]]; then pip install -q pyamg diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index d9f46cd9..5b91a976 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -3,19 +3,24 @@ set -ex sh -e /etc/init.d/xvfb start -pip install wheel flake8 coveralls nose - -# install system tk -sudo apt-get install python-tk - # on Python 2.7, use the system versions of numpy, scipy, and matplotlib # and the minimum version of cython and networkx if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then + virtualenv -p python --system-site-packages ~/venv sudo apt-get install python-scipy python-matplotlib sed -i 's/cython>=/cython==/g' requirements.txt sed -i 's/networkx>=/networkx==/g' requirements.txt +else + virtualenv -p python --system-site-packages ~/venv fi +source ~/venv/bin/activate +pip install wheel flake8 coveralls nose + +# install system tk for matplotlib +sudo apt-get install python-tk + + # on Python 3.2, use matplotlib 1.3.1 if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sed -i 's/matplotlib>=*.*.*/matplotlib==1.3.1/g' requirements.txt