Skip to content

Commit

Permalink
Get pip caching working again
Browse files Browse the repository at this point in the history
Pip deprecated the DOWNLOAD_CACHE environment variable in favour of
managing the cache by itself. I stumbled across a good tweet showing how
to handle this now:
https://twitter.com/ghickman/status/575974883647209473

This commit implements those changes.
  • Loading branch information
maiksprenger committed Mar 12, 2015
1 parent d536a5c commit d09a2a9
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ sudo: false

# Cache pip downloads
cache:
# Apparently if you override the install command that silently disables the
# cache: pip support. This is less than ideal and @dstufft opened up
# travis-ci/travis-ci#3239 to hopefully get that addressed. For now we
# manually add the pip cache directory to the build cache.
directories:
- $HOME/.pip-cache/
- ~/.cache/pip

language: python

Expand All @@ -17,13 +21,26 @@ python:
env:
global:
# $TRANSIFEX_PASSWORD for oscar_bot (used in transifex.sh)
secure: FuIlzEsGJiAwhaIRBmRNsq9eXmuzs25fX6BChknW4lDyVAySWMp0+Zps9Bd0JgfFYUG3Ip+OTmksYIoTUsG25ZJS9cq1IFt3QKUAN70YCI/4ZBLeIdICPEyxq+Km179+NeEXmBUug17RLMLxh3MWfO+RKUHK9yHIPNNpq0dNyoo=
- secure: FuIlzEsGJiAwhaIRBmRNsq9eXmuzs25fX6BChknW4lDyVAySWMp0+Zps9Bd0JgfFYUG3Ip+OTmksYIoTUsG25ZJS9cq1IFt3QKUAN70YCI/4ZBLeIdICPEyxq+Km179+NeEXmBUug17RLMLxh3MWfO+RKUHK9yHIPNNpq0dNyoo=

# These two environment variables could be set by Travis itself, or Travis
# could configure itself in /etc/, ~/, or inside of the virtual
# environments. In any case if these two values get configured then end
# users only need to enable the pip cache and manually run pip wheel before
# running pip install.
- PIP_WHEEL_DIR=$HOME/.cache/pip/wheels
- PIP_FIND_LINKS=file://$HOME/.cache/pip/wheels
matrix:
- DJANGO=Django==1.6.10
- DJANGO=Django==1.7.4

install:
- pip install -e . -r requirements.txt $DJANGO --download-cache $HOME/.pip-cache
# Before installation, we'll run ``pip wheel``, this will build wheels for
# anything that doesn't already have one on PyPI.
- pip wheel -r requirements.txt
# Actually install our dependencies now, this will pull from the directory
# that the first command placed the Wheels into.
- pip install -e . -r requirements.txt $DJANGO

before_script:
# Create testing databases for running migrations against
Expand Down

0 comments on commit d09a2a9

Please sign in to comment.