diff --git a/.travis.yml b/.travis.yml index 9f6f8c17..8b867b27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,20 @@ matrix: env: TOXENV=py36 install: + - | + if [ "$TOXENV" = "pypy" ]; then + export PYENV_ROOT="$HOME/.pyenv" + if [ -f "$PYENV_ROOT/bin/pyenv" ]; then + pushd "$PYENV_ROOT" && git pull && popd + else + rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT" + fi + # get latest portable PyPy from pyenv directly (thanks to natural version sort option -V) + export PYPY_VERSION=`"$PYENV_ROOT/bin/pyenv" install --list |grep -o -E 'pypy2.7-portable-[0-9][\.0-9]*$' |sort -V |tail -1` + "$PYENV_ROOT/bin/pyenv" install --skip-existing "$PYPY_VERSION" + virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION" + source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate" + fi - pip install -U tox twine wheel codecov script: tox after_success: