-
Notifications
You must be signed in to change notification settings - Fork 260
/
Copy path.travis.yml
160 lines (150 loc) · 4.99 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
# 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
os: linux
arch: amd64
dist: xenial
language: python
cache: pip
env:
global:
- SETUP_REQUIRES="pip setuptools>=30.3.0 wheel"
- DEPENDS="numpy scipy matplotlib h5py pillow pydicom indexed_gzip"
- INSTALL_TYPE="setup"
- CHECK_TYPE="test"
- EXTRA_WHEELS="https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com"
- NIGHTLY_WHEELS="https://pypi.anaconda.org/scipy-wheels-nightly/simple"
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --extra-index-url $NIGHTLY_WHEELS"
python:
- 3.7
- 3.8
jobs:
include:
- arch: arm64
python: 3.6
env:
- DEPENDS="numpy"
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
# Basic dependencies only
- python: 3.6
env:
- DEPENDS="-r requirements.txt"
# Clean install
- python: 3.6
env:
- DEPENDS=""
- CHECK_TYPE=skiptests
# Absolute minimum dependencies
- python: 3.6
env:
- SETUP_REQUIRES="setuptools==30.3.0"
- DEPENDS="-r min-requirements.txt"
# Absolute minimum dependencies plus oldest MPL
- python: 3.6
env:
- DEPENDS="-r min-requirements.txt matplotlib==1.5.3"
# Minimum pydicom dependency
- python: 3.6
env:
- DEPENDS="-r min-requirements.txt pydicom==0.9.9 pillow==2.6"
# pydicom master branch
- python: 3.6
env:
- DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master"
# test 3.8 against pre-release builds of everything
- python: 3.8
env:
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
# OSX Python support is basically accidental. Take whatever version we can
# get and test with full dependencies...
- os: osx
language: minimal
# and pre-releases. No min-requirements.txt because we can't assume a wheel that old.
- os: osx
language: minimal
env:
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
# Test that PyPI installs from source pass
- python: 3.6
env:
- INSTALL_TYPE=sdist
# Wheels (binary distributions)
- python: 3.6
env:
- INSTALL_TYPE=wheel
# Install from git archive (e.g., https://github.com/nipy/nibabel/archive/master.zip)
- python: 3.6
env:
- INSTALL_TYPE=archive
# Run flake8... Might not be needed now we have pep8speaks
- python: 3.6
env:
- CHECK_TYPE="style"
# Documentation doctests
- python: 3.6
env:
- CHECK_TYPE="doc"
# Set up virtual environment, build package, build from depends
before_install:
- travis_retry python3 -m pip install --upgrade pip virtualenv
- virtualenv --python=python3 venv
- source venv/bin/activate
- python3 --version # just to check
- travis_retry python3 -m pip install -U $SETUP_REQUIRES
- which python3
- which pip
- |
if [ "$INSTALL_TYPE" == "sdist" ]; then
python3 setup.py egg_info # check egg_info while we're here
python3 setup.py sdist
export ARCHIVE=$( ls dist/*.tar.gz )
elif [ "$INSTALL_TYPE" == "wheel" ]; then
python3 setup.py bdist_wheel
export ARCHIVE=$( ls dist/*.whl )
elif [ "$INSTALL_TYPE" == "archive" ]; then
export ARCHIVE="package.tar.gz"
git archive -o $ARCHIVE HEAD
fi
- if [ -n "$DEPENDS" ]; then pip install $EXTRA_PIP_FLAGS $DEPENDS; fi
# command to install dependencies
install:
- |
if [ "$INSTALL_TYPE" == "setup" ]; then
python3 setup.py install
else
pip install $EXTRA_PIP_FLAGS $ARCHIVE
fi
# Basic import check
- python3 -c 'import nibabel; print(nibabel.__version__)'
- if [ "$CHECK_TYPE" == "skiptests" ]; then exit 0; fi
before_script:
# Point to nibabel data directory
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
# Because nibabel is already installed, will just look up the extra
- python3 -m pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
# 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}" == "doc" ]; then
cd doc
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 .
pytest --doctest-modules --cov nibabel -v --pyargs nibabel
else
false
fi
after_script:
- travis_retry python3 -m pip install codecov
- codecov
notifications:
webhooks: http://nipy.bic.berkeley.edu:54856/travis