Skip to content

Commit a358ebd

Browse files
authored
Merge pull request numpy#15677 from charris/backport-15574
TST: Do not create gfortran link in azure Mac testing.
2 parents e0660d4 + 2763df6 commit a358ebd

File tree

3 files changed

+43
-25
lines changed

3 files changed

+43
-25
lines changed

azure-pipelines.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ stages:
9797
# manually link critical gfortran libraries
9898
ln -s /usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libgfortran.3.dylib /usr/local/lib/libgfortran.3.dylib
9999
ln -s /usr/local/Cellar/[email protected]/4.9.4_1/lib/gcc/4.9/libquadmath.0.dylib /usr/local/lib/libquadmath.0.dylib
100-
# manually symlink gfortran-4.9 to plain gfortran
101-
# for f2py
102-
ln -s /usr/local/bin/gfortran-4.9 /usr/local/bin/gfortran
100+
# Manually symlink gfortran-4.9 to plain gfortran for f2py.
101+
# No longer needed after Feb 13 2020 as gfortran is already present
102+
# and the attempted link errors. Keep this for future reference.
103+
# ln -s /usr/local/bin/gfortran-4.9 /usr/local/bin/gfortran
103104
displayName: 'make gfortran available on mac os vm'
104105
# use the pre-built openblas binary that most closely
105106
# matches our MacOS wheel builds -- currently based

tools/travis-before-install.sh

+29-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
#!/bin/bash
22

3+
# Exit the script immediately if a command exits with a non-zero status,
4+
# and print commands and their arguments as they are executed.
5+
set -ex
6+
37
uname -a
48
free -m
59
df -h
610
ulimit -a
711

8-
if [ -n "$DOWNLOAD_OPENBLAS" ]; then
9-
pwd
10-
ls -ltrh
11-
target=$(python tools/openblas_support.py)
12-
sudo cp -r $target/lib/* /usr/lib
13-
sudo cp $target/include/* /usr/include
14-
fi
15-
1612
mkdir builds
1713
pushd builds
1814

@@ -22,16 +18,38 @@ pip install -U virtualenv
2218

2319
if [ -n "$USE_DEBUG" ]
2420
then
25-
virtualenv --python=python3-dbg venv
21+
virtualenv --python=$(which python3-dbg) venv
2622
else
2723
virtualenv --python=python venv
2824
fi
2925

3026
source venv/bin/activate
3127
python -V
28+
gcc --version
3229

3330
popd
3431

35-
pip install --upgrade pip setuptools
36-
pip install -r test_requirements.txt
32+
pip install --upgrade pip
33+
34+
# 'setuptools', 'wheel' and 'cython' are build dependencies. This information
35+
# is stored in pyproject.toml, but there is not yet a standard way to install
36+
# those dependencies with, say, a pip command, so we'll just hard-code their
37+
# installation here. We only need to install them separately for the cases
38+
# where numpy is installed with setup.py, which is the case for the Travis jobs
39+
# where the environment variables USE_DEBUG or USE_WHEEL are set. When pip is
40+
# used to install numpy, pip gets the build dependencies from pyproject.toml.
41+
# A specific version of cython is required, so we read the cython package
42+
# requirement using `grep cython test_requirements.txt` instead of simply
43+
# writing 'pip install setuptools wheel cython'.
44+
# urllib3 is needed for openblas_support
45+
pip install setuptools wheel urllib3 `grep cython test_requirements.txt`
46+
47+
if [ -n "$DOWNLOAD_OPENBLAS" ]; then
48+
pwd
49+
target=$(python tools/openblas_support.py)
50+
sudo cp -r $target/lib/* /usr/lib
51+
sudo cp $target/include/* /usr/include
52+
fi
53+
54+
3755
if [ -n "$USE_ASV" ]; then pip install asv; fi

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)