forked from vispy/vispy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
231 lines (209 loc) · 8.77 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
language: python
# use container-based infrastructure
sudo : false
# install a newer cmake since at this time Travis only has version 2.8.7
# liblgfw2 is not whitelisted by Travis, so we don't try using it here (not usable anyway)
addons:
apt:
sources:
- &full_sources [kalakris-cmake]
packages:
- &mesa_apt [libgl1-mesa-dri]
- &full_apt [libegl1-mesa, cmake, xorg-dev, libglu1-mesa-dev, mercurial, libdbus-1-dev, libgl1-mesa-dev, libglu1-mesa-dev, libpulse-dev, libx11-dev, libxcursor-dev, libxext-dev, libxi-dev, libxinerama-dev, libxrandr-dev, libxss-dev, libxt-dev, libxv-dev, libxxf86vm-dev, libasound2-dev, libts-dev, libudev-dev]
# Here we use Anaconda for our builds, since it provides the simplest
# interface for running different versions of Python. We could also use
# it for 2.7, but the Ubuntu system has installable 2.7 Qt4-GL, which
# allows for more complete testing.
# Size testing can be skipped by adding "[size skip]" within a commit message.
matrix:
include:
# Enable python 2 and python 3 builds
# Note that the 2.6 build doesn't get flake8, and runs old versions of
# Pyglet and GLFW to make sure we deal with those correctly
# IPython 1.2.1 is the last version of IPython for python2.6
# source: https://pypi.python.org/pypi/ipython/1.2.1
- env: PYTHON=2.6 DEPS=full TEST=standard # functionality
addons:
apt:
sources:
packages:
- *mesa_apt
- env: PYTHON=2.7 DEPS=full TEST=standard IPYTHON="=2" NUMPY="=1.7"
addons:
apt:
sources:
- *full_sources
packages:
- *mesa_apt
- *full_apt
# OSMesa requires a specific Travis run because since the system also
# has (on-screen) OpenGL installed, we need to setup environment variable
# to avoid having the linker load the wrong libglapi.so which would cause
# OSMesa to crash
- env: PYTHON=2.7 DEPS=full TEST=osmesa IPYTHON="=2" NUMPY="=1.7"
addons:
apt:
sources:
- *full_sources
packages:
- *full_apt
- env: PYTHON=3.4 DEPS=full TEST=standard
addons:
apt:
sources:
- *full_sources
packages:
- *mesa_apt
- *full_apt
- env: PYTHON=3.4 DEPS=backend TEST=examples # test examples
addons:
apt:
sources:
packages:
- *mesa_apt
- env: PYTHON=3.4 DEPS=minimal TEST=standard # also tests file sizes, style, line endings
addons:
apt:
packages:
before_install:
- REDIRECT_TO=/dev/stdout # change to /dev/null to silence Travis
- wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b -p ~/anaconda &> ${REDIRECT_TO}
- export PATH=~/anaconda/bin:$PATH
- conda update --yes --quiet conda &> ${REDIRECT_TO}
- SRC_DIR=$(pwd)
# file size checks run on minimal build for time
- if [ "${DEPS}" == "minimal" ]; then
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
GIT_SOURCE_EXTRA="+refs/pull/${TRAVIS_PULL_REQUEST}/merge";
else
GIT_TARGET_EXTRA="";
GIT_SOURCE_EXTRA="";
fi;
cd ~;
mkdir target-size-clone && cd target-size-clone;
git init &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &>${REDIRECT_TO};
git fetch origin ${GIT_TARGET_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO};
git tag travis-merge-target &> ${REDIRECT_TO};
git gc --aggressive &> ${REDIRECT_TO};
TARGET_SIZE=`du -s . | sed -e "s/\t.*//"`;
git pull origin ${GIT_SOURCE_EXTRA} &> ${REDIRECT_TO};
git gc --aggressive &> ${REDIRECT_TO};
MERGE_SIZE=`du -s . | sed -e "s/\t.*//"`;
if [ "${MERGE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr \( ${MERGE_SIZE} - ${TARGET_SIZE} \)`;
else
SIZE_DIFF=0;
fi;
fi;
install:
# Install numpy, flake
- conda create -n testenv --yes --quiet pip python=$PYTHON > ${REDIRECT_TO};
- source activate testenv > ${REDIRECT_TO};
- conda install --yes --quiet numpy$NUMPY nose pytest > ${REDIRECT_TO};
- pip install -q coveralls pytest-cov
# Dont install flake8 on 2.6 to make sure tests still run without it
- if [ "${PYTHON}" != "2.6" ]; then
pip install -q flake8;
else
pip install -q unittest2;
fi
# On 3.4, install system-wide copies of bundled libraries instead
# Use Pyglet alpha to get Py3.4 support
# Also install PyQt4, imaging (PIL or pillow), scipy, mpl, egl
# On conda, can't install pyside-pyzo b/c it conflicts with pyqt4,
# which is required by matplotlib :(
# No wx on py27 or py34, wxpython doesn't work properly there
# If we only need a single backend (DEPS=backend), then use PyQT4
- if [ "${DEPS}" == "backend" ]; then
conda install --yes --quiet pyqt=4 pyopengl;
elif [ "${DEPS}" == "full" ]; then
conda install --yes --quiet pyqt=4 pyopengl;
pip install -q pyglet;
if [ "${PYTHON}" == "2.6" ]; then
conda install --yes --quiet wxpython numpy$NUMPY > ${REDIRECT_TO};
else
conda install --yes --quiet ipython$IPYTHON ipython-notebook numpy$NUMPY networkx > ${REDIRECT_TO};
fi;
if [ "${PYTHON}" == "3.4" ]; then
pip install -q freetype-py husl pypng cassowary > ${REDIRECT_TO};
conda install --yes --quiet pillow scipy pyqt=4 matplotlib decorator six numpy$NUMPY > ${REDIRECT_TO};
rm -rf ${SRC_DIR}/vispy/ext/_bundled;
fi;
fi;
# Install vispy
- cd ${SRC_DIR}
- python setup.py install > ${REDIRECT_TO}
- python setup.py develop > ${REDIRECT_TO}
- cd ~
# GLFW: version 2 shouldn't work (so let's try on Py2.6), version 3 will
# We can't use most recent builds because our CMake is too old :(
- if [ "${PYTHON}" != "2.6" ] && [ "${DEPS}" == "full" ]; then
git clone git://github.com/glfw/glfw.git &> ${REDIRECT_TO};
cd glfw;
git checkout 5b6e671;
cmake -DCMAKE_INSTALL_PREFIX=$HOME -DBUILD_SHARED_LIBS=true -DGLFW_BUILD_EXAMPLES=false -DGLFW_BUILD_TESTS=false -DGLFW_BUILD_DOCS=false . &> ${REDIRECT_TO};
make install &> ${REDIRECT_TO};
cd ~;
export GLFW_LIBRARY=${HOME}/lib/libglfw.so;
fi
# Install SDL2 (on 2.6, let's only install PySDL2 to test handling)
- if [ "${DEPS}" == "full" ]; then
if [ "${PYTHON}" != "2.6" ]; then
wget -q http://www.libsdl.org/release/SDL2-2.0.3.tar.gz;
tar xzf SDL2-2.0.3.tar.gz &> ${REDIRECT_TO};
cd SDL2-2.0.3;
mkdir build;
cd build;
../configure --prefix=$HOME --disable-audio --disable-render --disable-joystick --disable-haptic --disable-power --disable-cpuinfo &> ${REDIRECT_TO};
make -j 2 &> ${REDIRECT_TO};
make install &> ${REDIRECT_TO};
export PYSDL2_DLL_PATH=${HOME}/lib;
fi;
pip install -q PySDL2;
fi;
# Install OSMesa
- wget https://github.com/vispy/demo-data/raw/master/osmesa/osmesa_11.0.0_12.04.tar.bz2 -O /tmp/osmesa.tar.bz2
- mkdir $HOME/osmesa; tar -xvjf /tmp/osmesa.tar.bz2 -C $HOME/osmesa
before_script:
# We need to create a (fake) display on Travis, let's use a funny resolution
- if [ "${TEST}" != "osmesa" ]; then
export DISPLAY=:99.0;
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render;
fi;
- if [ "${TEST}" == "osmesa" ]; then
export LD_LIBRARY_PATH=$HOME/osmesa/lib;
export LIBRARY_PATH=$HOME/osmesa/lib;
fi;
script:
- cd ${SRC_DIR}
- if [ "${TEST}" == "standard" ]; then
make unit;
fi;
- if [ "${TEST}" == "examples" ] || [ "${DEPS}" == "minimal" ]; then
make examples;
fi;
- if [ "${DEPS}" == "minimal" ]; then
make extra;
fi;
- if [ "${TEST}" == "osmesa" ]; then
make osmesa;
fi;
# Each line must be run in a separate line to ensure exit code accuracy
- if [ "${DEPS}" == "minimal" ]; then
echo "Size difference ${SIZE_DIFF} kB";
if git log --format=%B -n 2 | grep -q "\[size skip\]"; then
echo "Skipping size test";
else
test ${SIZE_DIFF} -lt 100;
fi;
fi;
after_success:
# Need to run from source dir to execute appropriate "git" commands
- if [ "${TEST}" == "standard" ]; then
COVERAGE_FILE=.vispy-coverage coverage combine;
mv .vispy-coverage .coverage;
coveralls;
fi;