forked from nipy/nibabel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
162 lines (159 loc) · 5.08 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# vim ft=yaml
# Multiple lines can be made a single "virtual line" because of how Travis
# munges each line before executing it to print out the exit status. 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
dist: xenial
sudo: true
language: python
cache:
directories:
- $HOME/.cache/pip
env:
global:
- DEPENDS="six numpy scipy matplotlib h5py pillow pydicom"
- OPTIONAL_DEPENDS=""
- INSTALL_TYPE="setup"
- CHECK_TYPE="test"
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
python:
- 3.5
- 3.6
- 3.7
matrix:
include:
- python: 3.4
dist: trusty
sudo: false
# Absolute minimum dependencies
- python: 2.7
env:
- DEPENDS="numpy==1.8 setuptools==30.3.0"
# Absolute minimum dependencies
- python: 2.7
env:
- DEPENDS="numpy==1.8"
- CHECK_TYPE="import"
# Absolute minimum dependencies plus oldest MPL
# Check these against:
# nibabel/info.py
# doc/source/installation.rst
# requirements.txt
- python: 2.7
env:
- DEPENDS="numpy==1.8 matplotlib==1.3.1"
# Minimum pydicom dependency
- python: 2.7
env:
- DEPENDS="numpy==1.8 pydicom==0.9.9 pillow==2.6"
# pydicom master branch
- python: 3.5
env:
- DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master"
# test 2.7 against pre-release builds of everything
- python: 2.7
env:
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
# test 3.5 against pre-release builds of everything
- python: 3.5
env:
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
- python: 2.7
env:
- INSTALL_TYPE=sdist
- python: 2.7
env:
- INSTALL_TYPE=wheel
- python: 2.7
env:
- INSTALL_TYPE=requirements
- python: 2.7
env:
- CHECK_TYPE="style"
- python: 3.5
env:
- CHECK_TYPE="style"
# Documentation doctests
- python: 2.7
env:
- CHECK_TYPE="doc_doctests"
- python: 3.5
env:
- CHECK_TYPE="doc_doctests"
# Run tests with indexed_gzip present
- python: 2.7
env:
- OPTIONAL_DEPENDS="indexed_gzip"
- python: 3.5
env:
- OPTIONAL_DEPENDS="indexed_gzip"
before_install:
- travis_retry python -m pip install --upgrade pip
- travis_retry pip install --upgrade virtualenv
- virtualenv --python=python venv
- source venv/bin/activate
- python --version # just to check
- travis_retry pip install -U pip setuptools>=27.0 wheel
- travis_retry pip install coverage
- if [ "${CHECK_TYPE}" == "test" ]; then
travis_retry pip install nose mock;
fi
- if [ "${CHECK_TYPE}" == "style" ]; then
travis_retry pip install flake8;
fi
- travis_retry pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
# command to install dependencies
install:
- |
if [ "$INSTALL_TYPE" == "setup" ]; then
python setup.py install
elif [ "$INSTALL_TYPE" == "sdist" ]; then
python setup_egg.py egg_info # check egg_info while we're here
python setup_egg.py sdist
pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
elif [ "$INSTALL_TYPE" == "wheel" ]; then
python setup_egg.py bdist_wheel
pip install $EXTRA_PIP_FLAGS dist/*.whl
elif [ "$INSTALL_TYPE" == "requirements" ]; then
pip install $EXTRA_PIP_FLAGS -r requirements.txt
python setup.py install
fi
# Point to nibabel data directory
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
# command to run tests, e.g. python setup.py test
script:
- |
if [ "${CHECK_TYPE}" == "style" ]; then
# Run styles only on core nibabel code.
flake8 nibabel
elif [ "${CHECK_TYPE}" == "import" ]; then
# Import nibabel without attempting to test
# Allows us to check missing dependencies masked by testing libraries
printf 'import nibabel\nprint(nibabel.__version__)\n' > import_only.py
cat import_only.py
coverage run import_only.py
elif [ "${CHECK_TYPE}" == "doc_doctests" ]; then
cd doc
pip install -r ../doc-requirements.txt
make html;
make doctest;
elif [ "${CHECK_TYPE}" == "test" ]; then
# Change into an innocuous directory and find tests from installation
mkdir for_testing
cd for_testing
cp ../.coveragerc .
nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
else
false
fi
after_success:
- |
if [ "${CHECK_TYPE}" == "test" ]; then
travis_retry pip install codecov
codecov
fi
notifications:
webhooks: http://nipy.bic.berkeley.edu:54856/travis