-
Notifications
You must be signed in to change notification settings - Fork 342
/
tox.ini
99 lines (83 loc) · 2.45 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
[tox]
min_version = 4.17.0
envlist =
coverage_erase
py{3.13, 3.12, 3.11, 3.10, 3.9, py3.10, py3.9}{-chardet, }
coverage_report
docs
mypy
labels =
ci-test-linux = py{3.13, 3.12, 3.11, 3.10, 3.9, py3.10, py3.9}-chardet
ci-test-macos = py{3.12, 3.9}-chardet
ci-test-windows = py{3.12, 3.9}-chardet
update = update
[testenv]
description = Run the test suite ({env_name})
depends =
py{3.13, 3.12, 3.11, 3.10, 3.9, py3.10, py3.9}{-chardet, }: coverage_erase
package = wheel
wheel_build_env = build_wheel
deps =
-r requirements/test/requirements.txt
chardet: chardet
commands =
coverage run -m pytest {posargs:}
[testenv:coverage_erase]
description = Erase .coverage* files before testing
deps =
coverage[toml]
commands =
coverage erase
[testenv:coverage_report]
description = Report code coverage after testing
depends =
py{3.13, 3.12, 3.11, 3.10, 3.9, py3.10, py3.9}{-chardet, }
deps =
coverage[toml]
commands_pre =
coverage combine
coverage html --fail-under=0
commands =
coverage report
[testenv:docs]
description = Build and lint the documentation
skip_install = True
base_python = py3.12
deps = -r requirements/docs/requirements.txt
commands =
sphinx-build -EWq -j auto --keep-going docs/ build/docs/
[testenv:mypy]
description = Lint type annotations
base_python = py3.12
deps = -r requirements/mypy/requirements.txt
commands =
mypy
[testenv:update]
recreate = true
skip_install = true
description = Update requirements and tool versions
base_python = py3.12
setenv =
# The actionlint pre-commit hook needs the GOCACHE environment variables.
GOCACHE={env_dir}/.gocache
deps =
poetry
poetry-plugin-export
pre-commit
upadup
commands =
# Update test requirements
poetry update --directory="requirements/docs" --lock
poetry export --directory="requirements/docs" --output="requirements/docs/requirements.txt" --without-hashes
poetry update --directory="requirements/mypy" --lock
poetry export --directory="requirements/mypy" --output="requirements/mypy/requirements.txt" --without-hashes
poetry update --directory="requirements/test" --lock
poetry export --directory="requirements/test" --output="requirements/test/requirements.txt" --without-hashes
# Update pre-commit hook versions
pre-commit autoupdate
upadup
# Run pre-commit immediately, but ignore its exit code
- pre-commit run -a
[flake8]
max-line-length = 88
extend-ignore = E203