#!/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 [[ "${OPENSSL}" != "0.9.8" ]]; then brew outdated openssl || brew upgrade openssl fi if which -s pyenv; then eval "$(pyenv init -)" fi case "${TOXENV}" in py26) curl -O https://bootstrap.pypa.io/get-pip.py python get-pip.py --user ;; 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.2 pyenv global 3.4.2 ;; py35) pyenv install 3.5.0 pyenv global 3.5.0 ;; pypy) pyenv install pypy-c-jit-latest pyenv global pypy-c-jit-latest ;; pypy3) pyenv install pypy3-2.4.0 pyenv global pypy3-2.4.0 ;; docs) curl -O https://bootstrap.pypa.io/get-pip.py python get-pip.py --user ;; esac pyenv rehash python -m pip install --user virtualenv else # temporary pyenv installation to get latest pypy before container infra upgrade # now using the -latest because of a segfault bug we're encountering in 2.6.1 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-c-jit-latest pyenv global pypy-c-jit-latest fi pip install virtualenv fi python -m virtualenv ~/.venv source ~/.venv/bin/activate pip install tox codecov