Skip to content

Commit fe39fe1

Browse files
committed
Added tox.ini
Updated Travis YML
1 parent a480a39 commit fe39fe1

File tree

3 files changed

+68
-39
lines changed

3 files changed

+68
-39
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,5 @@ Session.vim
7878
*~
7979
# auto-generated tag files
8080
tags
81+
.tox/
82+
.pytest_cache/

.travis.yml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,46 @@
11
language: python
22
sudo: false
3+
34
python:
4-
- 2.7
5-
- 3.4
6-
- 3.5
7-
- 3.6
5+
- 2.7
6+
- 3.4
7+
- 3.5
8+
- 3.6
9+
10+
env:
11+
matrix:
12+
- DJANGO=1.8
13+
- DJANGO=1.9
14+
- DJANGO=1.10
15+
- DJANGO=1.11
16+
- DJANGO=2.0
17+
- DJANGO=master
18+
819
install:
9-
- |
10-
if [ "$TEST_TYPE" = build ]; then
11-
pip install -e .[test]
12-
pip install psycopg2 # Required for Django postgres fields testing
13-
pip install django==$DJANGO_VERSION
14-
if (($(echo "$DJANGO_VERSION <= 1.9" | bc -l))); then # DRF dropped 1.8 and 1.9 support at 3.7.0
15-
pip install djangorestframework==3.6.4
16-
fi
17-
python setup.py develop
18-
elif [ "$TEST_TYPE" = lint ]; then
19-
pip install flake8
20-
fi
20+
- TOX_ENV=py${TRAVIS_PYTHON_VERSION}-django${DJANGO}
21+
- pip install tox
22+
- tox -e $TOX_ENV --notest
2123
script:
22-
- |
23-
if [ "$TEST_TYPE" = lint ]; then
24-
echo "Checking Python code lint."
25-
flake8 graphene_django
26-
exit
27-
elif [ "$TEST_TYPE" = build ]; then
28-
py.test --cov=graphene_django graphene_django examples
29-
fi
24+
- tox -e $TOX_ENV
25+
3026
after_success:
31-
- |
32-
if [ "$TEST_TYPE" = build ]; then
33-
coveralls
34-
fi
35-
env:
36-
matrix:
37-
- TEST_TYPE=build DJANGO_VERSION=1.11
27+
- tox -e $TOX_ENV -- pip install coveralls
28+
- tox -e $TOX_ENV -- coveralls $COVERALLS_OPTION
29+
3830
matrix:
3931
fast_finish: true
4032
include:
41-
- python: '2.7'
42-
env: TEST_TYPE=build DJANGO_VERSION=1.8
43-
- python: '2.7'
44-
env: TEST_TYPE=build DJANGO_VERSION=1.9
45-
- python: '2.7'
46-
env: TEST_TYPE=build DJANGO_VERSION=1.10
47-
- python: '2.7'
48-
env: TEST_TYPE=lint
33+
- python: 3.5
34+
script: tox -e lint
35+
exclude:
36+
- python: 2.7
37+
env: DJANGO=2.0
38+
- python: 2.7
39+
env: DJANGO=master
40+
allow_failures:
41+
- python: 3.7
42+
- env: DJANGO=master
43+
4944
deploy:
5045
provider: pypi
5146
user: syrusakbary

tox.ini

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[tox]
2+
envlist = py{2.7,3.4,3.5,3.6,pypy,pypy3}-django{1.8,1.9,1.10,1.11,2.0},lint
3+
4+
[testenv]
5+
passenv = *
6+
usedevelop = True
7+
setenv =
8+
DJANGO_SETTINGS_MODULE=django_test_settings
9+
basepython =
10+
py2.7: python2.7
11+
py3.4: python3.4
12+
py3.5: python3.5
13+
py3.6: python3.6
14+
pypypy: pypy
15+
pypypy3: pypy3
16+
deps =
17+
-e.[test]
18+
psycopg2
19+
django1.{8,9}: djangorestframework==3.6.4
20+
django1.8: Django>=1.8,<1.9
21+
django1.9: Django>=1.9,<1.10
22+
django1.10: Django>=1.10,<1.11
23+
django1.11: Django>=1.11,<1.12
24+
django2.0: Django>=2.0
25+
djangomaster: https://github.com/django/django/archive/master.zip
26+
commands = {posargs:py.test --cov=graphene_django graphene_django examples}
27+
28+
[testenv:lint]
29+
basepython = python
30+
deps =
31+
prospector
32+
commands = prospector graphene_django -0

0 commit comments

Comments
 (0)