-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
tox.ini
75 lines (63 loc) · 1.61 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
[tox]
envlist =
py38,
py39,
py310,
py311,
py312,
lint,
mypy,
coverage,
docs,
[testenv]
description = run the tests with pytest
extras = test
deps = pdbpp
commands = pytest {posargs}
[testenv:coverage]
description = generate coverage report
commands =
pytest --cov tests --cov flask_uploads --cov-report term-missing --cov-report html --cov-context=test --cov-fail-under=100 {posargs}
[testenv:lint]
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
[testenv:mypy]
description = run type checker on code base
deps =
mypy
commands =
mypy --strict src tests {posargs}
[isort]
known_third_party = flask,flask_uploads,pytest,setuptools,sphinx_rtd_theme,werkzeug
force_single_line = True
[flake8]
ignore =
# line break after binary operator
W504,
[coverage:paths]
source =
src/
.tox/*/lib/python*/site-packages/
[coverage:html]
show_contexts = true
[pytest]
# only collect intended test classes, e.g. TestSaving
# do not collect e.g. TestingFileStorage
python_classes = Test[A-Z]*
[gh-actions]
python =
3.8: py38, mypy
3.9: py39, coverage
3.10: py310, pre-commit
3.11: py311
3.12: py312
[testenv:docs]
description = generate docs in HTML format
# specifying the exact python version as in .readthedocs.yaml for compatibility
basepython = python3.11
deps = -r docs/requirements.txt
commands = sphinx-build -b html docs _build/html
[testenv:upgradedocs]
description = upgrade dependencies to build docs
deps = pip-tools
commands = pip-compile --upgrade {toxinidir}/docs/requirements.in --output-file {toxinidir}/docs/requirements.txt