Skip to content

Commit cb9eed6

Browse files
committed
Added tox.ini
Updated Travis YML
1 parent b0cba39 commit cb9eed6

File tree

3 files changed

+80
-49
lines changed

3 files changed

+80
-49
lines changed

.gitignore

+2
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

+47-49
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,60 @@
11
language: python
22
sudo: required
33
dist: xenial
4+
45
python:
5-
- 2.7
6-
- 3.4
7-
- 3.5
8-
- 3.6
9-
- 3.7
6+
- 2.7
7+
- 3.4
8+
- 3.5
9+
- 3.6
10+
- 3.7
11+
12+
env:
13+
matrix:
14+
- DJANGO=1.11
15+
- DJANGO=2.1
16+
- DJANGO=2.2
17+
- DJANGO=master
18+
1019
install:
11-
- |
12-
if [ "$TEST_TYPE" = build ]; then
13-
pip install -e .[test]
14-
pip install psycopg2==2.8.2 # Required for Django postgres fields testing
15-
pip install django==$DJANGO_VERSION
16-
python setup.py develop
17-
elif [ "$TEST_TYPE" = lint ]; then
18-
pip install flake8==3.7.7
19-
fi
20+
- TOX_ENV=py${TRAVIS_PYTHON_VERSION}-django${DJANGO}
21+
- pip install tox
22+
- tox -e $TOX_ENV --notest
2023
script:
21-
- |
22-
if [ "$TEST_TYPE" = lint ]; then
23-
echo "Checking Python code lint."
24-
flake8 graphene_django
25-
exit
26-
elif [ "$TEST_TYPE" = build ]; then
27-
py.test --cov=graphene_django graphene_django examples
28-
fi
24+
- tox -e $TOX_ENV
25+
2926
after_success:
30-
- |
31-
if [ "$TEST_TYPE" = build ]; then
32-
coveralls
33-
fi
34-
env:
35-
matrix:
36-
- TEST_TYPE=build DJANGO_VERSION=1.11
27+
- tox -e $TOX_ENV -- pip install coveralls
28+
- tox -e $TOX_ENV -- coveralls $COVERALLS_OPTION
29+
3730
matrix:
3831
fast_finish: true
3932
include:
40-
- python: '3.4'
41-
env: TEST_TYPE=build DJANGO_VERSION=2.0
42-
- python: '3.5'
43-
env: TEST_TYPE=build DJANGO_VERSION=2.0
44-
- python: '3.6'
45-
env: TEST_TYPE=build DJANGO_VERSION=2.0
46-
- python: '3.5'
47-
env: TEST_TYPE=build DJANGO_VERSION=2.1
48-
- python: '3.6'
49-
env: TEST_TYPE=build DJANGO_VERSION=2.1
50-
- python: '3.6'
51-
env: TEST_TYPE=build DJANGO_VERSION=2.2
52-
- python: '3.7'
53-
env: TEST_TYPE=build DJANGO_VERSION=2.2
54-
- python: '2.7'
55-
env: TEST_TYPE=lint
56-
- python: '3.6'
57-
env: TEST_TYPE=lint
58-
- python: '3.7'
59-
env: TEST_TYPE=lint
33+
- python: 3.5
34+
script: tox -e lint
35+
exclude:
36+
- python: 2.7
37+
env: DJANGO=2.1
38+
- python: 2.7
39+
env: DJANGO=2.2
40+
- python: 2.7
41+
env: DJANGO=master
42+
- python: 3.4
43+
env: DJANGO=2.1
44+
- python: 3.4
45+
env: DJANGO=2.2
46+
- python: 3.4
47+
env: DJANGO=master
48+
- python: 3.5
49+
env: DJANGO=master
50+
- python: 3.7
51+
env: DJANGO=1.10
52+
- python: 3.7
53+
env: DJANGO=1.11
54+
allow_failures:
55+
- python: 3.7
56+
- env: DJANGO=master
57+
6058
deploy:
6159
provider: pypi
6260
user: syrusakbary

tox.ini

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[tox]
2+
envlist = py{2.7,3.4,3.5,3.6,3.7,pypy,pypy3}-django{1.10,1.11,2.0,2.1,2.2,master},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+
py3.7: python3.7
15+
pypypy: pypy
16+
pypypy3: pypy3
17+
deps =
18+
-e.[test]
19+
psycopg2
20+
django1.10: Django>=1.10,<1.11
21+
django1.11: Django>=1.11,<1.12
22+
django2.0: Django>=2.0
23+
django2.1: Django>=2.1
24+
djangomaster: https://github.com/django/django/archive/master.zip
25+
commands = {posargs:py.test --cov=graphene_django graphene_django examples}
26+
27+
[testenv:lint]
28+
basepython = python
29+
deps =
30+
prospector
31+
commands = prospector graphene_django -0

0 commit comments

Comments
 (0)