From 57763da72df54807c21b505447bcc0f9bd529f65 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Tue, 25 Aug 2015 17:25:54 +0100 Subject: [PATCH 1/3] TST: refactor, maybe fix traxis build Python 3 builds broken for travis - refactor using dipy as template to get better handle on the problem. --- .travis.yml | 34 +++++++++++++++++++++++++--------- tools/travis_tools.sh | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 tools/travis_tools.sh diff --git a/.travis.yml b/.travis.yml index 1658d12a11..5900bdba46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,21 +4,34 @@ # It's okay for it to be on multiple physical lines, so long as you remember: # - There can't be any leading "-"s - All newlines will be removed, so use # ";"s +sudo: false # To use travis container infrastructure language: python +cache: + directories: + - $HOME/.cache/pip +env: + global: + - DEPENDS="numpy scipy sympy matplotlib nibabel" python: - 2.6 + - 3.2 + - 3.3 + - 3.4 matrix: include: - python: 2.7 env: - - COVERAGE=--with-coverage + - COVERAGE=1 before_install: - - sudo apt-get install -qq libatlas-dev libatlas-base-dev gfortran libpng-dev - - pip install --no-index -f http://wheels2.astropy.org -f https://nipy.bic.berkeley.edu/scipy_installers/travis scipy matplotlib; - - pip install sympy - - pip install nibabel - - if [ "${COVERAGE}" == "--with-coverage" ]; then + - source tools/travis_tools.sh + - virtualenv --python=python venv + - source venv/bin/activate + - python --version # just to check + - retry pip install nose # always + - wheelhouse_pip_install $DEPENDS + # - sudo apt-get install -qq libatlas-dev libatlas-base-dev gfortran libpng-dev + - if [ "${COVERAGE}" == "1" ]; then pip install coverage; pip install coveralls; fi @@ -31,7 +44,10 @@ script: # Change into an innocuous directory and find tests from installation - mkdir for_testing - cd for_testing - - if [ "${COVERAGE}" == "--with-coverage" ]; then cp ../.coveragerc .; fi - - $PYTHON ../tools/nipnost $COVERAGE `python -c "import os; import nipy; print(os.path.dirname(nipy.__file__))"` + - if [ "${COVERAGE}" == "1" ]; then + cp ../.coveragerc .; + COVER_ARGS="--with-coverage --cover-package dipy"; + fi + - $PYTHON ../tools/nipnost $COVER_ARGS nipy after_success: - - if [ "${COVERAGE}" == "--with-coverage" ]; then coveralls; fi + - if [ "${COVERAGE}" == "1" ]; then coveralls; fi diff --git a/tools/travis_tools.sh b/tools/travis_tools.sh new file mode 100644 index 0000000000..f9fec988dd --- /dev/null +++ b/tools/travis_tools.sh @@ -0,0 +1,25 @@ +# Tools for working with travis-ci +export WHEELHOUSE="http://travis-wheels.scikit-image.org/" + +retry () { + # https://gist.github.com/fungusakafungus/1026804 + local retry_max=5 + local count=$retry_max + while [ $count -gt 0 ]; do + "$@" && break + count=$(($count - 1)) + sleep 1 + done + + [ $count -eq 0 ] && { + echo "Retry failed [$retry_max]: $@" >&2 + return 1 + } + return 0 +} + + +wheelhouse_pip_install() { + # Install pip requirements via travis wheelhouse + retry pip install --timeout=60 --no-index --find-links $WHEELHOUSE $@ +} From b72a42d7c524e0c8953ea654ecb6f8712d2dc627 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Wed, 26 Aug 2015 13:25:18 +0100 Subject: [PATCH 2/3] MAINT+TST: update and test minimal dependencies Update dependencies in info file. Add travis-ci run to test minimal dependencies. --- .travis.yml | 4 ++++ nipy/info.py | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5900bdba46..cf4d4528ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,10 @@ matrix: - python: 2.7 env: - COVERAGE=1 + # Absolute minimum dependencies + - python: 2.7 + env: + - DEPENDS="numpy==1.5.1 scipy==0.7.0 sympy==0.7.0 nibabel==1.2.0" before_install: - source tools/travis_tools.sh - virtualenv --python=python venv diff --git a/nipy/info.py b/nipy/info.py index ed7e8c0a72..6e415570c7 100644 --- a/nipy/info.py +++ b/nipy/info.py @@ -93,10 +93,10 @@ To run NIPY, you will need: -* python_ >= 2.5 (tested with 2.5, 2.6, 2.7, 3.2, 3.3) -* numpy_ >= 1.2 +* python_ >= 2.6 (tested with 2.6, 2.7, 3.2, 3.3, 3.4) +* numpy_ >= 1.5.1 * scipy_ >= 0.7.0 -* sympy_ >= 0.6.6 +* sympy_ >= 0.7.0 * nibabel_ >= 1.2 You will probably also like to have: @@ -138,12 +138,12 @@ MICRO = _version_micro ISRELEASE = _version_extra == '' VERSION = __version__ -REQUIRES = ["numpy", "scipy", "sympy"] +REQUIRES = ["numpy", "scipy", "sympy", "nibabel"] STATUS = 'beta' # versions -NUMPY_MIN_VERSION='1.2' -SCIPY_MIN_VERSION = '0.7' +NUMPY_MIN_VERSION='1.5.1' +SCIPY_MIN_VERSION = '0.7.0' NIBABEL_MIN_VERSION = '1.2' SYMPY_MIN_VERSION = '0.7.0' MAYAVI_MIN_VERSION = '3.0' From 687fc746f89198057abd535a5b8ab347b8676e49 Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Thu, 27 Aug 2015 15:40:54 +0100 Subject: [PATCH 3/3] MAINT: update minimal dependencies Bump numpy dependency to 1.6.0 to avoid memmap error of form: AttributeError: 'memmap' object has no attribute 'filename' --- .travis.yml | 2 +- nipy/info.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf4d4528ce..c9d439199d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: # Absolute minimum dependencies - python: 2.7 env: - - DEPENDS="numpy==1.5.1 scipy==0.7.0 sympy==0.7.0 nibabel==1.2.0" + - DEPENDS="numpy==1.6.0 scipy==0.7.0 sympy==0.7.0 nibabel==1.2.0" before_install: - source tools/travis_tools.sh - virtualenv --python=python venv diff --git a/nipy/info.py b/nipy/info.py index 6e415570c7..3df53d7ce7 100644 --- a/nipy/info.py +++ b/nipy/info.py @@ -94,7 +94,7 @@ To run NIPY, you will need: * python_ >= 2.6 (tested with 2.6, 2.7, 3.2, 3.3, 3.4) -* numpy_ >= 1.5.1 +* numpy_ >= 1.6.0 * scipy_ >= 0.7.0 * sympy_ >= 0.7.0 * nibabel_ >= 1.2 @@ -142,7 +142,8 @@ STATUS = 'beta' # versions -NUMPY_MIN_VERSION='1.5.1' +# Update in readme text above +NUMPY_MIN_VERSION='1.6.0' SCIPY_MIN_VERSION = '0.7.0' NIBABEL_MIN_VERSION = '1.2' SYMPY_MIN_VERSION = '0.7.0'