@@ -8,39 +8,38 @@ dist: xenial
8
8
sudo : true
9
9
language : python
10
10
11
- cache : pip
11
+ cache :
12
+ directories :
13
+ - $HOME/.cache/pip
12
14
env :
13
15
global :
14
- - SETUP_REQUIRES="pip setuptools>=30.3.0 wheel "
15
- - DEPENDS="numpy scipy matplotlib h5py pillow pydicom indexed_gzip "
16
+ - DEPENDS="six numpy scipy matplotlib h5py pillow pydicom "
17
+ - OPTIONAL_DEPENDS=" "
16
18
- INSTALL_TYPE="setup"
17
19
- CHECK_TYPE="test"
18
20
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
19
21
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
20
22
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
21
23
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
22
-
23
24
python :
24
25
- 3.6
25
26
- 3.7
26
-
27
27
matrix :
28
28
include :
29
- # Basic dependencies only
30
- - python : 3.5
31
- env :
32
- - DEPENDS="-r requirements.txt"
33
- # Clean install
29
+ # Absolute minimum dependencies
34
30
- python : 3.5
35
31
env :
36
- - DEPENDS=""
37
- - CHECK_TYPE=skiptests
32
+ - DEPENDS="-r min-requirements.txt setuptools==30.3.0"
38
33
# Absolute minimum dependencies
39
34
- python : 3.5
40
35
env :
41
- - SETUP_REQUIRES="setuptools==30.3.0"
42
36
- DEPENDS="-r min-requirements.txt"
37
+ - CHECK_TYPE="import"
43
38
# Absolute minimum dependencies plus oldest MPL
39
+ # Check these against:
40
+ # nibabel/info.py
41
+ # doc/source/installation.rst
42
+ # requirements.txt
44
43
- python : 3.5
45
44
env :
46
45
- DEPENDS="-r min-requirements.txt matplotlib==1.3.1"
@@ -52,8 +51,8 @@ matrix:
52
51
- python : 3.5
53
52
env :
54
53
- DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master"
55
- # test 3.7 against pre-release builds of everything
56
- - python : 3.7
54
+ # test 3.5 against pre-release builds of everything
55
+ - python : 3.5
57
56
env :
58
57
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
59
58
- python : 3.5
@@ -62,6 +61,9 @@ matrix:
62
61
- python : 3.5
63
62
env :
64
63
- INSTALL_TYPE=wheel
64
+ - python : 3.5
65
+ env :
66
+ - INSTALL_TYPE=requirements
65
67
- python : 3.5
66
68
env :
67
69
- INSTALL_TYPE=archive
@@ -71,55 +73,62 @@ matrix:
71
73
# Documentation doctests
72
74
- python : 3.5
73
75
env :
74
- - CHECK_TYPE="doc"
75
-
76
- # Set up virtual environment, build package, build from depends
76
+ - CHECK_TYPE="doc_doctests"
77
+ # Run tests with indexed_gzip present
78
+ - python : 3.5
79
+ env :
80
+ - OPTIONAL_DEPENDS="indexed_gzip"
77
81
before_install :
78
- - travis_retry python -m pip install --upgrade pip virtualenv
82
+ - travis_retry python -m pip install --upgrade pip
83
+ - travis_retry pip install --upgrade virtualenv
79
84
- virtualenv --python=python venv
80
85
- source venv/bin/activate
81
86
- python --version # just to check
82
- - travis_retry pip install -U $SETUP_REQUIRES
83
- - |
84
- if [ "$INSTALL_TYPE" == "sdist" ]; then
85
- python setup.py egg_info # check egg_info while we're here
86
- python setup.py sdist
87
- export ARCHIVE=$( ls dist/*.tar.gz )
88
- elif [ "$INSTALL_TYPE" == "wheel" ]; then
89
- python setup.py bdist_wheel
90
- export ARCHIVE=$( ls dist/*.whl )
91
- elif [ "$INSTALL_TYPE" == "archive" ]; then
92
- export ARCHIVE="package.tar.gz"
93
- git archive -o $ARCHIVE HEAD
87
+ - travis_retry pip install -U pip setuptools>=27.0 wheel
88
+ - travis_retry pip install coverage
89
+ - if [ "${CHECK_TYPE}" == "test" ]; then
90
+ travis_retry pip install nose mock;
94
91
fi
95
- - if [ -n "$DEPENDS" ]; then pip install $EXTRA_PIP_FLAGS $DEPENDS; fi
96
-
92
+ - if [ "${CHECK_TYPE}" == "style" ]; then
93
+ travis_retry pip install flake8;
94
+ fi
95
+ - travis_retry pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
97
96
# command to install dependencies
98
97
install :
99
98
- |
100
99
if [ "$INSTALL_TYPE" == "setup" ]; then
101
100
python setup.py install
102
- else
103
- pip install $EXTRA_PIP_FLAGS $ARCHIVE
101
+ elif [ "$INSTALL_TYPE" == "sdist" ]; then
102
+ python setup_egg.py egg_info # check egg_info while we're here
103
+ python setup_egg.py sdist
104
+ pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
105
+ elif [ "$INSTALL_TYPE" == "wheel" ]; then
106
+ python setup_egg.py bdist_wheel
107
+ pip install $EXTRA_PIP_FLAGS dist/*.whl
108
+ elif [ "$INSTALL_TYPE" == "requirements" ]; then
109
+ pip install $EXTRA_PIP_FLAGS -r requirements.txt
110
+ python setup.py install
111
+ elif [ "$INSTALL_TYPE" == "archive" ]; then
112
+ git archive -o package.tar.gz HEAD
113
+ pip install $EXTRA_PIP_FLAGS package.tar.gz
104
114
fi
105
- # Basic import check
106
- - python -c 'import nibabel; print(nibabel.__version__)'
107
- - if [ "$CHECK_TYPE" == "skiptests" ]; then exit 0; fi
108
-
109
- before_script :
110
115
# Point to nibabel data directory
111
116
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
112
- # Because nibabel is already installed, will just look up the extra
113
- - pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
114
-
115
117
# command to run tests, e.g. python setup.py test
116
118
script :
117
119
- |
118
120
if [ "${CHECK_TYPE}" == "style" ]; then
119
121
# Run styles only on core nibabel code.
120
122
flake8 nibabel
121
- elif [ "${CHECK_TYPE}" == "doc" ]; then
123
+ elif [ "${CHECK_TYPE}" == "import" ]; then
124
+ # Import nibabel without attempting to test
125
+ # Allows us to check missing dependencies masked by testing libraries
126
+ printf 'import nibabel\nprint(nibabel.__version__)\n' > import_only.py
127
+ cat import_only.py
128
+ coverage run import_only.py
129
+ elif [ "${CHECK_TYPE}" == "doc_doctests" ]; then
122
130
cd doc
131
+ pip install -r ../doc-requirements.txt
123
132
make html;
124
133
make doctest;
125
134
elif [ "${CHECK_TYPE}" == "test" ]; then
@@ -131,10 +140,12 @@ script:
131
140
else
132
141
false
133
142
fi
134
-
135
- after_script :
136
- - travis_retry pip install codecov
137
- - codecov
143
+ after_success :
144
+ - |
145
+ if [ "${CHECK_TYPE}" == "test" ]; then
146
+ travis_retry pip install codecov
147
+ codecov
148
+ fi
138
149
139
150
notifications :
140
151
webhooks : http://nipy.bic.berkeley.edu:54856/travis
0 commit comments