This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
85 lines (76 loc) · 2.15 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
[tox]
minversion = 1.6
envlist = py310,pep8
skipsdist = True
[testenv]
usedevelop = True
basepython = python3.10
whitelist_externals =
find
mkdir
allowlist_externals =
find
rm
mkdir
install_command = pip install -U {opts} {packages}
# use en_US.UTF-8 as C.UTF-8 doesn't exist in RHEL7
setenv =
VIRTUAL_ENV={envdir}
LC_ALL=C.UTF-8
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=180
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
[testenv:cover]
# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
# section once we rely on coverage 4.3+
#
# https://bitbucket.org/ned/coveragepy/issues/519/
envdir = {toxworkdir}/shared
setenv =
{[testenv]setenv}
PYTHON=coverage run --source fedserver --parallel-mode
commands =
{[testenv]commands}
coverage erase
stestr -v run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:py310]
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
basepython = python3.10
commands =
{[testenv]commands}
stestr -v run {posargs}
[testenv:pep8]
envdir = {toxworkdir}/shared
commands =
- flake8 --format=pylint --output-file=flake8.log
[testenv:bandit]
envdir = {toxworkdir}/shared
commands = bandit -r fedserver -x tests -s B110,B410
[flake8]
# This mixes the original DEEP conf with Black formatter configuration:
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?#flake8
# When we enforce python3.7+ we can move to use:
# https://github.com/peterjc/flake8-black
#
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.
max-line-length = 88
show-source = True
ignore = E123,E125,H803,H405
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
extend-ignore = E203
[testenv:cobertura]
commands = py.test --cov=fedserver --cov-report=xml --cov-report=term-missing fedserver/tests
[testenv:bandit-report]
commands =
- mkdir /tmp/bandit
- bandit -r fedserver -x tests -s B110,B410 -f html -o /tmp/bandit/index.html