forked from vispy/vispy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
180 lines (162 loc) · 7.35 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
language: generic
os: linux
dist: xenial
addons:
apt:
packages:
- &mesa_apt [libgl1-mesa-dri]
- &full_apt [libgl1-mesa-dri, 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, libudev-dev, libsdl2-2.0-0]
# full_apt should also have 'libts-dev' but it is not available on xenial
# liblgfw2 is not whitelisted by Travis, so we don't try using it here (not usable anyway)
# Size testing can be skipped by adding "[size skip]" within a commit message.
matrix:
include:
- env: PYTHON_VERSION=3.7 DEPS=minimal TEST=standard
CONDA_DEPENDENCIES="numpy scipy pytest<5.4 cython coveralls pytest-cov pytest-sugar!=0.9.3 meshio"
CONDA_CHANNELS=conda-forge
CONDA_CHANNEL_PRIORITY=strict
PIP_DEPENDENCIES="numpydoc"
os: osx
osx_image: xcode10.1
- env: PYTHON_VERSION=3.7 DEPS=full TEST=standard
CONDA_DEPENDENCIES="numpy scipy pytest<5.4 cython coveralls pytest-cov pytest-sugar!=0.9.3 pyopengl networkx pysdl2 matplotlib jupyter pyqt=5 scikit-image meshio"
CONDA_CHANNELS=conda-forge
CONDA_CHANNEL_PRIORITY=strict
os: osx
osx_image: xcode10.1
# also tests file sizes, style, line endings
- env: PYTHON_VERSION=3.7 DEPS=minimal TEST=standard
CONDA_DEPENDENCIES="numpy scipy pytest<5.4 cython coveralls pytest-cov pytest-sugar!=0.9.3 flake8 meshio"
CONDA_CHANNELS=conda-forge
CONDA_CHANNEL_PRIORITY=strict
PIP_DEPENDENCIES="numpydoc"
addons:
apt:
packages:
# XXX eventually we need to support GLFW 3.3.1...
- env: PYTHON_VERSION=3.7 DEPS=full TEST=standard
CONDA_DEPENDENCIES="numpy scipy pytest<5.4 cython coveralls pytest-cov pytest-sugar!=0.9.3 pyopengl networkx pysdl2 matplotlib jupyter pyqt=5 pillow decorator six scikit-image glfw!=3.3.1 freetype-py imageio freetype<2.10.0 meshio"
CONDA_CHANNELS=conda-forge
CONDA_CHANNEL_PRIORITY=strict
PIP_DEPENDENCIES="husl pypng cassowary"
addons:
apt:
packages:
- *mesa_apt
- *full_apt
# test examples
- env: PYTHON_VERSION=3.7 DEPS=full TEST=examples
CONDA_DEPENDENCIES="numpy scipy pytest<5.4 cython coveralls pytest-cov pytest-sugar!=0.9.3 pyopengl networkx pysdl2 matplotlib jupyter pyqt=5 pillow decorator six scikit-image glfw!=3.3.1 freetype-py imageio freetype<2.10.0 meshio"
CONDA_CHANNELS=conda-forge
CONDA_CHANNEL_PRIORITY=strict
PIP_DEPENDENCIES="husl pypng cassowary"
addons:
apt:
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_VERSION=3.7 DEPS=osmesa TEST=osmesa
CONDA_DEPENDENCIES="numpy scipy pytest<5.4 cython coveralls pytest-cov pytest-sugar!=0.9.3 mesalib libglu meshio"
CONDA_CHANNELS=conda-forge
CONDA_CHANNEL_PRIORITY=strict
addons:
apt:
packages:
before_install:
- git clone https://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
- 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 && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git;
git fetch origin ${GIT_TARGET_EXTRA} && git checkout -qf FETCH_HEAD;
git tag travis-merge-target;
git gc --aggressive;
TARGET_SIZE=`du -s . | sed -e "s/[[:space:]].*//"`;
git pull origin ${GIT_SOURCE_EXTRA};
git gc --aggressive;
MERGE_SIZE=`du -s . | sed -e "s/[[:space:]].*//"`;
if [ "${MERGE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr \( ${MERGE_SIZE} - ${TARGET_SIZE} \)`;
else
SIZE_DIFF=0;
fi;
fi;
install:
# On Python3, install system-wide copies of bundled libraries instead
# Also install PyQt5, imaging (PIL or pillow), scipy, mpl, egl
# wxpython available from conda-forge but not for OSX:
# https://github.com/conda-forge/wxpython-feedstock/issues/2
# Don't test pyside2 because it seems to segfault on travis
# If we only need a single backend (DEPS=backend), then use PyQT5
# Don't test Pyglet because it currently segfaults (but AppVeyor checks it)
# WX requires OSMesa (mesa on conda) which has typically been an
# additional test environment. With llvm=3.3 the combination of
# EGL and mesa causes segmentation faults. See issue #1401.
- if [ "${DEPS}" == "full" ] && [ "${TRAVIS_OS_NAME}" == "linux" ] && [ "${PYTHON_VERSION}" == "3.7" ]; then
rm -rf ${SRC_DIR}/vispy/ext/_bundled;
fi;
# Install vispy
- cd ${SRC_DIR}
- python setup.py install
- python setup.py develop
- cd ~
before_script:
# We need to create a (fake) display on Travis, let's use a funny resolution
# For OSX: https://github.com/travis-ci/travis-ci/issues/7313#issuecomment-279914149
- if [ "${TEST}" != "osmesa" ]; then
export DISPLAY=:99.0;
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ( sudo Xvfb :99 -ac -screen 0 1400x900x24 +render +iglx; echo ok )& fi;
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
/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;
fi;
- if [ "${TEST}" == "osmesa" ]; then
export OSMESA_LIBRARY=$CONDA_PREFIX/lib/libOSMesa32.so;
fi;
script:
- cd ${SRC_DIR}
- python -c "import vispy; print(vispy.sys_info())"
- if [ "${TEST}" == "standard" ]; then
python make test unit --tb=short;
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";
elif git log --format=%B -n 2 | grep -q "\[skip size\]"; 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;