From c6c1a96136aec55042201c7e61041349f1f76014 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Sat, 12 Dec 2015 17:56:05 +0000 Subject: [PATCH] .travis/install.sh: shell script to install pyenv (used to install various Pythons); install virtualenv and tox --- .travis/install.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 .travis/install.sh diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100755 index 000000000..ead598123 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + brew update || brew update + brew install pyenv + brew outdated pyenv || brew upgrade pyenv + + if which -s pyenv; then + eval "$(pyenv init -)" + fi + + case "${TOXENV}" in + py27) + 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) + pyenv install 3.5.0 + pyenv global 3.5.0 + ;; + pypy) + pyenv install pypy-4.0.1 + pyenv global pypy-4.0.1 + ;; + esac + pyenv rehash + python -m pip install --user virtualenv +else + # install pyenv to get latest pypy + 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 -)" + pyenv install pypy-4.0.1 + pyenv global pypy-4.0.1 + fi + pip install virtualenv +fi + +python -m virtualenv ~/.venv +source ~/.venv/bin/activate +pip install tox