-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
141 lines (107 loc) · 2.34 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[tox]
isolated_build = true
minversion = 3.4.0
envlist =
clean
linting
py{39,310,311,py3}
report
docs
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
pypy39: pypy3.9
pypy310: pypy3.10
[testenv]
passenv =
GITHUB_*
setenv =
DEBUG_GENERIC_LEXER = true
DOCTEST_COVERAGE = -p --context="doctest-{envname}"
PYTEST_COVERAGE = -p --context="pytest-{envname}"
deps =
coverage
pytest
sphinx-autodoc-typehints
depends =
py{36,37,38,39,py3}: clean, linting
{report,docs}: py{36,37,38,39,py3}
commands =
coverage run {env:PYTEST_COVERAGE} \
--source="{envsitepackagesdir}/generic_lexer" \
-m pytest
coverage run {env:DOCTEST_COVERAGE} \
--source="src/generic_lexer" \
-m sphinx \
-b doctest docs \
{toxinidir}/docs/build/doctest
[testenv:linting]
skip_install = true
deps =
pylama
mypy
commands =
pylama src tests
mypy --config-file=tox.ini src tests
[testenv:clean]
skip_install = true
deps = coverage
commands = coverage erase
[testenv:docs]
skip_install = true
deps = sphinx-autodoc-typehints
commands =
sphinx-apidoc -f \
-t {toxinidir}/docs/templates/apidoc \
-o {toxinidir}/docs/api \
{toxinidir}/src/generic_lexer
sphinx-build \
-j auto \
-b html \
{toxinidir}/docs \
{toxinidir}/docs/build/html
[testenv:report]
skip_install = true
deps = coverage
commands =
coverage combine
coverage html -i
coverage xml -i
[mypy]
ignore_missing_imports = true
check_untyped_defs = true
follow_imports = silent
color_output = false
error_summary = false
[pylama]
skip =
*/.tox/*
*/.venv/*
*/docs/*
[coverage:paths]
source =
src/generic_lexer
*/site-packages/generic_lexer
[coverage:run]
data_file = .coverage/main
[coverage:report]
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
# Don't complain about missing debug-only code:
def __repr__
if self\.debug
# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
[coverage:html]
directory = .coverage/html
[coverage:xml]
output = .coverage/coverage.xml
[isort]
profile = black