mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 21:40:13 +03:00
Add travis pip wheel caching
This commit is contained in:
parent
fde02ae6eb
commit
5a0b21b60f
|
@ -2,6 +2,10 @@ language: python
|
|||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.wheelhouse
|
||||
|
||||
env:
|
||||
- TOX_ENV=py27-flake8
|
||||
- TOX_ENV=py27-docs
|
||||
|
@ -28,6 +32,7 @@ env:
|
|||
|
||||
install:
|
||||
- pip install tox
|
||||
- export WHEEL_DIR=$HOME/.wheelhouse/$TOX_ENV
|
||||
|
||||
script:
|
||||
- tox -e $TOX_ENV
|
||||
|
|
21
custom_pip_install.sh
Executable file
21
custom_pip_install.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
if [[ "$@" == "djangorestframework" ]]; then
|
||||
# Caching djangorestframework package would invalidate Travis cache on every build
|
||||
pip install "$@"
|
||||
else
|
||||
# Try to install from cache
|
||||
pip install --no-index --find-links=$WHEEL_DIR "$@"
|
||||
EXIT_STATUS=$?
|
||||
# If that fails, try to make a wheel
|
||||
if [ $EXIT_STATUS -ne 0 ]; then
|
||||
pip wheel --wheel-dir=$WHEEL_DIR "$@"
|
||||
EXIT_STATUS=$?
|
||||
# If that fails, install wheel and make wheel
|
||||
if [ $EXIT_STATUS -ne 0 ]; then
|
||||
pip install wheel==0.24.0
|
||||
pip wheel --wheel-dir=$WHEEL_DIR "$@"
|
||||
fi
|
||||
# Install from cache
|
||||
pip install --no-index --find-links=$WHEEL_DIR "$@"
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user