Skip to content

Commit

Permalink
Cache $PYENV_ROOT directory when building for OSX in Travis-CI
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Jan 18, 2020
1 parent 2bceb90 commit 3ebd532
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ stages:
directories:
- $HOME/.cargo/bin
- $HOME/.cache/pip
- $HOME/.pyenv
- $TRAVIS_BUILD_DIR/target
- $HOME/Library/Caches/Homebrew
install:
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setuptools
setuptools >=41.0
wheel
twine
setuptools-rust
Expand Down
2 changes: 1 addition & 1 deletion ci/travis/manylinux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ docker exec -it manylinux sh -c \
# --- Install Python deployment dependencies ---------------------------------

log Installing Python requirements
pip install -U -r ci/requirements.txt
pip install -r ci/requirements.txt
1 change: 1 addition & 0 deletions ci/travis/osx/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# --- Using proper Python executable -----------------------------------------

if [ ! "$PYTHON" = "pypy3.7" ]; then
log Activating pyenv
eval "$(pyenv init -)"
pyenv shell $(pyenv versions --bare)
fi
Expand Down
15 changes: 12 additions & 3 deletions ci/travis/osx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@

# --- Install Python ---------------------------------------------------------

log Installing pyenv from GitHub
git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT
if [ ! -e "$PYENV_ROOT/.git" ]; then
log Installing pyenv from GitHub
git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT
else
log Updating pyenv
cd "$PYENV_ROOT"
git pull
cd "$TRAVIS_BUILD_DIR"
fi

log Activating pyenv
eval "$(pyenv init -)"

if [ "$PYTHON" = "pypy3.7" ]; then
Expand Down Expand Up @@ -43,7 +52,7 @@ curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s -- --default-
# --- Install Python requirements --------------------------------------------

log Installing Python requirements
python -m pip install -U -r "$TRAVIS_BUILD_DIR/ci/requirements.txt"
python -m pip install -r "$TRAVIS_BUILD_DIR/ci/requirements.txt"


# --- Setup cargo-cache ------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions ci/travis/osx/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# --- Using proper Python executable -----------------------------------------

if [ ! "$PYTHON" = "pypy3.7" ]; then
log Activating pyenv
eval "$(pyenv init -)"
pyenv shell $(pyenv versions --bare)
fi
Expand Down

0 comments on commit 3ebd532

Please sign in to comment.