-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtox.ini
74 lines (68 loc) · 1.94 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
[tox]
description = Default tox environments list
envlist =
code-style
tests
doc-style
doc-{links,html}
vulnerabilities-{code,deps}
skip_missing_interpreters = true
isolated_build = true
isolated_build_env = build
[testenv]
description = Checks for project testing with desired extras
basepython =
{code-style,tests,doc-style,doc,vulnerabilities}: python3
passenv =
ANSYSLMD_LICENSE_FILE
BUILD_API
BUILD_EXAMPLES
extras =
tests
commands =
pytest {env:PYTEST_EXTRA_ARGS:} tests
[testenv:code-style]
description = Checks project code style
skip_install = true
deps =
pre-commit
commands =
pre-commit install
pre-commit run --all-files --show-diff-on-failure
[testenv:doc-style]
description = Checks project documentation style
skip_install = true
allowlist_externals =
vale
commands =
vale sync --config="{toxinidir}/doc/.vale.ini"
vale --config="{toxinidir}/doc/.vale.ini" "{toxinidir}/doc"
[testenv:doc-{links,html}]
description = Check if documentation generates properly
passenv =
ANSYSLMD_LICENSE_FILE
BUILD_API
BUILD_EXAMPLES
setenv =
links: BUILDER = linkcheck
html: BUILDER = html
extras =
doc
commands =
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxinidir}/doc/_build/{env:BUILDER}" --color -vW -b {env:BUILDER} -j auto
[testenv:vulnerabilities-{code,deps}]
description = Checks vulnerabilities within the source code and its dependencies
skip_install = false
setenv =
code: TOOL = bandit
code: TOOL_OPTS = -r {toxinidir}/src
code: TOOL_REPORT = -o {toxinidir}/log/bandit.json -f json
deps: TOOL = safety
# PyPI vulnerability: https://data.safetycli.com/v/67599/97c
deps: IGNORE_VULNERABILITIES = 67599
deps: TOOL_OPTS = check -o bare --continue-on-error -i {env:IGNORE_VULNERABILITIES}
deps: TOOL_REPORT = --save-json {toxinidir}/log/safety.json
extras =
vulnerabilities
commands =
{env:TOOL} {env:TOOL_OPTS} {env:TOOL_REPORT}