From 8a5cc800cb3ed5ad55bb7b2d765b457953753ce5 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Mon, 31 Aug 2015 20:26:22 +0200 Subject: [PATCH] Revert pip cache changes. Use pip's built-in retry. --- .travis.yml | 6 ++++-- tools/travis_before_install.sh | 6 +++--- tools/travis_notes.txt | 5 +++-- tools/travis_script.sh | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 791631b4..1a74ef3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,9 @@ language: python sudo: false cache: - - pip + # See http://docs.travis-ci.com/user/caching/#pip-cache + directories: + - $HOME/.cache/pip addons: apt: packages: @@ -34,7 +36,7 @@ python: - 3.4 before_install: - - pip install --upgrade pip + - pip install -U pip - source tools/travis_before_install.sh - which python; python --version diff --git a/tools/travis_before_install.sh b/tools/travis_before_install.sh index fce0a367..3cbb08b4 100755 --- a/tools/travis_before_install.sh +++ b/tools/travis_before_install.sh @@ -49,7 +49,7 @@ fi virtualenv -p python ~/venv source ~/venv/bin/activate -retry pip install -q wheel flake8 coveralls nose +pip install --retries 3 -q wheel flake8 coveralls nose # on Python 3.2, use matplotlib 1.3.1 if [[ $TRAVIS_PYTHON_VERSION == 3.2 ]]; then @@ -60,9 +60,9 @@ fi for requirement in $WHEELBINARIES; do WHEELS="$WHEELS $(grep $requirement requirements.txt)" done -retry pip install -q $WHEELHOUSE $WHEELS +pip install --retries 3 -q $WHEELHOUSE $WHEELS -retry pip install -q -r requirements.txt +pip install --retries 3 -q -r requirements.txt section () { diff --git a/tools/travis_notes.txt b/tools/travis_notes.txt index 84271821..0b18aeb1 100644 --- a/tools/travis_notes.txt +++ b/tools/travis_notes.txt @@ -14,8 +14,9 @@ the yaml file is valid. set -ex ``` -- Use the `retry` bash function from `before_install.sh` before a command to have it try 3 times before -failing (useful for installing from third party sources). +- Use the `retry` bash function from `before_install.sh` before a command to +have it try 3 times before failing. +- Use `pip install --retries N` for retrying package downloads. - Use the `section` function to start a folded section of the script. Section names must have underscores or dots instead of spaces and must be accompanied by a corresponding `section_end` call. diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 27f0615e..65fc85c5 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -44,7 +44,7 @@ else fi if [[ $PY == 2.* ]]; then - retry pip install -q pyamg + pip install --retries 3 -q pyamg fi section_end "Install.optional.dependencies"