tox.ini
[tox]
# Django support for different python versions reference
# https://docs.djangoproject.com/en/dev/faq/install/#faq-python-version-support
envlist =
clean,
py27-django-{18,19,110,111},
py33-django-18,
py{34,35}-django-{18,19,110},
py{34,35,36}-django-{111,20},
py{35,36,37}-django-{master},
check, docs, spell, report
[travis]
python =
3.3: py33
3.4: py34
3.5: py35
3.6: py36
3.7: py37
2.7: py27
[travis:env]
DJANGO =
1.8: django-18
1.9: django-19
1.10: django-110
1.11: django-111
2.0: django-20
2.1: django-21
master: django-master
[testenv]
# necessary to make cov find the .coverage file
# see http://blog.ionelmc.ro/2014/05/25/python-packaging/
usedevelop = True
passenv = DJANGO_SETTINGS_MODULE
setenv =
PYTHONPATH = {toxinidir}
commands =
# Run ceoverage on package setup test to reliably recreate env
# setup.py test may change package versions to conform to other packages requirements
coverage run --source src --parallel-mode setup.py test
# Uncomment there to fail quicly or if coverage won't be combined
# coverage report
# coverage xml
# Pytest without coverage
# pytest --basetemp = {envtmpdir} tests
# Pytest with coverage
# coverage run --source src -m pytest --basetemp={envtmpdir}
# Pytest with pytest-cov
# pytest --cov=src --cov=tests --cov-append --basetemp={envtmpdir} tests
deps =
coverage
pytest==3.1.3 ; python_version < '3.4'
pytest ; python_version > '3.3'
pytest-cov
pytest-django
python-coveralls
django-18: Django>=1.8,<1.9
django-19: Django>=1.9,<1.10
django-110: Django>=1.10,<1.11
django-111: Django>=1.11,<1.12
django-20: Django>=2.0,<2.1
django-21: Django>=2.1,<2.2
django-master: -egit+https://github.com/django/django.git#egg=django
-r{toxinidir}/requirements/testing.txt
{toxinidir}/example_project
basepython =
py36-django-{111,20,21,master}: python3.6
py35-django-{18,19,110,111,20,21,master}: python3.5
py34-django-{18,19,110,111}: python3.4
py33-django-{18}: python3.3
py27-django-{18,19,110,111}: python2.7
# https://blog.ionelmc.ro/2014/05/25/python-packaging/#ci-templates-tox-ini
# https://hynek.me/articles/testing-packaging/
{docs,spell}: python3.5
{bootstrap,clean,check,report,extension-coveralls,coveralls,codecov}: python3.5
[testenv:spell]
setenv =
SPELLCHECK = 1
commands =
sphinx-build -b spelling docs dist/docs
extras = factories
skip_install = true
usedevelop = false
deps =
-rrequirements/base.txt
-rrequirements/development.txt
[testenv:docs]
extras = factories
deps =
-rrequirements/base.txt
-rrequirements/development.txt
commands =
sphinx-build {posargs: -E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
[testenv:check]
deps =
docutils
check-manifest
flake8
readme-renderer
pygments
isort
skip_install = true
usedevelop = false
commands =
python setup.py check --strict --metadata --restructuredtext
check-manifest --ignore .idea,.idea/* {toxinidir}
flake8 src tests example_project setup.py
isort --check-only --diff --recursive src tests example_project setup.py
[testenv:report]
setenv =
COVERAGE_FILE = .tmp/.coverage
deps =
coverage
pytest
pytest-cov
skip_install = true
usedevelop = false
commands =
# TODO: pytest coverage combine needs workaround file naming
# py.test --cov-report html
coverage combine --append
coverage report
coverage html
[testenv:clean]
commands = coverage erase
skip_install = true
usedevelop = false
deps = coverage