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
5f2e947b0c
|
@ -2,6 +2,10 @@ language: python
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.wheelhouse
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- TOX_ENV=py27-flake8
|
- TOX_ENV=py27-flake8
|
||||||
- TOX_ENV=py27-docs
|
- TOX_ENV=py27-docs
|
||||||
|
@ -28,6 +32,7 @@ env:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install tox
|
- pip install tox
|
||||||
|
- export WHEEL_DIR=$HOME/.wheelhouse
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- tox -e $TOX_ENV
|
- tox -e $TOX_ENV
|
||||||
|
|
31
custom_pip_install.sh
Executable file
31
custom_pip_install.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
while [[ $# > 1 ]]
|
||||||
|
do
|
||||||
|
requirement="$1"
|
||||||
|
# Only requirements with "Django" in the name are being cached
|
||||||
|
if [[ "$requirement" == *"Django"* ]]
|
||||||
|
then
|
||||||
|
# Try to install from cache
|
||||||
|
pip install --no-index --find-links=$WHEEL_DIR "$requirement";
|
||||||
|
EXIT_STATUS=$?
|
||||||
|
# If that fails, try to make a wheel
|
||||||
|
if [ $EXIT_STATUS -ne 0 ]
|
||||||
|
then
|
||||||
|
pip wheel --wheel-dir=$WHEEL_DIR "$requirement";
|
||||||
|
EXIT_STATUS=$?
|
||||||
|
# If that fails, install wheel and make wheel
|
||||||
|
if [ $EXIT_STATUS -ne 0 ]
|
||||||
|
then
|
||||||
|
# Wheel version same as in requirements/requirements-packaging.txt
|
||||||
|
pip install wheel==0.24.0;
|
||||||
|
pip wheel --wheel-dir=$WHEEL_DIR "$requirement";
|
||||||
|
fi
|
||||||
|
# Install from cache
|
||||||
|
pip install --no-index --find-links=$WHEEL_DIR "$requirement";
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
pip install "$requirement";
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
3
tox.ini
3
tox.ini
|
@ -6,6 +6,9 @@ envlist =
|
||||||
{py27,py32,py33,py34}-django{17,18beta}
|
{py27,py32,py33,py34}-django{17,18beta}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
install_command =
|
||||||
|
{toxinidir}/custom_pip_install.sh {packages}
|
||||||
|
|
||||||
commands = ./runtests.py --fast
|
commands = ./runtests.py --fast
|
||||||
setenv =
|
setenv =
|
||||||
PYTHONDONTWRITEBYTECODE=1
|
PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user