summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 53f825b872e6eb68a2314883f7834d10d50f90ea (plain)
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
[tox]
envlist = py36,pep8,docs,cover
minversion = 2.3.1
skipsdist = True

[testenv]
usedevelop = True
setenv =
  VIRTUAL_ENV={envdir}
  LANGUAGE=en_US
  LC_ALL=en_US.utf-8
deps =
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/test-requirements.txt
passenv = http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION
whitelist_externals =
  find
commands =
  find . -type f -name "*.pyc" -delete
  {toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'

[testenv:fmt]
basepython = python3
deps =
    -r{toxinidir}/test-requirements.txt
commands =
    yapf --style=pep8 -ir {toxinidir}/pegleg {toxinidir}/tests

[testenv:pep8]
basepython = python3
deps =
  -r{toxinidir}/test-requirements.txt
commands =
  bash -c "{toxinidir}/tools/gate/whitespace-linter.sh"
  bandit -r pegleg -n 5
  flake8 {toxinidir}/pegleg
whitelist_externals =
  bash

[testenv:docs]
basepython = python3
deps =
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  bash -c "{toxinidir}/tools/gate/build-docs.sh"
whitelist_externals =
  bash

[testenv:bandit]
basepython = python3
commands = bandit -r pegleg -n 5

[testenv:cover]
basepython = python3
deps =
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/test-requirements.txt
commands =
  pytest --cov=pegleg --cov-report html:cover --cov-report xml:cover/coverage.xml --cov-report term --cov-fail-under 84 tests/

[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
  rm -rf releasenotes/build
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
whitelist_externals =
  rm

[testenv:venv]
commands = {posargs}

[flake8]
filename = *.py
show-source = true
ignore =
exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,*.ini,*.po,*.pot
max-complexity = 24