@@ -26,6 +26,42 @@ apt-get build-dep python-lxml -y
26
26
export PYTHONIOENCODING=' utf-8'
27
27
export VIRTUALENV_DISTRIBUTE=0
28
28
29
+
30
+ function create_fake_pandas() {
31
+ local site_pkg_dir=" $1 "
32
+ rm -rf $site_pkg_dir /pandas
33
+ mkdir $site_pkg_dir /pandas
34
+ touch $site_pkg_dir /pandas/__init__.py
35
+ echo " version = '0.10.0-phony'" > $site_pkg_dir /pandas/version.py
36
+ }
37
+
38
+
39
+ function get_site_pkgs_dir() {
40
+ python$1 -c ' import distutils; print(distutils.sysconfig.get_python_lib())'
41
+ }
42
+
43
+
44
+ function create_wheel() {
45
+ local pip_args=" $1 "
46
+ local wheelhouse=" $2 "
47
+ local n=" $3 "
48
+ local pyver=" $4 "
49
+
50
+ local site_pkgs_dir=" $( get_site_pkgs_dir $pyver ) "
51
+
52
+
53
+ if [[ " $n " == * statsmodels* ]]; then
54
+ create_fake_pandas $site_pkgs_dir && \
55
+ pip wheel $pip_args --wheel-dir=$wheelhouse $n && \
56
+ pip install $pip_args --no-index $n && \
57
+ rm -Rf $site_pkgs_dir
58
+ else
59
+ pip wheel $pip_args --wheel-dir=$wheelhouse $n
60
+ pip install $pip_args --no-index $n
61
+ fi
62
+ }
63
+
64
+
29
65
function generate_wheels() {
30
66
# get the requirements file
31
67
local reqfile=" $1 "
@@ -62,8 +98,7 @@ function generate_wheels() {
62
98
63
99
# install and build the wheels
64
100
cat $reqfile | while read N; do
65
- pip wheel $PIP_ARGS --wheel-dir=$WHEELHOUSE $N
66
- pip install $PIP_ARGS --no-index $N
101
+ create_wheel " $PIP_ARGS " " $WHEELHOUSE " " $N " " $PY_VER "
67
102
done
68
103
}
69
104
0 commit comments