wooyek/cookiecutter-django-app

View on GitHub
{{cookiecutter.project_slug}}/tox.ini

Summary

Maintainability
Test Coverage
[tox]
envlist = clean, py27-django-{111}, {py34,py36,py35}-django-{111,20}, {py36,py35}-django-21, check, report{% if cookiecutter.include_sphinx_doc == 'y' %}, docs, spell{% endif %}

[travis]
python =
    3.3: py33
    3.4: py34
    3.5: py35
    3.6: py36
    3.7: py37
    2.7: py27

[travis:env]
DJANGO =
    1.10 : django-110
    1.11 : django-111
    2.0 : django-20
    2.1 : django-21

[testenv]
# necessary to make cov find the .coverage file
# see http://blog.ionelmc.ro/2014/05/25/python-packaging/
usedevelop = true
setenv =
    PYTHONPATH = {toxinidir}
commands =
    coverage run  --source src --parallel-mode setup.py test
# coverage run --source {{ cookiecutter.package_name }} runtests.py
;    coverage report
;    coverage xml

deps =
    coverage
    django-111: Django>=1.11
    django-20: Django>=2.0rc1
    django-21: -egit+https://github.com/django/django.git#egg=django
    -r{toxinidir}/requirements/testing.txt
basepython =
    py36-django-{111,20,master}: python3.6
    py35-django-{111,20,master}: python3.5
    py34-django-{111,20,master}: python3.4
    py33-django-{111,20,master}: python3.3
    py27-django-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


{% if cookiecutter.include_sphinx_doc == 'y' %}
[testenv:spell]
setenv =
    SPELLCHECK = 1
commands =
    sphinx-build -b spelling docs dist/docs
extras = factories
deps = -rdocs/requirements.txt

[testenv:docs]
extras = factories
deps = -rrequirements/development.txt
commands =
    sphinx-build {posargs: -E} -b html docs dist/docs
    sphinx-build -b linkcheck docs dist/docs
{% endif %}

[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 --verbose --check-only --diff --recursive src tests setup.py

[testenv:report]
deps =
    coverage
    pytest
    pytest-cov
skip_install = true
usedevelop = false
commands =
    coverage combine --append
    coverage report
    coverage html

[testenv:clean]
commands = coverage erase
skip_install = true
usedevelop = false
deps = coverage


[pytest]
DJANGO_SETTINGS_MODULE = tests.settings
python_files = tests.py test_*.py *_tests.py
;addopts = -n auto
;addopts = -n8
testpaths = tests
python_classes = *Tests

[isort]
;known_first_party = {{ cookiecutter.package_name }}
known_localfolder = {{ cookiecutter.package_name }},test,tests,test_data
;forced_separate = {{ cookiecutter.package_name }}
# This is a workaround for tox putting libraries in firstparty
default_section = THIRDPARTY
line_length = 200
not_skip = __init__.py
skip = migrations
;skip-glob = */migrations/*
# Uncomment these is you have problems indetifying sections
;import_heading_stdlib = Standard Library
;import_heading_firstparty = My Stuff
;import_heading_thirdparty = Thirt party libraries
;import_heading_localfolder = Local