Skip to content

Commit d50f20b

Browse files
author
y-p
committed
BLD: use binary packages to reduce travis-ci build times.
1 parent 1d58bf1 commit d50f20b

File tree

7 files changed

+209
-35
lines changed

7 files changed

+209
-35
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ pandas/io/*.json
3535

3636
.idea/pandas.iml
3737
.build_cache_dir
38+
.vagrant
39+
*.whl

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ env:
1010
matrix:
1111
include:
1212
- python: 2.7
13-
env: NOSE_ARGS="slow and not network" LOCALE_OVERRIDE="zh_CN.GB18030" FULL_DEPS=true UPLOAD=false
13+
env: NOSE_ARGS="slow and not network" LOCALE_OVERRIDE="zh_CN.GB18030" FULL_DEPS=true
1414
- python: 2.7
15-
env: NOSE_ARGS="not slow" FULL_DEPS=true UPLOAD=true
15+
env: NOSE_ARGS="not slow" FULL_DEPS=true
1616
- python: 3.2
17-
env: NOSE_ARGS="not slow" FULL_DEPS=true UPLOAD=true
17+
env: NOSE_ARGS="not slow" FULL_DEPS=true
1818
- python: 3.3
19-
env: NOSE_ARGS="not slow" UPLOAD=true
19+
env: NOSE_ARGS="not slow"
2020

2121
# allow importing from site-packages,
2222
# so apt-get python-x works for system pythons

ci/install.sh

+36-31
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@
1414
#
1515

1616
echo "inside $0"
17+
1718
# Install Dependencie
18-
SITE_PKG_DIR=$VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/site-packages
19-
echo "Using SITE_PKG_DIR: $SITE_PKG_DIR"
19+
# as of pip 1.4rc2, wheel files are still being broken regularly, this is a known good
20+
# commit. should revert to pypi when a final release is out
21+
pip install -I git+https://github.com/pypa/pip@42102e9deaea99db08b681d06906c2945f6f95e2#egg=pip
22+
pip Install -I https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.8b6.tar.gz
23+
pip install wheel
24+
25+
# comment this line to disable the fetching of wheel files
26+
PIP_ARGS+=" -I --use-wheel --find-links=https://cache27-pypandas.rhcloud.com/"
2027

21-
# workaround for travis ignoring system_site_packages in travis.yml
28+
# Force virtualenv to accpet system_site_packages
2229
rm -f $VIRTUAL_ENV/lib/python$TRAVIS_PYTHON_VERSION/no-global-site-packages.txt
2330

2431
if [ x"$LOCALE_OVERRIDE" != x"" ]; then
@@ -30,75 +37,73 @@ fi;
3037
#scipy is not included in the cached venv
3138
if [ x"$FULL_DEPS" == x"true" ] ; then
3239
# for pytables gets the lib as well
33-
sudo apt-get $APT_ARGS install libhdf5-serial-dev
40+
time sudo apt-get $APT_ARGS install libhdf5-serial-dev
3441

3542
if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]; then
36-
sudo apt-get $APT_ARGS install python3-bs4
43+
time sudo apt-get $APT_ARGS install python3-bs4
3744
elif [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then
38-
sudo apt-get $APT_ARGS install python-bs4
45+
time sudo apt-get $APT_ARGS install python-bs4
3946
fi
4047

4148
if [ ${TRAVIS_PYTHON_VERSION} == "3.2" ]; then
42-
sudo apt-get $APT_ARGS install python3-scipy
49+
time sudo apt-get $APT_ARGS install python3-scipy
4350
elif [ ${TRAVIS_PYTHON_VERSION} == "2.7" ]; then
44-
sudo apt-get $APT_ARGS install python-scipy
51+
time sudo apt-get $APT_ARGS install python-scipy
4552
fi
4653
fi
4754

4855
# Hard Deps
49-
pip install $PIP_ARGS nose python-dateutil pytz
50-
pip install $PIP_ARGS cython
56+
time pip install $PIP_ARGS nose python-dateutil pytz>=2013a
57+
time pip install $PIP_ARGS cython==0.19.1
5158

5259
if [ ${TRAVIS_PYTHON_VERSION} == "3.3" ]; then # should be >=3,3
53-
pip install $PIP_ARGS numpy==1.7.0
60+
time pip install $PIP_ARGS numpy==1.7.1
5461
elif [ ${TRAVIS_PYTHON_VERSION} == "3.2" ]; then
5562
# sudo apt-get $APT_ARGS install python3-numpy; # 1.6.2 or precise
56-
pip install $PIP_ARGS numpy==1.6.1
63+
time pip install $PIP_ARGS numpy==1.6.1
5764
else
58-
pip install $PIP_ARGS numpy==1.6.1
65+
time pip install $PIP_ARGS numpy==1.6.1
5966
fi
6067

6168
# Optional Deps
6269
if [ x"$FULL_DEPS" == x"true" ]; then
6370
echo "Installing FULL_DEPS"
64-
pip install $PIP_ARGS cython
6571

6672
if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then
67-
pip install $PIP_ARGS xlwt
68-
pip install $PIP_ARGS bottleneck
69-
pip install $PIP_ARGS numexpr==2.0.1
70-
pip install $PIP_ARGS tables==2.3.1
73+
time pip install $PIP_ARGS xlwt
74+
time pip install $PIP_ARGS bottleneck==0.6.0
75+
time pip install $PIP_ARGS numexpr==2.1
76+
time pip install $PIP_ARGS tables==2.3.1
7177
else
72-
pip install $PIP_ARGS numexpr
73-
pip install $PIP_ARGS tables
78+
time pip install $PIP_ARGS numexpr==2.1
79+
time pip install $PIP_ARGS tables==3.0.0
7480
fi
7581

76-
pip install $PIP_ARGS matplotlib
77-
pip install $PIP_ARGS openpyxl
78-
pip install $PIP_ARGS xlrd>=0.9.0
79-
pip install $PIP_ARGS 'http://downloads.sourceforge.net/project/pytseries/scikits.timeseries/0.91.3/scikits.timeseries-0.91.3.tar.gz?r='
80-
pip install $PIP_ARGS patsy
81-
pip install $PIP_ARGS html5lib
82+
time pip install $PIP_ARGS matplotlib==1.2.1
83+
time pip install $PIP_ARGS openpyxl
84+
time pip install $PIP_ARGS xlrd>=0.9.0
85+
time pip install $PIP_ARGS 'http://downloads.sourceforge.net/project/pytseries/scikits.timeseries/0.91.3/scikits.timeseries-0.91.3.tar.gz?r='
86+
time pip install $PIP_ARGS patsy
87+
time pip install $PIP_ARGS html5lib
8288

8389
if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]; then
84-
sudo apt-get $APT_ARGS remove python3-lxml
90+
time sudo apt-get $APT_ARGS remove python3-lxml
8591
elif [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then
86-
sudo apt-get $APT_ARGS remove python-lxml
92+
time sudo apt-get $APT_ARGS remove python-lxml
8793
fi
8894

89-
pip install $PIP_ARGS lxml
9095
# fool statsmodels into thinking pandas was already installed
9196
# so it won't refuse to install itself.
9297

9398
mkdir $SITE_PKG_DIR/pandas
9499
touch $SITE_PKG_DIR/pandas/__init__.py
95100
echo "version='0.10.0-phony'" > $SITE_PKG_DIR/pandas/version.py
96-
pip install $PIP_ARGS git+git://github.com/statsmodels/statsmodels@c9062e43b8a5f7385537ca95#egg=statsmodels
101+
time pip install $PIP_ARGS git+git://github.com/statsmodels/statsmodels@c9062e43b8a5f7385537ca95#egg=statsmodels
97102

98103
rm -Rf $SITE_PKG_DIR/pandas # scrub phoney pandas
99104
fi
100105

101106
# build pandas
102-
python setup.py build_ext install
107+
time python setup.py build_ext install
103108

104109
true

ci/speedpack/Vagrantfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
Vagrant.configure("2") do |config|
4+
config.vm.box = "precise64"
5+
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
6+
7+
# config.vbguest.auto_update = true
8+
# config.vbguest.no_remote = true
9+
10+
config.vm.synced_folder "wheelhouse", "/wheelhouse"
11+
12+
config.vm.provider :virtualbox do |vb|
13+
vb.customize ["modifyvm", :id, "--cpus", "4"]
14+
vb.customize ["modifyvm", :id, "--memory", "2048"]
15+
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
16+
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
17+
end
18+
19+
config.vm.provision :shell, :path => "build.sh"
20+
21+
end

ci/speedpack/build.sh

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
3+
# This script is meant to run on a mint precise64 VM.
4+
# The generated wheel files should be compatible
5+
# with travis-ci as of 07/2013.
6+
#
7+
# Runtime can be up to an hour or more.
8+
9+
echo "Running build.sh..."
10+
set -x
11+
12+
WHEEL_DIR=/wheelhouse
13+
VERSIONS="2.6 2.7 3.2 3.3"
14+
SCRIPT_FILE="/tmp/run.sh"
15+
PARALLEL=false
16+
17+
export PIP_ARGS=" --download-cache /tmp -w $WHEEL_DIR --use-wheel --find-links=$WHEEL_DIR"
18+
19+
apt-get update
20+
apt-get install python-software-properties git -y
21+
apt-add-repository ppa:fkrull/deadsnakes -y
22+
apt-get update
23+
24+
apt-get install python-pip libfreetype6-dev libpng12-dev -y
25+
pip install virtualenv
26+
apt-get install libhdf5-serial-dev g++ -y
27+
28+
29+
function generate_wheels {
30+
VER=$1
31+
set -x
32+
33+
if [ x"$VIRTUAL_ENV" != x"" ]; then
34+
deactivate
35+
fi
36+
37+
cd ~/
38+
sudo rm -Rf venv-$VER
39+
virtualenv -p python$VER venv-$VER
40+
source venv-$VER/bin/activate
41+
42+
pip install -I --download-cache /tmp git+https://github.com/pypa/pip@42102e9d#egg=pip
43+
pip install -I --download-cache /tmp https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.8b6.tar.gz
44+
pip install -I --download-cache /tmp wheel
45+
46+
export INCLUDE_PATH=/usr/include/python$VER/
47+
export C_INCLUDE_PATH=/usr/include/python$VER/
48+
pip wheel $PIP_ARGS cython==0.19.1
49+
pip install --use-wheel --find-links=$WHEEL_DIR cython==0.19.1
50+
51+
pip wheel $PIP_ARGS numpy==1.6.1
52+
pip wheel $PIP_ARGS numpy==1.7.1
53+
pip install --use-wheel --find-links=$WHEEL_DIR numpy==1.7.1
54+
pip wheel $PIP_ARGS bottleneck==0.6.0
55+
56+
pip wheel $PIP_ARGS numexpr==1.4.2
57+
pip install --use-wheel --find-links=$WHEEL_DIR numexpr==1.4.2
58+
pip wheel $PIP_ARGS tables==2.3.1
59+
pip wheel $PIP_ARGS tables==2.4.0
60+
61+
pip uninstall numexpr -y
62+
pip wheel $PIP_ARGS numexpr==2.1
63+
pip install --use-wheel --find-links=$WHEEL_DIR numexpr==2.1
64+
pip wheel $PIP_ARGS tables==3.0.0
65+
pip uninstall numexpr -y
66+
67+
pip wheel $PIP_ARGS matplotlib==1.2.1
68+
}
69+
70+
71+
for VER in $VERSIONS ; do
72+
apt-get install python$VER python$VER-dev -y
73+
done
74+
75+
if $PARALLEL; then
76+
echo '#!/bin/bash' > $SCRIPT_FILE
77+
echo "export WHEEL_DIR=$WHEEL_DIR" >> $SCRIPT_FILE
78+
echo "export PIP_ARGS='$PIP_ARGS'">> $SCRIPT_FILE
79+
80+
declare -f generate_wheels >> $SCRIPT_FILE
81+
echo 'generate_wheels $1' >> $SCRIPT_FILE
82+
chmod u+x $SCRIPT_FILE
83+
84+
pip install -I --download-cache /tmp git+https://github.com/pypa/pip@42102e9d#egg=pip
85+
pip install --download-cache /tmp --no-install wheel
86+
pip install --download-cache /tmp --no-install https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.8b6.tar.gz
87+
88+
for VER in 2.6 2.7 3.2 3.3 ; do
89+
$SCRIPT_FILE $VER &
90+
done
91+
92+
wait
93+
94+
else
95+
for VER in 2.6 2.7 3.2 3.3 ; do
96+
generate_wheels $VER
97+
done
98+
fi
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#user nobody;
2+
worker_processes 1;
3+
4+
#error_log logs/error.log;
5+
#error_log logs/error.log notice;
6+
#error_log logs/error.log info;
7+
8+
#pid logs/nginx.pid;
9+
10+
11+
events {
12+
worker_connections 1024;
13+
}
14+
15+
16+
http {
17+
include mime.types;
18+
default_type application/octet-stream;
19+
20+
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
21+
# '$status $body_bytes_sent "$http_referer" '
22+
# '"$http_user_agent" "$http_x_forwarded_for"';
23+
24+
#access_log logs/access.log on;
25+
26+
sendfile on;
27+
#tcp_nopush on;
28+
29+
#keepalive_timeout 0;
30+
keepalive_timeout 65;
31+
32+
#gzip on;
33+
34+
server {
35+
listen $OPENSHIFT_IP:$OPENSHIFT_PORT;
36+
37+
access_log access.log ;
38+
sendfile on;
39+
40+
location / {
41+
root ../../app-root/data/store/;
42+
autoindex on;
43+
}
44+
45+
46+
}
47+
48+
}

ci/speedpack/wheelhouse/placeholder

Whitespace-only changes.

0 commit comments

Comments
 (0)