Skip to content

Commit 82d198a

Browse files
y-pwesm
y-p
authored andcommitted
BLD: New build matrix for Travis
- Moved travis build logic to ci directory. - Added testing for 3.3 (with numpy 1.7b2). - Prints version strings for all installed components. - added FULL_DEPS build for 2.7 and 3.2, which includes scipy and matplotlib tests. - Made the log less verbose. - Travis now shows an "env" columnn.
1 parent 100fb8f commit 82d198a

File tree

6 files changed

+196
-21
lines changed

6 files changed

+196
-21
lines changed

.travis.yml

+32-19
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,50 @@ language: python
33
python:
44
- 2.6
55
- 2.7
6-
- 3.1
6+
- 3.1 # travis will soon EOL this
77
- 3.2
88
- 3.3
99

10+
env:
11+
global:
12+
- # need at least this so travis page will show env column
13+
1014
matrix:
1115
include:
1216
- python: 2.7
1317
env: VBENCH=true
18+
- python: 2.7
19+
env: FULL_DEPS=true
20+
- python: 3.2
21+
env: FULL_DEPS=true
1422

1523
allow_failures:
16-
- python: 3.3 # until travis upgrade to 1.8.4
1724
- python: 2.7
1825
env: VBENCH=true
26+
- python: 3.2
27+
env: FULL_DEPS=true
1928

20-
install:
21-
- virtualenv --version
29+
# allow importing from site-packages,
30+
# so apt-get python-x works for system pythons
31+
# That's 2.7/3.2 on Ubuntu 12.04
32+
virtualenv:
33+
system_site_packages: true
34+
35+
before_install:
36+
- echo "Waldo1"
37+
- echo $VIRTUAL_ENV
2238
- date
23-
- whoami
24-
- pwd
25-
- echo $VBENCH
26-
# install 1.7.0b2 for 3.3, and pull a version of numpy git master
27-
# with a alternate fix for detach bug as a temporary workaround
28-
# for the others.
29-
- 'if [ $TRAVIS_PYTHON_VERSION == "3.3" ]; then pip uninstall numpy; pip install https://github.com/numpy/numpy/archive/v1.7.0b2.tar.gz; fi'
30-
- 'if [ $TRAVIS_PYTHON_VERSION == "3.2" ] || [ $TRAVIS_PYTHON_VERSION == "3.1" ]; then pip install https://github.com/y-p/numpy/archive/1.6.2_with_travis_fix.tar.gz; fi'
31-
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install numpy; fi' # should be nop if pre-installed
32-
- pip install --use-mirrors cython nose pytz python-dateutil xlrd openpyxl;
39+
- export PIP_ARGS=-q # comment this this to debug travis install issues
40+
- export APT_ARGS=-qq # comment this to debug travis install issues
41+
# - set -x # enable this to see bash commands
42+
- source ci/before_install.sh # we need to source this to bring in the env
43+
- python -V
44+
45+
install:
46+
- echo "Waldo2"
47+
- ci/install.sh
48+
- ci/print_versions.py
3349

3450
script:
35-
- python setup.py build_ext install
36-
- 'if [ x"$VBENCH" != x"true" ]; then nosetests --exe -w /tmp -A "not slow" pandas; fi'
37-
- pwd
38-
- 'if [ x"$VBENCH" == x"true" ]; then pip install sqlalchemy git+git://github.com/pydata/vbench.git; python vb_suite/perf_HEAD.py; fi'
39-
- python -c "import numpy;print(numpy.version.version)"
51+
- echo "Waldo3"
52+
- ci/script.sh

ci/before_install.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
echo "inside $0"
4+
5+
# overview
6+
if [ ${TRAVIS_PYTHON_VERSION} == "3.3" ]; then
7+
sudo add-apt-repository -y ppa:doko/ppa # we get the py3.3 debs from here
8+
fi
9+
10+
sudo apt-get update $APT_ARGS # run apt-get update for all versions
11+
12+
# hack for broken 3.3 env
13+
if [ x"$VIRTUAL_ENV" == x"" ]; then
14+
VIRTUAL_ENV=~/virtualenv/python$TRAVIS_PYTHON_VERSION_with_system_site_packages;
15+
fi
16+
17+
# we only recreate the virtualenv for 3.x
18+
# since the "Detach bug" only affects python3
19+
# and travis has numpy preinstalled on 2.x which is quicker
20+
_VENV=$VIRTUAL_ENV # save it
21+
if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ] ; then
22+
deactivate # pop out of any venv
23+
sudo pip install virtualenv==1.8.4 --upgrade
24+
sudo apt-get install $APT_ARGS python3.3 python3.3-dev
25+
sudo rm -Rf $_VENV
26+
virtualenv -p python$TRAVIS_PYTHON_VERSION $_VENV --system-site-packages;
27+
source $_VENV/bin/activate
28+
fi

ci/install.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
echo "inside $0"
4+
# Install Dependencies
5+
6+
# Hard Deps
7+
pip install $PIP_ARGS --use-mirrors cython nose python-dateutil
8+
9+
# try and get numpy as a binary deb
10+
11+
# numpy is preinstalled on 2.x
12+
# if [ ${TRAVIS_PYTHON_VERSION} == "2.7" ]; then
13+
# sudo apt-get $APT_ARGS install python-numpy;
14+
# fi
15+
16+
if [ ${TRAVIS_PYTHON_VERSION} == "3.2" ]; then
17+
sudo apt-get $APT_ARGS install python3-numpy;
18+
fi
19+
20+
# or else, get it with pip and compile it
21+
if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ] || \
22+
[ ${TRAVIS_PYTHON_VERSION} == "3.1" ] || \
23+
[ ${TRAVIS_PYTHON_VERSION} == "3.2" ]; then
24+
pip $PIP_ARGS install numpy; #https://github.com/y-p/numpy/archive/1.6.2_with_travis_fix.tar.gz;
25+
else
26+
pip $PIP_ARGS install https://github.com/numpy/numpy/archive/v1.7.0b2.tar.gz;
27+
fi
28+
29+
# Optional Deps
30+
if [ x"$FULL_DEPS" == x"true" ]; then
31+
echo "Installing FULL_DEPS"
32+
if [ ${TRAVIS_PYTHON_VERSION} == "2.7" ]; then
33+
sudo apt-get $APT_ARGS install python-scipy;
34+
fi
35+
36+
if [ ${TRAVIS_PYTHON_VERSION} == "3.2" ]; then
37+
sudo apt-get $APT_ARGS install python3-scipy;
38+
fi
39+
40+
pip install $PIP_ARGS --use-mirrors openpyxl pytz matplotlib;
41+
pip install $PIP_ARGS --use-mirrors xlrd xlwt;
42+
fi
43+
44+
if [ x"$VBENCH" == x"true" ]; then
45+
pip $PIP_ARGS install sqlalchemy git+git://github.com/pydata/vbench.git;
46+
fi

ci/print_versions.py

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env python
2+
import sys
3+
4+
print("\nINSTALLED VERSIONS")
5+
print("------------------")
6+
print("Python: %d.%d.%d.%s.%s" % sys.version_info[:])
7+
8+
try:
9+
import Cython
10+
print("Cython: %s" % Cython.__version__)
11+
except:
12+
print("Cython: Not installed")
13+
14+
try:
15+
import numpy
16+
print("Numpy: %s" % numpy.version.version)
17+
except:
18+
print("Numpy: Not installed")
19+
20+
try:
21+
import scipy
22+
print("Scipy: %s" % scipy.version.version)
23+
except:
24+
print("Scipy: Not installed")
25+
26+
try:
27+
import dateutil
28+
print("dateutil: %s" % dateutil.__version__)
29+
except:
30+
print("dateutil: Not installed")
31+
32+
try:
33+
import pytz
34+
print("pytz: %s" % pytz.VERSION)
35+
except:
36+
print("pytz: Not installed")
37+
38+
try:
39+
import tables
40+
print("PyTables: %s" % tables.__version__)
41+
except:
42+
print("PyTables: Not Installed")
43+
44+
45+
try:
46+
import matplotlib
47+
print("matplotlib: %s" % matplotlib.__version__)
48+
except:
49+
print("matplotlib: Not installed")
50+
51+
try:
52+
import openpyxl
53+
print("openpyxl: %s" % openpyxl.__version__)
54+
except:
55+
print("openpyxl: Not installed")
56+
57+
try:
58+
import xlrd
59+
print("xlrd: %s" % xlrd.__VERSION__)
60+
except:
61+
print("xlrd: Not installed")
62+
63+
try:
64+
import xlwt
65+
print("xlwt: %s" % xlwt.__VERSION__)
66+
except:
67+
print("xlwt: Not installed")
68+
69+
try:
70+
import sqlalchemy
71+
print("sqlalchemy: %s" % sqlalchemy.__version__)
72+
except:
73+
print("sqlalchemy: Not installed")
74+
75+
print("\n")

ci/script.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
echo "inside $0"
4+
5+
python setup.py build_ext install
6+
if [ x"$VBENCH" != x"true" ]; then
7+
nosetests --exe -w /tmp -A "not slow" pandas;
8+
exit
9+
fi
10+
if [ x"$VBENCH" == x"true" ]; then
11+
python vb_suite/perf_HEAD.py;
12+
exit
13+
fi

vb_suite/perf_HEAD.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ def get_vbench_log(build_url):
7575
return
7676

7777
s=json.loads(r.read())
78-
s=[x for x in s['matrix'] if x['config'].get('env')]
78+
s=[x for x in s['matrix'] if x['config'].get('env',{}).get('VBENCH')]
7979
#s=[x for x in s['matrix']]
8080
if not s:
8181
return
82-
id=s[0]['id']
82+
id=s[0]['id'] # should be just one for now
8383
r2=urllib2.urlopen("https://api.travis-ci.org/jobs/%s" % id)
8484
if (not 200 <= r.getcode() < 300):
8585
return

0 commit comments

Comments
 (0)