Skip to content

Commit d99e6ed

Browse files
author
Ryan P Kilby
authored
Add tox w/ travis integration (#158)
* Add tox.ini, simplify travis config * Use travis to report allowed failures
1 parent ca2c290 commit d99e6ed

File tree

2 files changed

+60
-11
lines changed

2 files changed

+60
-11
lines changed

.travis.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,32 @@ python:
88
- "3.4"
99
- "3.5"
1010
- "3.6"
11+
1112
env:
12-
- DJANGO="django>=1.10.0,<1.11.0" REST_FRAMEWORK="djangorestframework>=3.5,<3.6"
13-
- DJANGO="django>=1.9.0,<1.10.0" REST_FRAMEWORK="djangorestframework>=3.5,<3.6"
14-
- DJANGO="django>=1.8.0,<1.9.0" REST_FRAMEWORK="djangorestframework>=3.5,<3.6"
15-
- DJANGO="django>=1.8.0,<1.9.0" REST_FRAMEWORK="djangorestframework>=3.4,<3.5"
13+
- DJANGO=1.10 REST_FRAMEWORK=3.5
14+
- DJANGO=1.9 REST_FRAMEWORK=3.5
15+
- DJANGO=1.8 REST_FRAMEWORK=3.5
16+
- DJANGO=1.8 REST_FRAMEWORK=3.4
17+
1618
install:
17-
- travis_retry pip install -q $DJANGO $REST_FRAMEWORK coverage
18-
- pip install .
19+
- travis_retry pip install tox tox-travis coverage
1920
script:
20-
- coverage run manage.py test -v 2 $OPTS
21-
- coverage report
21+
- tox -- -v 2
2222
after_success:
23+
- coverage report
2324
- bash <(curl -s https://codecov.io/bash)
2425

2526
matrix:
2627
include:
2728
- python: "3.6"
28-
env: DJANGO="django>=1.10.0,<1.11.0" REST_FRAMEWORK="djangorestframework>=3.5,<3.6" OPTS="tests.perf"
29+
env: TOXENV="performance"
30+
- python: "3.6"
31+
env: TOXENV="warnings"
2932
exclude:
3033
- python: "3.3"
31-
env: DJANGO="django>=1.10.0,<1.11.0" REST_FRAMEWORK="djangorestframework>=3.5,<3.6"
34+
env: DJANGO=1.10 REST_FRAMEWORK=3.5
3235
- python: "3.3"
33-
env: DJANGO="django>=1.9.0,<1.10.0" REST_FRAMEWORK="djangorestframework>=3.5,<3.6"
36+
env: DJANGO=1.9 REST_FRAMEWORK=3.5
37+
allow_failures:
38+
- env: TOXENV="warnings"
3439
fast_finish: true

tox.ini

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[tox]
2+
envlist =
3+
; Test two versions of DRF against Django's LTS
4+
py{27,33,34,35,36}-django18-restframework{34,35},
5+
py{27,34,35,36}-django{19,110}-restframework{35},
6+
performance, warnings,
7+
8+
[travis]
9+
unignore_outcomes = true
10+
11+
[travis:env]
12+
DJANGO =
13+
1.8: django18
14+
1.9: django19
15+
1.10: django110
16+
17+
REST_FRAMEWORK =
18+
3.4: restframework34
19+
3.5: restframework35
20+
21+
[testenv]
22+
commands = coverage run manage.py test {posargs}
23+
setenv =
24+
PYTHONDONTWRITEBYTECODE=1
25+
deps =
26+
coverage>=4.0
27+
django18: django>=1.8.0,<1.9.0
28+
django19: django>=1.9.0,<1.10.0
29+
django110: django>=1.10.0,<1.11.0
30+
restframework34: djangorestframework>=3.4,<3.5
31+
restframework35: djangorestframework>=3.5,<3.6
32+
33+
[testenv:performance]
34+
commands = python manage.py test tests.perf {posargs}
35+
deps =
36+
django
37+
djangorestframework
38+
39+
[testenv:warnings]
40+
ignore_outcome = True
41+
commands = python -Werror manage.py test {posargs}
42+
deps =
43+
https://github.com/django/django/archive/master.tar.gz
44+
https://github.com/tomchristie/django-rest-framework/archive/master.tar.gz

0 commit comments

Comments
 (0)