This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtox.ini
148 lines (123 loc) · 3.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
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
142
143
144
145
146
147
148
[tox]
envlist = manifest,flake8,isort,black,pyright,mypy,py{37,38,39,310},coverage-report,doc-html,doc-tests,rstvalidator
isolated_build = true
distshare = {toxworkdir}/distshare
[gh-actions]
python =
3.7: py37
3.8: py38,doc-html
3.9: py39
3.10: py310,flake8,isort,manifest,doc-tests,pyright,mypy,rstvalidator,black
[testenv]
changedir = {envtmpdir}
setenv =
; Every env has its own coverage file which is later merged in coverage-report.
; This needs to be overridden for codecov to work.
COVERAGE_FILE = {env:COVERAGE_FILE:{toxinidir}/.coverage.{envname}}
deps =
-r requirements/tests.txt
commands =
python --version
pip freeze
pytest {toxinidir}/tests \
--cov-report term-missing:skip-covered \
--cov-config {toxinidir}/pyproject.toml \
--cov
[testenv:py37]
commands =
python --version
pip freeze
pytest {toxinidir}/tests \
--ignore={toxinidir}/tests/core/test_inject_py38.py \
--cov-report term-missing:skip-covered \
--cov-config {toxinidir}/pyproject.toml \
--cov
[testenv:mypy]
changedir = {toxinidir}
deps =
; executing mypy on some tests
-r requirements/tests.txt
mypy==0.971
mypy-extensions==0.4.3
commands =
; some cast / ignores are for PyRight.
mypy --no-warn-redundant-casts --no-warn-unused-ignores --cache-dir=/dev/null
[testenv:pyright]
changedir = {toxinidir}
deps =
; executing pyright on some tests
-r requirements/tests.txt
pyright==1.1.269
commands =
pyright
[testenv:flake8]
changedir = {toxinidir}
skip_install = true
deps =
flake8==5.0.4
commands =
flake8 src docs tests
[testenv:black]
changedir = {toxinidir}
skip_install = true
deps =
black==22.6.0
commands =
black --diff --check src tests setup.py docs/conf.py
[testenv:isort]
changedir = {toxinidir}
skip_install = true
deps =
isort==5.10.1
commands =
isort --check-only src tests setup.py docs/conf.py
[flake8]
ignore = W503, E501
; W503: line break before binary operator (not best practice)
; E501: max line length (black does it better)
exclude =
docs/_build
docs/_themes
max-line-length = 100
; max-complexity = 10
[testenv:rstvalidator]
changedir = {toxinidir}
skip_install = true
deps =
rstvalidator==2020.12.3
; At runtime it complained about the missing pygment dependency. :/
pygments==2.13.0
commands =
python -m rstvalidator README.rst
[testenv:doc-html]
changedir = docs
deps =
-r requirements/docs.txt
whitelist_externals = make
commands =
make html
[testenv:doc-tests]
changedir = docs
deps =
-r requirements/docs.txt
whitelist_externals = make
commands =
make doctest
[testenv:coverage-report]
parallel_show_output = true
depends = py{37,38,39,310}
changedir = {toxinidir}
skip_install = true
setenv =
COVERAGE_FILE = .coverage
deps = coverage[toml]==6.4.3
commands =
coverage combine
coverage report --skip-covered --show-missing
coverage html
coverage xml
[testenv:manifest]
changedir = {toxinidir}
skip_install = true
deps = check-manifest==0.48
commands = check-manifest