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