2015-12-12 17:56:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
if [[ "$(uname -s)" == 'Darwin' ]]; then
|
2016-04-11 01:51:12 +01:00
|
|
|
# install pyenv from the git repo (quicker than using brew)
|
|
|
|
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
|
|
|
|
PYENV_ROOT="$HOME/.pyenv"
|
|
|
|
PATH="$PYENV_ROOT/bin:$PATH"
|
|
|
|
eval "$(pyenv init -)"
|
2015-12-12 17:56:05 +00:00
|
|
|
|
|
|
|
case "${TOXENV}" in
|
|
|
|
py27)
|
2016-04-11 01:51:12 +01:00
|
|
|
# install pip on the system python
|
2015-12-12 17:56:05 +00:00
|
|
|
curl -O https://bootstrap.pypa.io/get-pip.py
|
|
|
|
python get-pip.py --user
|
|
|
|
;;
|
|
|
|
py33)
|
|
|
|
pyenv install 3.3.6
|
|
|
|
pyenv global 3.3.6
|
|
|
|
;;
|
|
|
|
py34)
|
|
|
|
pyenv install 3.4.3
|
|
|
|
pyenv global 3.4.3
|
|
|
|
;;
|
|
|
|
py35)
|
2016-04-11 01:51:12 +01:00
|
|
|
pyenv install 3.5.1
|
|
|
|
pyenv global 3.5.1
|
2015-12-12 17:56:05 +00:00
|
|
|
;;
|
|
|
|
pypy)
|
2016-04-08 22:04:28 +01:00
|
|
|
pyenv install pypy-5.0.0
|
|
|
|
pyenv global pypy-5.0.0
|
2015-12-12 17:56:05 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
pyenv rehash
|
2016-04-11 01:51:12 +01:00
|
|
|
python -m pip install --user --upgrade pip virtualenv
|
2015-12-12 17:56:05 +00:00
|
|
|
else
|
2016-04-11 01:51:12 +01:00
|
|
|
# on Linux, we only need pyenv to get the latest pypy
|
2015-12-12 17:56:05 +00:00
|
|
|
if [[ "${TOXENV}" == "pypy" ]]; then
|
|
|
|
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
|
|
|
|
PYENV_ROOT="$HOME/.pyenv"
|
|
|
|
PATH="$PYENV_ROOT/bin:$PATH"
|
|
|
|
eval "$(pyenv init -)"
|
2016-04-08 22:04:28 +01:00
|
|
|
pyenv install pypy-5.0.0
|
|
|
|
pyenv global pypy-5.0.0
|
2016-04-11 01:51:12 +01:00
|
|
|
pyenv rehash
|
2015-12-12 17:56:05 +00:00
|
|
|
fi
|
2016-04-11 01:51:12 +01:00
|
|
|
pip install --upgrade pip virtualenv
|
2015-12-12 17:56:05 +00:00
|
|
|
fi
|
|
|
|
|
2016-04-11 01:51:12 +01:00
|
|
|
# activate virtualenv and install test requirements
|
2015-12-12 17:56:05 +00:00
|
|
|
python -m virtualenv ~/.venv
|
|
|
|
source ~/.venv/bin/activate
|
2016-02-06 22:17:50 +00:00
|
|
|
pip install -r dev-requirements.txt
|