-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
93 lines (85 loc) · 2.73 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
86
87
88
89
90
91
92
93
#https://tox.wiki/en/latest/config.html#substitution-for-values-from-other-sections
[vars]
module_name=avengercon
module_author="Brent Stone"
module_author_email="brent.j.stone2.mil@army.mil"
# Tox and Poetry compatibility
# https://python-poetry.org/docs/faq/#is-tox-supported
# https://github.com/pytest-dev/pytest-cov/tree/master/examples/adhoc-layout
[tox]
min_version = 4.0
env_list =
clean
pre-commit
py311
typing
interrogate
safety
mkdocs
isolated_build = true
skip_missing_interpreters = true
[testenv]
description = run tests with {basepython}
deps =
# See 'scripts/export_poetry_to_req_txt.sh' for where this comes from
-r {toxinidir}{/}requirements{/}requirements-pytest.txt
setenv =
COVERAGE_FILE = {toxworkdir}{/}.coverage.{envname}
GIT_AUTHOR_NAME = {[vars]module_author}
GIT_COMMITTER_NAME = {[vars]module_author}
GIT_AUTHOR_EMAIL = {[vars]module_author_email}
GIT_COMMITTER_EMAIL = {[vars]module_author_email}
commands =
pytest --cov={[vars]module_name} --cov-config={toxinidir}{/}pyproject.toml \
--local-badge-output-dir=docs/badges \
--cov-fail-under=0 --cov-report=term-missing --ignore=tests/vertical_scale_test.py
[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase
[testenv:pre-commit]
description = format the code base to black code style + other auto-linting hooks
skip_install = true
deps = pre-commit>=3.6.1
commands = pre-commit run --all-files --show-diff-on-failure
# Based on the sphinx-autodoc-typehints repo's tox.ini
# https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/tox.ini
[testenv:typing]
description = run type checks on code base
deps =
-r {toxinidir}{/}requirements{/}requirements-mypy.txt
set_env =
{tty:MYPY_FORCE_COLOR = 1}
commands =
mypy {[vars]module_name} --config-file={toxinidir}{/}pyproject.toml --html-report {toxinidir}
mypy tests
[testenv:interrogate]
description = test for docstring coverage
skip_install = true
deps =
# Ensure you've got the needed build dependencies for Ciaro on your localhost
# https://interrogate.readthedocs.io/en/latest/#extras
interrogate
commands =
interrogate
depends =
py311
[testenv:safety]
description = Dependency security check
skip_install = true
deps = safety
commands =
# As of DEC23, pytest-sugar allows a pytest min version which depended on py 1.11
# which had a vulnerability. Ignore it for now since it's a dev only edge case that
# won't actually be installed
safety check -r {toxinidir}{/}requirements{/}requirements-dev.txt --ignore=51457
depends =
py311
[testenv:mkdocs]
description = generate documentation
deps = -r {toxinidir}{/}requirements{/}requirements-mkdocs.txt
commands =
mkdocs build
depends =
py311
coverage