-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from basho/feature/bch/tox
CLIENTS-115: Use pyenv for multiple Python versions and tox to test them Reviewed-by: christophermancini
- Loading branch information
Showing
5 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
# pyenv root | ||
export PYENV_ROOT="$HOME/.pyenv" | ||
|
||
# Add pyenv root to PATH | ||
# and initialize pyenv | ||
PATH="$PYENV_ROOT/bin:$PATH" | ||
# initialize pyenv | ||
eval "$(pyenv init -)" | ||
# initialize pyenv virtualenv | ||
eval "$(pyenv virtualenv-init -)" | ||
|
||
# Change directory if an argument is passed in | ||
if [[ ! -z "$1" ]]; then | ||
cd "$1" | ||
fi | ||
tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
# pyenv root | ||
export PYENV_ROOT="$HOME/.pyenv" | ||
|
||
# Install pyenv if it's missing | ||
if [[ ! -d $PYENV_ROOT ]]; then | ||
git clone git://github.com/yyuu/pyenv.git ${PYENV_ROOT} | ||
cd ${PYENV_ROOT} | ||
# Get the latest tagged version | ||
git checkout `git tag | tail -1` | ||
git clone https://github.com/yyuu/pyenv-virtualenv.git ${PYENV_ROOT}/plugins/pyenv-virtualenv | ||
cd plugins/pyenv-virtualenv | ||
git checkout `git tag | tail -1` | ||
git clone https://github.com/s1341/pyenv-alias.git ${PYENV_ROOT}/plugins/pyenv-alias | ||
|
||
# Add pyenv root to PATH | ||
# and initialize pyenv | ||
PATH="$PYENV_ROOT/bin:$PATH" | ||
# initialize pyenv | ||
eval "$(pyenv init -)" | ||
# initialize pyenv virtualenv | ||
eval "$(pyenv virtualenv-init -)" | ||
|
||
# Now load up (allthethings) | ||
VERSION_ALIAS="riak_2.6.9" pyenv install 2.6.9 | ||
VERSION_ALIAS="riak_2.7.9" pyenv install 2.7.9 | ||
VERSION_ALIAS="riak_3.3.6" pyenv install 3.3.6 | ||
VERSION_ALIAS="riak_3.4.2" pyenv install 3.4.2 | ||
|
||
pyenv virtualenv riak_2.6.9 riak-py26 | ||
pyenv virtualenv riak_2.7.9 riak-py27 | ||
pyenv virtualenv riak_3.3.6 riak-py33 | ||
pyenv virtualenv riak_3.4.2 riak-py34 | ||
pyenv global riak-py26 riak-py27 riak-py33 riak-py34 | ||
pyenv versions | ||
fi | ||
|
||
# Now install tox | ||
if [ -z "`pip show tox`" ]; then | ||
pip install tox | ||
if [ -z "`pip show tox`" ]; then | ||
echo "ERROR: Install of tox failed" | ||
exit 1 | ||
fi | ||
pyenv rehash | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Tox (http://tox.testrun.org/) is a tool for running tests | ||
# in multiple virtualenvs. This configuration file will run the | ||
# test suite on all supported python versions. To use it, "pip install tox" | ||
# and then run "tox" from this directory. | ||
|
||
[tox] | ||
envlist = py26, py27, py33, py34 | ||
|
||
[testenv] | ||
commands = {envpython} setup.py test | ||
deps = six |