4
4
# for it to be on multiple physical lines, so long as you remember: - There
5
5
# can't be any leading "-"s - All newlines will be removed, so use ";"s
6
6
7
+ dist : xenial
8
+ sudo : true
7
9
language : python
8
10
9
- # Run jobs on container-based infrastructure, can be overridden per job
10
- sudo : false
11
-
12
11
cache :
13
12
directories :
14
13
- $HOME/.cache/pip
17
16
- DEPENDS="six numpy scipy matplotlib h5py pillow pydicom"
18
17
- OPTIONAL_DEPENDS=""
19
18
- INSTALL_TYPE="setup"
19
+ - CHECK_TYPE="test"
20
20
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
21
21
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
22
22
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
23
23
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
24
24
python :
25
- - 3.4
26
25
- 3.5
27
26
- 3.6
27
+ - 3.7
28
28
matrix :
29
29
include :
30
+ - python : 3.4
31
+ dist : trusty
32
+ sudo : false
33
+ # Absolute minimum dependencies
30
34
- python : 2.7
31
35
env :
32
- - COVERAGE=1
36
+ - DEPENDS="numpy==1.8"
33
37
# Absolute minimum dependencies
34
38
- python : 2.7
35
39
env :
36
- - DEPENDS="numpy==1.7.1"
40
+ - DEPENDS="numpy==1.8"
41
+ - CHECK_TYPE="import"
37
42
# Absolute minimum dependencies plus oldest MPL
38
43
# Check these against:
39
44
# nibabel/info.py
40
45
# doc/source/installation.rst
41
46
# requirements.txt
42
47
- python : 2.7
43
48
env :
44
- - DEPENDS="numpy==1.7.1 matplotlib==1.3.1"
49
+ - DEPENDS="numpy==1.8 matplotlib==1.3.1"
45
50
# Minimum pydicom dependency
46
51
- python : 2.7
47
52
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"
49
54
# pydicom master branch
50
55
- python : 3.5
51
56
env :
@@ -58,10 +63,6 @@ matrix:
58
63
- python : 3.5
59
64
env :
60
65
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
61
- # Documentation doctests
62
- - python : 2.7
63
- env :
64
- - DOC_DOC_TEST=1
65
66
- python : 2.7
66
67
env :
67
68
- INSTALL_TYPE=sdist
@@ -73,13 +74,17 @@ matrix:
73
74
- INSTALL_TYPE=requirements
74
75
- python : 2.7
75
76
env :
76
- - STYLE=1
77
+ - CHECK_TYPE="style"
77
78
- python : 3.5
78
79
env :
79
- - STYLE=1
80
+ - CHECK_TYPE="style"
81
+ # Documentation doctests
82
+ - python : 2.7
83
+ env :
84
+ - CHECK_TYPE="doc_doctests"
80
85
- python : 3.5
81
86
env :
82
- - DOC_DOC_TEST=1
87
+ - CHECK_TYPE="doc_doctests"
83
88
# Run tests with indexed_gzip present
84
89
- python : 2.7
85
90
env :
@@ -88,20 +93,20 @@ matrix:
88
93
env :
89
94
- OPTIONAL_DEPENDS="indexed_gzip"
90
95
before_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
94
98
- virtualenv --python=python venv
95
99
- source venv/bin/activate
96
100
- 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 ;
104
108
fi
109
+ - travis_retry pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
105
110
# command to install dependencies
106
111
install :
107
112
- |
@@ -112,7 +117,6 @@ install:
112
117
python setup_egg.py sdist
113
118
pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
114
119
elif [ "$INSTALL_TYPE" == "wheel" ]; then
115
- pip install wheel
116
120
python setup_egg.py bdist_wheel
117
121
pip install $EXTRA_PIP_FLAGS dist/*.whl
118
122
elif [ "$INSTALL_TYPE" == "requirements" ]; then
@@ -124,28 +128,35 @@ install:
124
128
# command to run tests, e.g. python setup.py test
125
129
script :
126
130
- |
127
- if [ "${STYLE }" == "1 " ]; then
131
+ if [ "${CHECK_TYPE }" == "style " ]; then
128
132
# Run styles only on core nibabel code.
129
133
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
131
146
# Change into an innocuous directory and find tests from installation
132
147
mkdir for_testing
133
148
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
146
153
fi
147
154
after_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
149
160
150
161
notifications :
151
162
webhooks : http://nipy.bic.berkeley.edu:54856/travis
0 commit comments