1
1
language : cpp
2
- dist : trusty
3
2
matrix :
4
3
include :
5
4
# This config does a few things:
10
9
# also tests the automatic discovery functions in CMake (Python version, C++ standard).
11
10
- os : linux
12
11
dist : xenial # Necessary to run doxygen 1.8.15
12
+ # TODO(eric.cousineau): These aren't actually used, they're only for naming. Use "name" field instead?
13
13
env : STYLE DOCS PIP
14
14
cache : false
15
15
before_install :
@@ -38,44 +38,69 @@ matrix:
38
38
# The following are regular test configurations, including optional dependencies.
39
39
# With regard to each other they differ in Python version, C++ standard and compiler.
40
40
- os : linux
41
+ dist : trusty
41
42
env : PYTHON=2.7 CPP=11 GCC=4.8
42
43
addons :
43
44
apt :
44
- packages : [cmake=2.\*, cmake-data=2.\*]
45
+ packages :
46
+ - cmake=2.\*
47
+ - cmake-data=2.\*
45
48
- os : linux
49
+ dist : trusty
46
50
env : PYTHON=3.6 CPP=11 GCC=4.8
47
51
addons :
48
52
apt :
49
- sources : [deadsnakes]
50
- packages : [python3.6-dev python3.6-venv, cmake=2.\*, cmake-data=2.\*]
51
- - services : docker
53
+ sources :
54
+ - deadsnakes
55
+ packages :
56
+ - python3.6-dev
57
+ - python3.6-venv
58
+ - cmake=2.\*
59
+ - cmake-data=2.\*
60
+ - os : linux
61
+ dist : trusty
52
62
env : PYTHON=2.7 CPP=14 GCC=6 CMAKE=1
53
- - services : docker
54
- env : PYTHON=3.5 CPP=14 GCC=6 DEBUG=1
55
- - env : PYTHON=3.6 CPP=17 GCC=7
63
+ addons :
64
+ apt :
65
+ sources :
66
+ - ubuntu-toolchain-r-test
67
+ packages :
68
+ - g++-6
69
+ - os : linux
70
+ dist : trusty
71
+ # N.B. `ensurepip` could be installed transitively by `python3.5-venv`, but
72
+ # seems to have apt conflicts (at least for Trusty). Use Docker instead.
73
+ services : docker
74
+ env : DOCKER=debian:stretch PYTHON=3.5 CPP=14 GCC=6 DEBUG=1
75
+ - os : linux
76
+ dist : xenial
77
+ env : PYTHON=3.6 CPP=17 GCC=7
56
78
addons :
57
79
apt :
58
80
sources :
59
81
- deadsnakes
60
82
- ubuntu-toolchain-r-test
61
83
packages :
84
+ - g++-7
62
85
- python3.6-dev
63
86
- python3.6-venv
64
- - g++-7
65
87
- os : linux
88
+ dist : xenial
66
89
env : PYTHON=3.6 CPP=17 CLANG=7
67
90
addons :
68
91
apt :
69
92
sources :
70
93
- deadsnakes
71
- - llvm-toolchain-trusty -7
94
+ - llvm-toolchain-xenial -7
72
95
packages :
73
96
- python3.6-dev
74
97
- python3.6-venv
75
98
- clang-7
99
+ - libclang-7-dev
76
100
- llvm-7-dev
77
101
- lld-7
78
- - libstdc++7
102
+ - libc++-7-dev
103
+ - libc++abi-7-dev # Why is this necessary???
79
104
- os : osx
80
105
osx_image : xcode7.3
81
106
env : PYTHON=2.7 CPP=14 CLANG CMAKE=1
@@ -84,22 +109,32 @@ matrix:
84
109
env : PYTHON=3.7 CPP=14 CLANG DEBUG=1
85
110
# Test a PyPy 2.7 build
86
111
- os : linux
87
- env : PYPY=7.1 PYTHON=2.7 CPP=11 GCC=4.8
112
+ dist : trusty
113
+ env : PYPY=5.8 PYTHON=2.7 CPP=11 GCC=4.8
88
114
addons :
89
115
apt :
90
- packages : [libblas-dev, liblapack-dev, gfortran]
116
+ packages :
117
+ - libblas-dev
118
+ - liblapack-dev
119
+ - gfortran
91
120
# Build in 32-bit mode and tests against the CMake-installed version
92
- - services : docker
93
- env : ARCH=i386 PYTHON=3.5 CPP=14 GCC=6 INSTALL=1
121
+ - os : linux
122
+ dist : trusty
123
+ services : docker
124
+ env : DOCKER=i386/debian:stretch PYTHON=3.5 CPP=14 GCC=6 INSTALL=1
94
125
script :
95
126
- |
96
- $SCRIPT_RUN_PREFIX sh -c "set -e
97
- cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 .
98
- make install
99
- cp -a tests /pybind11-tests
100
- mkdir /build-tests && cd /build-tests
101
- cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON
102
- make pytest -j 2"
127
+ # Consolidated 32-bit Docker Build + Install
128
+ set -ex
129
+ $SCRIPT_RUN_PREFIX sh -c "
130
+ set -ex
131
+ cmake ${CMAKE_EXTRA_ARGS} -DPYBIND11_INSTALL=1 -DPYBIND11_TEST=0 .
132
+ make install
133
+ cp -a tests /pybind11-tests
134
+ mkdir /build-tests && cd /build-tests
135
+ cmake ../pybind11-tests ${CMAKE_EXTRA_ARGS} -DPYBIND11_WERROR=ON
136
+ make pytest -j 2"
137
+ set +ex
103
138
cache :
104
139
directories :
105
140
- $HOME/.local/bin
@@ -109,6 +144,7 @@ cache:
109
144
before_install :
110
145
- |
111
146
# Configure build variables
147
+ set -ex
112
148
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
113
149
if [ -n "$CLANG" ]; then
114
150
export CXX=clang++-$CLANG CC=clang-$CLANG
@@ -119,18 +155,16 @@ before_install:
119
155
fi
120
156
export CXX=g++-$GCC CC=gcc-$GCC
121
157
fi
122
- if [ "$GCC" = "6" ]; then DOCKER=${ARCH:+$ARCH/}debian:stretch
123
- elif [ "$GCC" = "7" ]; then DOCKER=debian:buster EXTRA_PACKAGES+=" catch python3-distutils" DOWNLOAD_CATCH=OFF
124
- fi
125
158
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
126
159
export CXX=clang++ CC=clang;
127
160
fi
128
161
if [ -n "$CPP" ]; then CPP=-std=c++$CPP; fi
129
162
if [ "${PYTHON:0:1}" = "3" ]; then PY=3; fi
130
163
if [ -n "$DEBUG" ]; then CMAKE_EXTRA_ARGS+=" -DCMAKE_BUILD_TYPE=Debug"; fi
164
+ set +ex
131
165
- |
132
166
# Initialize environment
133
- set -e
167
+ set -ex
134
168
if [ -n "$DOCKER" ]; then
135
169
docker pull $DOCKER
136
170
@@ -142,9 +176,9 @@ before_install:
142
176
SCRIPT_RUN_PREFIX="docker exec --tty $containerid"
143
177
$SCRIPT_RUN_PREFIX sh -c 'for s in 0 15; do sleep $s; apt-get update && apt-get -qy dist-upgrade && break; done'
144
178
else
145
- if [ "$PYPY" = "7.1 " ]; then
146
- curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1 .0-linux64.tar.bz2 | tar xj
147
- PY_CMD=$(echo `pwd`/pypy2.7-v7.1 .0-linux64/bin/pypy)
179
+ if [ "$PYPY" = "5.8 " ]; then
180
+ curl -fSL https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8 .0-linux64.tar.bz2 | tar xj
181
+ PY_CMD=$(echo `pwd`/pypy2-v5.8 .0-linux64/bin/pypy)
148
182
CMAKE_EXTRA_ARGS+=" -DPYTHON_EXECUTABLE:FILEPATH=$PY_CMD"
149
183
else
150
184
PY_CMD=python$PYTHON
@@ -162,12 +196,12 @@ before_install:
162
196
$PY_CMD --version
163
197
$PY_CMD -m pip install --user --upgrade pip wheel
164
198
fi
165
- set +e
199
+ set +ex
166
200
install :
167
201
- |
168
202
# Install dependencies
203
+ set -ex
169
204
cmake --version
170
- set -e
171
205
if [ -n "$DOCKER" ]; then
172
206
if [ -n "$DEBUG" ]; then
173
207
PY_DEBUG="python$PYTHON-dbg python$PY-scipy-dbg"
@@ -185,26 +219,53 @@ install:
185
219
186
220
export NPY_NUM_BUILD_JOBS=2
187
221
echo "Installing pytest, numpy, scipy..."
188
- ${PYPY:+travis_wait 30} $PY_CMD -m pip install --user --upgrade pytest numpy scipy \
189
- ${PYPY:+--extra-index-url https://imaginary.ca/trusty-pypi}
222
+ local PIP_CMD=""
223
+ if [ -n $PYPY ]; then
224
+ # For expediency, install only versions that are available on the extra index.
225
+ travis_wait 30 \
226
+ $PY_CMD -m pip install --user --upgrade --extra-index-url https://imaginary.ca/trusty-pypi \
227
+ pytest numpy==1.15.4 scipy==1.2.0
228
+ else
229
+ $PY_CMD -m pip install --user --upgrade pytest numpy scipy
230
+ fi
190
231
echo "done."
191
232
192
233
mkdir eigen
193
234
curl -fsSL https://bitbucket.org/eigen/eigen/get/3.3.4.tar.bz2 | \
194
235
tar --extract -j --directory=eigen --strip-components=1
195
236
export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH:+$CMAKE_INCLUDE_PATH:}$PWD/eigen"
196
237
fi
197
- set +e
238
+ set +ex
198
239
script :
199
- - $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS}
200
- -DPYBIND11_PYTHON_VERSION=$PYTHON
201
- -DPYBIND11_CPP_STANDARD=$CPP
202
- -DPYBIND11_WERROR=${WERROR:-ON}
203
- -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON}
240
+ - |
241
+ # CMake Configuration
242
+ set -ex
243
+ $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS} \
244
+ -DPYBIND11_PYTHON_VERSION=$PYTHON \
245
+ -DPYBIND11_CPP_STANDARD=$CPP \
246
+ -DPYBIND11_WERROR=${WERROR:-ON} \
247
+ -DDOWNLOAD_CATCH=${DOWNLOAD_CATCH:-ON} \
204
248
.
205
- - $SCRIPT_RUN_PREFIX make pytest -j 2
206
- - $SCRIPT_RUN_PREFIX make cpptest -j 2
207
- - if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi
249
+ set +ex
250
+ - |
251
+ # pytest
252
+ set -ex
253
+ $SCRIPT_RUN_PREFIX make pytest -j 2 VERBOSE=1
254
+ set +ex
255
+ - |
256
+ # cpptest
257
+ set -ex
258
+ $SCRIPT_RUN_PREFIX make cpptest -j 2
259
+ set +ex
260
+ - |
261
+ # CMake Build Interface
262
+ set -ex
263
+ if [ -n "$CMAKE" ]; then $SCRIPT_RUN_PREFIX make test_cmake_build; fi
264
+ set +ex
208
265
after_failure : cat tests/test_cmake_build/*.log*
209
266
after_script :
210
- - if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi
267
+ - |
268
+ # Cleanup (Docker)
269
+ set -ex
270
+ if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi
271
+ set +ex
0 commit comments