forked from vispy/vispy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
177 lines (156 loc) · 7.13 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
language: python
# Here we use anaconda for 2.6 and 3.4, 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.
virtualenv:
system_site_packages: true
env:
# 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
- PYTHON=2.6 DEPS=full TEST=standard # functionality
- PYTHON=2.7 DEPS=full TEST=standard
- PYTHON=2.7 DEPS=minimal TEST=standard
- PYTHON=3.4 DEPS=full TEST=standard
- PYTHON=3.4 DEPS=minimal TEST=extra # test file sizes, style, line endings
before_install:
- REDIRECT_TO=/dev/stdout # change to /dev/null to silence Travis
- travis_retry sudo apt-get -qq update;
- if [ "${PYTHON}" != "2.7" ]; then
wget -q http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh;
chmod +x miniconda.sh;
./miniconda.sh -b &> ${REDIRECT_TO};
export PATH=/home/$USER/anaconda/bin:$PATH;
conda update --yes --quiet conda &> ${REDIRECT_TO};
travis_retry sudo apt-get -qq -y install libgl1-mesa-dri;
fi;
- SRC_DIR=$(pwd)
# file size checks
- if [ "${TEST}" == "extra" ]; 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} && cd ..;
TARGET_SIZE=`du -s target-size-clone | sed -e "s/\t.*//"`;
mkdir source-size-clone && cd source-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_SOURCE_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
SOURCE_SIZE=`du -s source-size-clone | sed -e "s/\t.*//"`;
if [ "${SOURCE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr ${SOURCE_SIZE} - ${TARGET_SIZE}`;
else
SIZE_DIFF=0;
fi;
fi;
install:
# Install numpy, nose, flake
- if [ "${PYTHON}" != "2.7" ]; then
conda create -n testenv --yes --quiet pip python=$PYTHON > ${REDIRECT_TO};
source activate testenv > ${REDIRECT_TO};
conda install --yes --quiet numpy nose > ${REDIRECT_TO};
else
travis_retry sudo apt-get -qq -y install python-numpy python-nose python-setuptools > ${REDIRECT_TO};
fi;
- pip install -q coveralls nose-timer
# 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
# helpful for debugging faults
- if [ "${PYTHON}" != 3.4 ]; then
pip install -q nose-faulthandler;
fi
# Install PyOpenGL
- if [ "${DEPS}" == "full" ]; then
travis_retry sudo apt-get -qq -y install freeglut3 > ${REDIRECT_TO};
if [ "${PYTHON}" == "2.7" ]; then
echo "Using OpenGL stable version (repos)";
travis_retry sudo apt-get -qq -y install python-opengl > ${REDIRECT_TO};
else
echo "Using OpenGL stable version (pip)";
pip install -q PyOpenGL;
fi;
fi;
# Use Pyglet alpha to get Py3.4 support
# Also install PyQt4, imaging (PIL or pillow) and scipy
# Test old (insufficient) version of Pyglet on 2.6
- if [ "${DEPS}" == "full" ]; then
if [ "${PYTHON}" == "2.6" ]; then
pip install -q pyglet;
else
pip install -q http://pyglet.googlecode.com/archive/tip.zip;
fi;
if [ "${PYTHON}" == "3.4" ]; then
conda install --yes --quiet -c https://conda.binstar.org/pyzo pyside-pyzo > /dev/null;
conda install --yes --quiet pillow > ${REDIRECT_TO};
conda install --yes --quiet scipy > ${REDIRECT_TO};
fi;
if [ "${PYTHON}" == "2.7" ]; then
travis_retry sudo apt-get -qq -y install python-qt4-gl python-imaging python-scipy > ${REDIRECT_TO};
fi;
fi;
# Install vispy
- cd ${SRC_DIR}
- python setup.py install > ${REDIRECT_TO}
- cd ~
# GLFW: version 2 shouldn't work (so let's try on Py2.6), version 3 will
- if [ "${PYTHON}" == "2.6" ] && [ "${DEPS}" == "full" ]; then
travis_retry sudo apt-get -qq install libglfw2 > ${REDIRECT_TO};
fi
- if [ "${PYTHON}" != "2.6" ] && [ "${DEPS}" == "full" ]; then
travis_retry sudo apt-get -qq install xorg-dev libglu1-mesa-dev > ${REDIRECT_TO};
git clone git://github.com/glfw/glfw.git &> ${REDIRECT_TO};
cd glfw;
cmake -DBUILD_SHARED_LIBS=true -DGLFW_BUILD_EXAMPLES=false -DGLFW_BUILD_TESTS=false -DGLFW_BUILD_DOCS=false . > ${REDIRECT_TO};
sudo make install > ${REDIRECT_TO};
fi
# Install SDL2 (on 2.6, let's only install sdl2-python to test handling)
- if [ "${DEPS}" == "full" ]; then
if [ "${PYTHON}" != "2.6" ]; then
cd ~;
travis_retry sudo apt-get -qq -y install 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 > ${REDIRECT_TO};
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 --disable-audio --disable-render --disable-joystick --disable-haptic --disable-power --disable-cpuinfo &> ${REDIRECT_TO};
make -j 2 &> ${REDIRECT_TO};
sudo make install &> ${REDIRECT_TO};
fi;
pip install -q PySDL2;
fi;
# after manual builds we need to update .so search
- sudo ldconfig
before_script:
# We need to create a (fake) display on Travis, let's use a funny resolution
- 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
script:
- cd ${SRC_DIR}
- if [ "${TEST}" != "extra" ]; then
make nose_coverage;
fi;
# Require strict adherence to PEP8 and pyflakes (can use "# noqa" to skip)
- if [ "${TEST}" == "extra" ]; then
make extra;
fi;
- if [ "${TEST}" == "extra" ]; then
echo "Size difference ${SIZE_DIFF} kB";
test ${SIZE_DIFF} -lt 100;
fi;
after_success:
# Need to run from source dir to execute appropriate "git" commands
- if [ "${TEST}" != "extra" ]; then
coveralls;
fi;