summaryrefslogtreecommitdiff
path: root/.travis.yml
diff options
context:
space:
mode:
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml15
1 files changed, 7 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 3700697..1fd549e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,7 +11,6 @@ cache:
pip: true
directories:
- $HOME/.pyenv/cache
- - $HOME/.pyenv/versions
env:
- PYENV_VERSION=2.1.3
- PYENV_VERSION=2.2.3
@@ -63,18 +62,18 @@ before_install:
- export PATH=~/.pyenv/bin:$PATH
- eval "$(pyenv init -)"
# If the selected Python version is installed locally (travis-ci native), activate it.
- # Otherwise, install it using pyenv (if not already installed) and set up a separate (uncached) virtualenv.
+ # If there's a cached Python that's already been built, extract it.
+ # Otherwise, install it using pyenv (if not already installed), and then make a cache tarball.
- |-
if [ -e ~/virtualenv/python"$PYENV_VERSION"/bin/activate ] ; then
. ~/virtualenv/python"$PYENV_VERSION"/bin/activate
unset PYENV_VERSION
+ elif [ -e ~/.pyenv/cache/built-"$PYENV_VERSION".tar.gz.done ]; then
+ tar --strip-components=1 -C ~/.pyenv/versions/"${PYENV_VERSION}" -xvzf ~/.pyenv/cache/built-"$PYENV_VERSION".tar.gz
else
- if ! pyenv version 2>/dev/null; then
- pyenv install "$PYENV_VERSION"
- pip install --upgrade pip setuptools wheel virtualenv
- fi
- virtualenv --never-download ~/uncached-virtualenv
- . ~/uncached-virtualenv/activate
+ pyenv install "$PYENV_VERSION"
+ tar -C ~/.pyenv/versions -cvzf ~/.pyenv/cache/built-"$PYENV_VERSION".tar.gz "$PYENV_VERSION"
+ touch ~/.pyenv/cache/built-"$PYENV_VERSION".tar.gz.done
fi
script:
- "major_version=$( python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1 )"