44# for it to be on multiple physical lines, so long as you remember: - There
55# can't be any leading "-"s - All newlines will be removed, so use ";"s
66
7+ dist : xenial
8+ sudo : true
79language : python
810
9- # Run jobs on container-based infrastructure, can be overridden per job
10- sudo : false
11-
1211cache :
1312 directories :
1413 - $HOME/.cache/pip
1716 - DEPENDS="six numpy scipy matplotlib h5py pillow pydicom"
1817 - OPTIONAL_DEPENDS=""
1918 - INSTALL_TYPE="setup"
19+ - CHECK_TYPE="test"
2020 - EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
2121 - PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
2222 - EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
2323 - PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
2424python :
25- - 3.4
2625 - 3.5
2726 - 3.6
27+ - 3.7
2828matrix :
2929 include :
30+ - python : 3.4
31+ dist : trusty
32+ sudo : false
33+ # Absolute minimum dependencies
3034 - python : 2.7
3135 env :
32- - COVERAGE=1
36+ - DEPENDS="numpy==1.8"
3337 # Absolute minimum dependencies
3438 - python : 2.7
3539 env :
36- - DEPENDS="numpy==1.7.1"
40+ - DEPENDS="numpy==1.8"
41+ - CHECK_TYPE="import"
3742 # Absolute minimum dependencies plus oldest MPL
3843 # Check these against:
3944 # nibabel/info.py
4045 # doc/source/installation.rst
4146 # requirements.txt
4247 - python : 2.7
4348 env :
44- - DEPENDS="numpy==1.7.1 matplotlib==1.3.1"
49+ - DEPENDS="numpy==1.8 matplotlib==1.3.1"
4550 # Minimum pydicom dependency
4651 - python : 2.7
4752 env :
48- - DEPENDS="numpy==1.7.1 pydicom==0.9.9 pillow==2.6"
53+ - DEPENDS="numpy==1.8 pydicom==0.9.9 pillow==2.6"
4954 # pydicom master branch
5055 - python : 3.5
5156 env :
@@ -58,10 +63,6 @@ matrix:
5863 - python : 3.5
5964 env :
6065 - EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
61- # Documentation doctests
62- - python : 2.7
63- env :
64- - DOC_DOC_TEST=1
6566 - python : 2.7
6667 env :
6768 - INSTALL_TYPE=sdist
@@ -73,13 +74,17 @@ matrix:
7374 - INSTALL_TYPE=requirements
7475 - python : 2.7
7576 env :
76- - STYLE=1
77+ - CHECK_TYPE="style"
7778 - python : 3.5
7879 env :
79- - STYLE=1
80+ - CHECK_TYPE="style"
81+ # Documentation doctests
82+ - python : 2.7
83+ env :
84+ - CHECK_TYPE="doc_doctests"
8085 - python : 3.5
8186 env :
82- - DOC_DOC_TEST=1
87+ - CHECK_TYPE="doc_doctests"
8388 # Run tests with indexed_gzip present
8489 - python : 2.7
8590 env :
@@ -88,20 +93,20 @@ matrix:
8893 env :
8994 - OPTIONAL_DEPENDS="indexed_gzip"
9095before_install :
91- - source tools/travis_tools.sh
92- - python -m pip install --upgrade pip
93- - pip install --upgrade virtualenv
96+ - travis_retry python -m pip install --upgrade pip
97+ - travis_retry pip install --upgrade virtualenv
9498 - virtualenv --python=python venv
9599 - source venv/bin/activate
96100 - python --version # just to check
97- - pip install -U pip wheel # needed at one point
98- - retry pip install nose flake8 mock # always
99- - pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
100- - if [ "${COVERAGE}" == "1" ]; then
101- pip install coverage;
102- pip install coveralls;
103- pip install codecov ;
101+ - travis_retry pip install -U pip setuptools>=27.0 wheel
102+ - travis_retry pip install coverage
103+ - if [ "${CHECK_TYPE}" == "test" ]; then
104+ travis_retry pip install nose mock;
105+ fi
106+ - if [ "${CHECK_TYPE}" == "style" ]; then
107+ travis_retry pip install flake8 ;
104108 fi
109+ - travis_retry pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
105110# command to install dependencies
106111install :
107112 - |
@@ -112,7 +117,6 @@ install:
112117 python setup_egg.py sdist
113118 pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
114119 elif [ "$INSTALL_TYPE" == "wheel" ]; then
115- pip install wheel
116120 python setup_egg.py bdist_wheel
117121 pip install $EXTRA_PIP_FLAGS dist/*.whl
118122 elif [ "$INSTALL_TYPE" == "requirements" ]; then
@@ -124,28 +128,35 @@ install:
124128# command to run tests, e.g. python setup.py test
125129script :
126130 - |
127- if [ "${STYLE }" == "1 " ]; then
131+ if [ "${CHECK_TYPE }" == "style " ]; then
128132 # Run styles only on core nibabel code.
129133 flake8 nibabel
130- else
134+ elif [ "${CHECK_TYPE}" == "import" ]; then
135+ # Import nibabel without attempting to test
136+ # Allows us to check missing dependencies masked by testing libraries
137+ printf 'import nibabel\nprint(nibabel.__version__)\n' > import_only.py
138+ cat import_only.py
139+ coverage run import_only.py
140+ elif [ "${CHECK_TYPE}" == "doc_doctests" ]; then
141+ cd doc
142+ pip install -r ../doc-requirements.txt
143+ make html;
144+ make doctest;
145+ elif [ "${CHECK_TYPE}" == "test" ]; then
131146 # Change into an innocuous directory and find tests from installation
132147 mkdir for_testing
133148 cd for_testing
134- if [ "${COVERAGE}" == "1" ]; then
135- cp ../.coveragerc .;
136- COVER_ARGS="--with-coverage --cover-package nibabel";
137- fi
138- if [ "$DOC_DOC_TEST" == "1" ]; then
139- cd ../doc;
140- pip install -r ../doc-requirements.txt
141- make html;
142- make doctest;
143- else
144- nosetests --with-doctest $COVER_ARGS nibabel;
145- fi
149+ cp ../.coveragerc .
150+ nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
151+ else
152+ false
146153 fi
147154after_success :
148- - if [ "${COVERAGE}" == "1" ]; then coveralls; codecov; fi
155+ - |
156+ if [ "${CHECK_TYPE}" == "test" ]; then
157+ travis_retry pip install codecov
158+ codecov
159+ fi
149160
150161notifications :
151162 webhooks : http://nipy.bic.berkeley.edu:54856/travis
0 commit comments