-
Notifications
You must be signed in to change notification settings - Fork 24
/
tox.ini
68 lines (56 loc) · 2.07 KB
/
tox.ini
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
[tox]
minversion = 1.6
envlist = py{3,312},pep8,bandit
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
VIRTUALENV_NO_DOWNLOAD=1
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
coverage run --branch --include 'dlrn*' -m unittest {posargs:discover dlrn.tests}
coverage report -m
passenv =
TERM
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html -d build/doctrees doc/source doc/build/html
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.
# F821 skipped for now, as flake8 is not recognizing session global.
# It would might be better to pass a session around rather than the global.
# rdoinfo skipped as we are changing to rdopkg
# https://review.gerrithub.io/#/c/214249/
show-source = True
extend-ignore = E123,E125,H803,F821,H216
builtins = _
exclude=.venv,venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,rdoinfo.py,*rdoinfo/*,verify.py,data
[bandit]
exclude = dlrn/tests,dlrn/dist,dlrn/build,dlrn/static,dlrn/DLRN.egg-info,dlrn/__pycache__,dlrn/UNKNOWN.egg-info,dlrn/lib,dlrn/bin,dlrn/migrations
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
bandit
# Execute bandit on the dlrn directory with 5 lines of context, skipping low severity issues
commands = bandit --ini tox.ini -n 5 -r dlrn -ll
[testenv:pip-audit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
pip-audit
commands = pip-audit --requirement requirements.txt