From d2f0bc235022fc7c8ebf4fc2d820f4b423ccd15b Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 23 Nov 2016 17:26:13 -0600 Subject: [PATCH] Install tox in a virtualenv Since TravisCI has an extremely old version of PyPy, we need to use pyenv to install a more recent version. However, pyenv's shims don't persist between the install and script portions of Travis. So we have to use a virtualenv so Travis can find the tox command. --- .travis.yml | 1 + .travis/install.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1bd1014..cdb66351 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,4 +25,5 @@ install: - ./.travis/install.sh script: + - source ~/.venv/bin/activate - tox diff --git a/.travis/install.sh b/.travis/install.sh index 270c733a..da427a65 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -8,10 +8,10 @@ if [[ "${TOXENV}" = pypy* ]]; then pyenv install "pypy-$PYPY_VERSION" pyenv global "pypy-$PYPY_VERSION" - pip install --upgrade tox - pyenv rehash fi - +python -m pip install --upgrade virtualenv +python -m virtualenv ~/.venv +source ~/.venv/bin/activate pip install --upgrade tox