Skip to content

Added tox.ini and improved travis.yml #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ Session.vim
*~
# auto-generated tag files
tags
.tox/
.pytest_cache/
96 changes: 47 additions & 49 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,60 @@
language: python
sudo: required
dist: xenial

python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7

env:
matrix:
- DJANGO=1.11
- DJANGO=2.1
- DJANGO=2.2
- DJANGO=master

install:
- |
if [ "$TEST_TYPE" = build ]; then
pip install -e .[test]
pip install psycopg2==2.8.2 # Required for Django postgres fields testing
pip install django==$DJANGO_VERSION
python setup.py develop
elif [ "$TEST_TYPE" = lint ]; then
pip install flake8==3.7.7
fi
- TOX_ENV=py${TRAVIS_PYTHON_VERSION}-django${DJANGO}
- pip install tox
- tox -e $TOX_ENV --notest
script:
- |
if [ "$TEST_TYPE" = lint ]; then
echo "Checking Python code lint."
flake8 graphene_django
exit
elif [ "$TEST_TYPE" = build ]; then
py.test --cov=graphene_django graphene_django examples
fi
- tox -e $TOX_ENV

after_success:
- |
if [ "$TEST_TYPE" = build ]; then
coveralls
fi
env:
matrix:
- TEST_TYPE=build DJANGO_VERSION=1.11
- tox -e $TOX_ENV -- pip install coveralls
- tox -e $TOX_ENV -- coveralls $COVERALLS_OPTION

matrix:
fast_finish: true
include:
- python: '3.4'
env: TEST_TYPE=build DJANGO_VERSION=2.0
- python: '3.5'
env: TEST_TYPE=build DJANGO_VERSION=2.0
- python: '3.6'
env: TEST_TYPE=build DJANGO_VERSION=2.0
- python: '3.5'
env: TEST_TYPE=build DJANGO_VERSION=2.1
- python: '3.6'
env: TEST_TYPE=build DJANGO_VERSION=2.1
- python: '3.6'
env: TEST_TYPE=build DJANGO_VERSION=2.2
- python: '3.7'
env: TEST_TYPE=build DJANGO_VERSION=2.2
- python: '2.7'
env: TEST_TYPE=lint
- python: '3.6'
env: TEST_TYPE=lint
- python: '3.7'
env: TEST_TYPE=lint
- python: 3.5
script: tox -e lint
exclude:
- python: 2.7
env: DJANGO=2.1
- python: 2.7
env: DJANGO=2.2
- python: 2.7
env: DJANGO=master
- python: 3.4
env: DJANGO=2.1
- python: 3.4
env: DJANGO=2.2
- python: 3.4
env: DJANGO=master
- python: 3.5
env: DJANGO=master
- python: 3.7
env: DJANGO=1.10
- python: 3.7
env: DJANGO=1.11
allow_failures:
- python: 3.7
- env: DJANGO=master

deploy:
provider: pypi
user: syrusakbary
Expand Down
31 changes: 31 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
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

[testenv]
passenv = *
usedevelop = True
setenv =
DJANGO_SETTINGS_MODULE=django_test_settings
basepython =
py2.7: python2.7
py3.4: python3.4
py3.5: python3.5
py3.6: python3.6
py3.7: python3.7
pypypy: pypy
pypypy3: pypy3
deps =
-e.[test]
psycopg2
django1.10: Django>=1.10,<1.11
django1.11: Django>=1.11,<1.12
django2.0: Django>=2.0
django2.1: Django>=2.1
djangomaster: https://github.com/django/django/archive/master.zip
commands = {posargs:py.test --cov=graphene_django graphene_django examples}

[testenv:lint]
basepython = python
deps =
prospector
commands = prospector graphene_django -0