tox.ini 4.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
[tox]
envlist = 
    clean,setup,safety,style,spell,link,docs,
    py27-django18,
    py27-django19,
    py27-django110,
    py27-django111,
    py34-django18,
    py34-django19,
    py34-django110,
    py34-django111,
    py35-django18,
    py35-django19,
    py35-django110,
    py35-django111,
    py36-django18,
    py36-django19,
    py36-django110,
    py36-django111,
    py37-dev-django18,
    py37-dev-django19,
    py37-dev-django110,
    py37-dev-django111,
    pypy-django18,
    pypy-django19,
    pypy-django110,
    pypy-django111,
    report
skip_missing_interpreters = true

[testenv]
setenv = 
    PYTHONPATH = {toxinidir}:{toxinidir}/src:{toxinidir}/tests
    PYTHONUNBUFFERED=yes
commands = {posargs:pytest --cov --cov-report=term-missing -vv runtests.py tests}
deps = 
    django18: Django>=1.8,<1.9
    django19: Django>=1.9,<1.10
    django110: Django>=1.10,<1.11
    django111: Django>=1.11,<1.12
    -r{toxinidir}/requirements/test.txt
passenv = *
usedevelop = false
whitelist_externals = tox

[testenv:test]
description = Run all the Python/Django test environments.
skip_install = true
commands = tox -e py27-django18,py27-django19,py27-django110,py27-django111,py34-django18,py34-django19,py34-django110,py34-django111,py35-django18,py35-django19,py35-django110,py35-django111,py36-django18,py36-django19,py36-django110,py36-django111,py37-dev-django18,py37-dev-django19,py37-dev-django110,py37-dev-django111,pypy-django18,pypy-django19,pypy-django110,pypy-django111,
    tox -e report

[testenv:dtest]
description = Run all the Python/Django test environments in parallel.
skip_install = true
deps = detox
commands = 
    detox -e py27-django18,py27-django19,py27-django110,py27-django111,py34-django18,py34-django19,py34-django110,py34-django111,py35-django18,py35-django19,py35-django110,py35-django111,py36-django18,py36-django19,py36-django110,py36-django111,py37-dev-django18,py37-dev-django19,py37-dev-django110,py37-dev-django111,pypy-django18,pypy-django19,pypy-django110,pypy-django111,
    tox -e report

[testenv:detox]
description = Run all the environments in parallel.
skip_install = true
deps = detox
commands = 
    detox -e clean,setup,safety,style,spell,link,docs,py27-django18,py27-django19,py27-django110,py27-django111,py34-django18,py34-django19,py34-django110,py34-django111,py35-django18,py35-django19,py35-django110,py35-django111,py36-django18,py36-django19,py36-django110,py36-django111,py37-dev-django18,py37-dev-django19,py37-dev-django110,py37-dev-django111,pypy-django18,pypy-django19,pypy-django110,pypy-django111,
    tox -e report

[testenv:docs]
description = Build the documentation locally.
skip_install = true
deps = -r{toxinidir}/docs/requirements.txt
commands = sphinx-build {posargs:-E} -b html docs dist/docs

[testenv:check]
description = Run all the check environments.
skip_install = true
commands = tox -e setup,safety,style,docs,spell,link

[testenv:dcheck]
description = Run all the check environments in parallel.
skip_install = true
deps = detox
commands = detox -e setup,safety,style,docs,spell,link

[testenv:setup]
description = Check that the package will be correctly installed and correctly rendered on PyPI.
skip_install = true
deps = 
    docutils
    check-manifest
    readme-renderer
    pygments
commands = 
    python setup.py check --strict --metadata --restructuredtext
    check-manifest {toxinidir}

[testenv:safety]
description = Check that the requirements versions do not have security vulnerabilities.
skip_install = true
deps = 
    bandit
    safety
commands = 
    safety check -r {toxinidir}/requirements/base.txt
    bandit -r {toxinidir}/src/hope

[testenv:style]
description = Check the code style.
deps = 
    isort
    prospector[with_everything]
commands = 
    isort --diff --recursive src/hope tests setup.py
    prospector {toxinidir}

[testenv:spell]
description = Check the spelling in the documentation.
skip_install = true
setenv = SPELLCHECK=1
deps = 
    -r{toxinidir}/docs/requirements.txt
    sphinxcontrib-spelling
    pyenchant
commands = 
    - sphinx-build {posargs:-E} -Q -b html docs dist/docs
    sphinx-build -b spelling -w /dev/null docs dist/docs

[testenv:link]
description = Check that the links written in documentation are valid.
skip_install = true
deps = -r{toxinidir}/docs/requirements.txt
commands = 
    - sphinx-build {posargs:-E} -Q -b html docs dist/docs
    sphinx-build -b linkcheck -w /dev/null docs dist/docs

[testenv:report]
description = Create coverage report.
deps = coverage
skip_install = true
commands = 
    coverage combine --append
    coverage report
    coverage html

[testenv:clean]
description = Delete coverage report.
commands = coverage erase
skip_install = true
deps = coverage

[testenv:codacy]
description = Upload coverage report to codacy.
deps = 
    codacy-coverage
    coverage
skip_install = true
commands = 
    coverage combine --append
    coverage report
    coverage xml --ignore-errors
    python-codacy-coverage []