forked from matthew-brett/manylinux-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_pandas.sh
executable file
·55 lines (48 loc) · 1.87 KB
/
build_pandas.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
#!/bin/bash
# Run with:
# docker run --rm -v $PWD:/io quay.io/pypa/manylinux1_x86_64 /io/build_pandas.sh
# or something like:
# docker run --rm -e PYTHON_VERSIONS=3.5 -v $PWD:/io quay.io/pypa/manylinux1_x86_64 /io/build_pandas.sh
# or:
# docker run --rm -e PANDAS_VERSIONS=0.23.4 -e PYTHON_VERSIONS=3.5 -v $PWD:/io quay.io/pypa/manylinux1_x86_64 /io/build_pandas.sh
set -e
# Manylinux, openblas version, lex_ver
source /io/common_vars.sh
if [ -z "$PANDAS_VERSIONS" ]; then
PANDAS_VERSIONS="0.10.0 0.10.1 0.11.0 0.12.0 0.13.0 0.13.1 \
0.14.0 0.14.1 0.15.0 0.15.1 0.15.2 \
0.16.0 0.16.1 0.16.2 \
0.17.0 0.17.1 0.18.0 0.18.1"
fi
# Directory to store wheels
rm_mkdir unfixed_wheels
# Compile wheels
for PYTHON in ${PYTHON_VERSIONS}; do
PIP="$(cpython_path $PYTHON $UNICODE_WIDTH)/bin/pip"
PIPI_IO="$PIP install -f $WHEELHOUSE -f $MANYLINUX_URL"
for PANDAS in ${PANDAS_VERSIONS}; do
if [ -n "$NUMPY_VERSION" ]; then
np_ver=$NUMPY_VERSION
elif [ $(lex_ver $PYTHON) -ge $(lex_ver 3.5) ] ; then
np_ver=1.9.0
elif [ $(lex_ver $PYTHON) -ge $(lex_ver 3) ] ||
[ $(lex_ver $PANDAS) -ge $(lex_ver 0.15) ] ; then
np_ver=1.7.0
else
np_ver=1.6.1
fi
echo "Building pandas $PANDAS for Python $PYTHON"
# Put numpy version into the wheelhouse to avoid rebuilding
$PIP wheel -f $WHEELHOUSE -f $MANYLINUX_URL -w tmp "numpy==$np_ver"
# Add numpy to requirements to avoid upgrading numpy version
$PIP wheel -f tmp -w unfixed_wheels "numpy==$np_ver" "pandas==$PANDAS" --no-binary=pandas
done
done
# Delete everything but pandas from wheelhouse
for fn in $(ls unfixed_wheels); do
if [[ ! "$fn" =~ ^pandas-.* ]]; then
rm unfixed_wheels/$fn
fi
done
# Bundle external shared libraries into the wheels
repair_wheelhouse unfixed_wheels $WHEELHOUSE