Skip to content

Commit

Permalink
travis: use tox / TOXENV
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Apr 5, 2015
1 parent 0fa214c commit c91bbef
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
50 changes: 30 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,56 @@ matrix:
- python: "2.7"
env: REQ="django<1.8 django-taggit"
python:
- "2.7"
- "3.4"
env:
global:
# Create wheels (skips existing ones from the cached wheelhouse).
- export PIP_FIND_LINKS=$PWD/wheelhouse/
- TESTS_SKIP_LIVESERVER=1
matrix:
- TESTS_SKIP_LIVESERVER=1 REQ="django<1.5 django-taggit django-generic-m2m"
- TESTS_SKIP_LIVESERVER=1 REQ="django<1.6 django-taggit django-generic-m2m"
- TESTS_SKIP_LIVESERVER=1 REQ="django<1.7 django-taggit django-generic-m2m"
- TESTS_SKIP_LIVESERVER=1 REQ="django<1.8 django-taggit django-generic-m2m"
- TOXENV=py27-django14-taggit-genericm2m
- TOXENV=py27-django15-taggit-genericm2m
- TOXENV=py27-django16-taggit-genericm2m
- TOXENV=py27-django17-taggit-genericm2m

# Current stable Django.
- TOXENV=py27-django18
- TOXENV=py27-django18-taggit
- TOXENV=py27-django18-taggit-genericm2m TESTS_SKIP_LIVESERVER= REQ="pytest-cov"
- TOXENV=py27-django18-genericm2m
- TOXENV=py27-django19-taggit-genericm2m
- TOXENV=py27-master

- TOXENV=py34-django15-taggit-genericm2m
- TOXENV=py34-django16-taggit-genericm2m
- TOXENV=py34-django17-taggit-genericm2m
# Current stable Django.
- REQ="django<1.9 django-taggit django-generic-m2m"
- TESTS_SKIP_LIVESERVER=1 REQ="django<1.9 django-generic-m2m"
- TESTS_SKIP_LIVESERVER=1 REQ="django<1.9 django-taggit"
# django-master.
- TESTS_SKIP_LIVESERVER=1 REQ="-e git+https://github.com/django/django.git@master#egg=django django-taggit django-generic-m2m"
- TOXENV=py34-django18
- TOXENV=py34-django18-taggit
- TOXENV=py34-django18-taggit-genericm2m TESTS_SKIP_LIVESERVER= REQ="pytest-cov"
- TOXENV=py34-django18-genericm2m
- TOXENV=py34-django19-taggit-genericm2m
- TOXENV=py34-master

- REQ="pep8"
install:
# NOTE: Django 1.4 wheel is broken; skip it (https://github.com/django/django/pull/2438).
- if [[ $REQ != "django<1.5 django-taggit django-generic-m2m" ]]; then pip wheel $REQ; fi
- pip wheel pep8 coveralls
- pip wheel -r test_project/test_requirements.txt
# Create wheelhouse / cache.
- pip wheel pep8 psycopg2 tox $REQ
- pip wheel -r test_project/test_requirements_without_django.txt

# Install from wheelhouse.
# NOTE: Django 1.4 wheel is broken; skip it (https://github.com/django/django/pull/2438).
- if [[ $REQ == "django<1.5 django-taggit django-generic-m2m" ]]; then pip install $REQ; fi
- pip install psycopg2 tox $REQ
- export PIP_NO_INDEX=1
- pip install $REQ psycopg2 -r test_project/test_requirements_without_django.txt
- pip install -e .
- pip freeze
before_script:
- which pep8 || psql -c 'create database autocomplete_light_test;' -U postgres
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- RUN_TESTS="test_project/manage.py test --traceback autocomplete_light --settings=test_project.settings_postgres"
- RUN_TESTS="tox -- autocomplete_light --ds=test_project.settings_postgres"
# Run tests either with or without coverage (being installed).
- command -v coveralls && RUN_TESTS="coverage run --source=autocomplete_light $RUN_TESTS" || true
- command -v coveralls && RUN_TESTS="$RUN_TESTS --cov" || true
# Run pep8 or the tests.
- which pep8 && { pep8 --exclude=example_apps,tests,migrations --ignore=E124,E128 autocomplete_light; return $?; } || travis_retry $RUN_TESTS
after_success:
Expand All @@ -74,3 +83,4 @@ notifications:
cache:
directories:
$PWD/wheelhouse/
$PWD/.tox/
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,34}-django{15,16,17,18,19,-master} py27-django14
envlist = py{27,34}-django{15,16,17,18,19,-master}{,-taggit}{,-genericm2m}, py27-django14

[testenv]
usedevelop = true
Expand All @@ -13,6 +13,8 @@ deps =
django19: https://github.com/django/django/archive/stable/1.9.x.zip
django-master: https://github.com/django/django/archive/master.zip
-rtest_project/test_requirements_without_django.txt
taggit: django-taggit
genericm2m: django-generic-m2m
setenv =
DJANGO_SETTINGS_MODULE=test_project.settings
PIP_ALLOW_EXTERNAL=true
Expand Down

0 comments on commit c91bbef

Please sign in to comment.