-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild_matplotlibs.sh
executable file
·69 lines (60 loc) · 2.19 KB
/
build_matplotlibs.sh
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
#!/bin/bash
# Run with:
# docker run --rm -v $PWD:/io quay.io/pypa/manylinux1_x86_64 /io/build_matplotlibs.sh
# or something like:
# docker run --rm -e PYTHON_VERSIONS=2.7 -v $PWD:/io quay.io/pypa/manylinux1_x86_64 /io/build_matplotlibs.sh
# or:
# docker run --rm -e MATPLOTLIB_VERSIONS=1.10.4 -e PYTHON_VERSIONS=2.7 -v $PWD:/io quay.io/pypa/manylinux1_x86_64 /io/build_matplotlibs.sh
set -e
# Manylinux, openblas version, lex_ver
source /io/common_vars.sh
if [ -z "$MATPLOTLIB_VERSIONS" ]; then
MATPLOTLIB_VERSIONS="1.3.0 1.3.1 1.4.0 1.4.1 \
1.4.2 1.4.3 1.5.0 1.5.1"
fi
# Use local freetype for versions which support it
export MPLLOCALFREETYPE=1
# Unicode width
UNICODE_WIDTH=${UNICODE_WIDTH:-32}
source /io/build_mpl_libs.sh
# Directory to store wheels
rm_mkdir unfixed_wheels
# Get matplotlib source tree
gh-clone matplotlib/matplotlib
cd matplotlib
# Compile wheels
for PYTHON in ${PYTHON_VERSIONS}; do
PIP="$(cpython_path $PYTHON $UNICODE_WIDTH)/bin/pip"
for MATPLOTLIB in ${MATPLOTLIB_VERSIONS}; do
if [ $(lex_ver $PYTHON) -ge $(lex_ver 3.7) ] ; then
NUMPY_VERSION=1.14.5
elif [ $(lex_ver $PYTHON) -ge $(lex_ver 3.6) ] ; then
NUMPY_VERSION=1.11.3
elif [ $(lex_ver $PYTHON) -ge $(lex_ver 3.5) ] ; then
if [ $(lex_ver $MATPLOTLIB) -ge $(lex_ver 3) ] ; then
NUMPY_VERSION=1.10.0
else
NUMPY_VERSION=1.9.1
fi
elif [ $(lex_ver $PYTHON) -ge $(lex_ver 3) ] || \
[ $(lex_ver $MATPLOTLIB) -ge $(lex_ver 2) ] ; then
NUMPY_VERSION=1.7.2
else
NUMPY_VERSION=1.6.2
fi
echo "Building matplotlib $MATPLOTLIB for Python $PYTHON"
git clean -fxd
git reset --hard
git checkout "v$MATPLOTLIB"
$PIP install -f $MANYLINUX_URL "numpy==$NUMPY_VERSION"
# Add patch for TCL / Tk runtime loading
patch_file="/io/mpl-tkagg-${MATPLOTLIB}.patch"
if [ -f $patch_file ]; then
git apply $patch_file
fi
$PIP wheel --no-deps -w ../unfixed_wheels .
done
done
cd ..
# Bundle external shared libraries into the wheels
repair_wheelhouse unfixed_wheels $WHEELHOUSE