Improve tox.ini, install py26 for travis.

Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
This commit is contained in:
Dan O'Reilly 2015-08-20 18:19:56 -04:00
parent afa488c4d1
commit 5de2a81b01
2 changed files with 24 additions and 12 deletions

View File

@ -2,17 +2,20 @@
envlist =
# Py3 tests currently fail because of text handling issues,
# So only test py26/py27 for now.
#py26,py27,py33,py34
py26,py27
#py{26,27,33,34}-{cpp,python}
py{26,27}-{cpp,python}
[testenv]
usedevelop = true
setenv =
LD_LIBRARY_PATH={toxinidir}/../src/.libs
cpp: LD_LIBRARY_PATH={toxinidir}/../src/.libs
cpp: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
commands =
python setup.py -q build_py
python setup.py -q build {posargs}
python setup.py -q test -q {posargs}
pip install --install-option {posargs: -q} .
python: python setup.py -q build
cpp: python setup.py -q build --cpp_implementation
python: python setup.py -q test -q
cpp: python setup.py -q test -q --cpp_implementation
deps =
six
py26: ordereddict
py26: unittest2

View File

@ -111,21 +111,30 @@ build_javanano_oracle7() {
build_javanano
}
internal_install_python_deps() {
sudo pip install tox
sudo apt-get install -y python-software-properties # for apt-add-repository
sudo apt-add-repository -y ppa:fkrull/deadsnakes
sudo apt-get update -qq
sudo apt-get install -y python2.6 python2.6-dev
}
build_python() {
internal_build_cpp
sudo pip install tox
internal_install_python_deps
cd python
tox
tox -e py26-python,py27-python
cd ..
}
build_python_cpp() {
internal_build_cpp
sudo pip install tox
export LD_LIBRARY_PATH=../src/.libs # for Linux
internal_install_python_deps
export LD_LIBRARY_PATH=../src/.libs # for Linux
export DYLD_LIBRARY_PATH=../src/.libs # for OS X
cd python
tox -- --cpp_implementation
tox -e py26-cpp,py27-cpp
cd ..
}