-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
71 lines (65 loc) · 1.55 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
[tox]
requires =
tox>=4.2
env_list =
py311
py38
py37
py36
unit
lint
lint-tests
static
skip_missing_interpreters = true
[vars]
src_path = {toxinidir}/catan
tst_path = {toxinidir}/tests
all_path = {[vars]src_path}, {[vars]tst_path}
[testenv:unit]
# don't install as a sdist, instead, install as wheel (create wheel once), then install in all envs
package = wheel
wheel_build_env = .pkg
description = unit tests
deps =
-r requirements.txt
pytest
pytest-cov
setenv =
PYTHONPATH = {toxinidir}
commands =
pytest --cov-report html:.cov_html -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tst_path}
[testenv:lint]
description = Format the code base to adhere to our styles, and complain about what we cannot do automatically.
skip_install = true
deps =
pre-commit>=3.2.2
commands =
pre-commit run --all-files {posargs}
python -c 'print(r"hint: run {envbindir}{/}pre-commit install to add checks as pre-commit hook")'
[testenv:static]
description = Static typing checks.
skip_install = true
deps =
ops
pyright==1.1.347
commands =
pyright {[vars]src_path}
[testenv:lint-tests]
description = Lint test files.
skip_install = true
deps =
black
coverage[toml]
isort
commands =
black --check {[vars]tst_path} {[vars]src_path}
isort --check-only --profile black {[vars]tst_path}
[testenv:fmt]
description = Format code.
skip_install = true
deps =
ruff
isort
commands =
ruff format {[vars]tst_path} {[vars]src_path}
isort --profile black {[vars]tst_path} {[vars]src_path}