Skip to content

Commit 2763df6

Browse files
committed
TST: Update travis-test.py from master
1 parent 17c4fca commit 2763df6

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tools/travis-test.sh

+10-11
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ setup_base()
4848
if [ -z "$USE_DEBUG" ]; then
4949
$PIP install -v . 2>&1 | tee log
5050
else
51-
# Python3.5-dbg on travis seems to need this
51+
# The job run with USE_DEBUG=1 on travis needs this.
5252
export CFLAGS=$CFLAGS" -Wno-maybe-uninitialized"
5353
$PYTHON setup.py build build_src --verbose-cfg build_ext --inplace 2>&1 | tee log
5454
fi
@@ -65,7 +65,13 @@ setup_base()
6565

6666
run_test()
6767
{
68-
$PIP install -r test_requirements.txt
68+
# Install the test dependencies.
69+
# Clear PYTHONOPTIMIZE when running `pip install -r test_requirements.txt`
70+
# because version 2.19 of pycparser (a dependency of one of the packages
71+
# in test_requirements.txt) does not provide a wheel, and the source tar
72+
# file does not install correctly when Python's optimization level is set
73+
# to strip docstrings (see https://github.com/eliben/pycparser/issues/291).
74+
PYTHONOPTIMIZE="" $PIP install -r test_requirements.txt
6975

7076
if [ -n "$USE_DEBUG" ]; then
7177
export PYTHONPATH=$PWD
@@ -135,16 +141,11 @@ run_test()
135141
fi
136142
}
137143

144+
138145
export PYTHON
139146
export PIP
140-
$PIP install setuptools
141147

142148
if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then
143-
# Build wheel
144-
$PIP install wheel
145-
# ensure that the pip / setuptools versions deployed inside
146-
# the venv are recent enough
147-
$PIP install -U virtualenv
148149
# ensure some warnings are not issued
149150
export CFLAGS=$CFLAGS" -Wno-sign-compare -Wno-unused-result"
150151
# adjust gcc flags if C coverage requested
@@ -155,7 +156,7 @@ if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then
155156
export F90='gfortran --coverage'
156157
export LDFLAGS='--coverage'
157158
fi
158-
$PYTHON setup.py build build_src --verbose-cfg bdist_wheel
159+
$PYTHON setup.py build --warn-error build_src --verbose-cfg bdist_wheel
159160
# Make another virtualenv to install into
160161
virtualenv --python=`which $PYTHON` venv-for-wheel
161162
. venv-for-wheel/bin/activate
@@ -167,8 +168,6 @@ if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then
167168
run_test
168169

169170
elif [ -n "$USE_SDIST" ] && [ $# -eq 0 ]; then
170-
# use an up-to-date pip / setuptools inside the venv
171-
$PIP install -U virtualenv
172171
# temporary workaround for sdist failures.
173172
$PYTHON -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)"
174173
# ensure some warnings are not issued

0 commit comments

Comments
 (0)