tox.ini 3.57 KB
Newer Older
1
[tox]
2 3
envlist =
    clean,setup,safety,style,docs,
4
    py34-django111,
5
    py34-django20,
6
    py35-django111,
7
    py35-django20,
8
    py36-django111,
9
    py36-django20,
10
    py37-dev-django111,
11
    py37-dev-django20,
12
    pypy-django111,
13
    pypy-django20,
14 15 16 17
    report
skip_missing_interpreters = true

[testenv]
18
setenv =
19 20 21
    PYTHONPATH = {toxinidir}:{toxinidir}/src:{toxinidir}/tests
    PYTHONUNBUFFERED=yes
commands = {posargs:pytest --cov --cov-report=term-missing -vv runtests.py tests}
22
deps =
23
    django111: Django>=1.11,<1.12
24
    django20: Django>=2.0,<2.1
25 26 27
    pytest
    pytest-cov
    django-fake-model
28 29 30 31 32 33 34
passenv = *
usedevelop = false
whitelist_externals = tox

[testenv:test]
description = Run all the Python/Django test environments.
skip_install = true
Timothée Mazzucotelli's avatar
Timothée Mazzucotelli committed
35
commands = tox -e py34-django111,py34-django20,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20,pypy-django18,pypy-django19,pypy-django111,pypy-django20,
36 37 38 39 40 41
    tox -e report

[testenv:dtest]
description = Run all the Python/Django test environments in parallel.
skip_install = true
deps = detox
42
commands =
Timothée Mazzucotelli's avatar
Timothée Mazzucotelli committed
43
    detox -e py34-django111,py34-django20,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20,pypy-django18,pypy-django19,pypy-django111,pypy-django20,
44 45 46 47 48 49
    tox -e report

[testenv:detox]
description = Run all the environments in parallel.
skip_install = true
deps = detox
50
commands =
Timothée Mazzucotelli's avatar
Timothée Mazzucotelli committed
51
    detox -e clean,setup,safety,style,docs,py34-django111,py34-django20,py35-django111,py35-django20,py36-django111,py36-django20,py37-dev-django111,py37-dev-django20,pypy-django18,pypy-django19,pypy-django111,pypy-django20,
52 53 54 55 56
    tox -e report

[testenv:check]
description = Run all the check environments.
skip_install = true
57
commands = tox -e setup,safety,style,docs
58 59 60 61 62

[testenv:dcheck]
description = Run all the check environments in parallel.
skip_install = true
deps = detox
63
commands = detox -e setup,safety,style,docs
64 65 66 67

[testenv:setup]
description = Check that the package will be correctly installed and correctly rendered on PyPI.
skip_install = true
68
deps =
69 70 71 72
    docutils
    check-manifest
    readme-renderer
    pygments
73
commands =
74 75 76 77 78 79
    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
80
deps =
81 82
    bandit
    safety
83
commands =
84
    safety check -r {toxinidir}/requirements.txt
85 86 87 88
    bandit -r {toxinidir}/src/hope

[testenv:style]
description = Check the code style.
89
deps =
90
    -r{toxinidir}/requirements.txt
91 92
    isort
    prospector[with_everything]
93
commands =
94 95 96
    isort --diff --recursive src/hope tests setup.py
    prospector {toxinidir}

97 98
[testenv:docs]
description = Build the documentation locally.
99 100
skip_install = true
setenv = SPELLCHECK=1
101
deps =
102 103 104
    -r{toxinidir}/docs/requirements.txt
    sphinxcontrib-spelling
    pyenchant
105 106
commands =
    sphinx-build {posargs:-E} -b html docs dist/docs
107 108 109 110 111 112 113
    sphinx-build -b spelling -w /dev/null docs dist/docs
    sphinx-build -b linkcheck -w /dev/null docs dist/docs

[testenv:report]
description = Create coverage report.
deps = coverage
skip_install = true
114
commands =
115 116 117 118 119 120 121 122 123 124 125 126
    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.
127
deps =
128 129 130
    codacy-coverage
    coverage
skip_install = true
131
commands =
132 133 134 135 136
    coverage combine --append
    coverage report
    coverage xml --ignore-errors
    python-codacy-coverage []