-
Notifications
You must be signed in to change notification settings - Fork 16
/
tox.ini
85 lines (77 loc) · 2.04 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
[tox]
envlist = formatting, {py3,py39}-mypy, py3, py39, schemacheck, py3-sys
isolated_build = True
[testenv]
description = Run unit tests
passenv =
WRITABLE_PASSWD
NSS_WRAPPER_PASSWD
NSS_WRAPPER_GROUP
deps =
pytest
pytest-cov
dnspython
-e .[validation,yaml,toml]
commands =
py.test -v --cov=sambacc --cov-report=html {posargs:tests}
[testenv:{py3,py39}-mypy]
description = Run mypy static checker tool
deps =
mypy
types-setuptools
types-pyyaml
types-jsonschema>=4.10
tomli
{[testenv]deps}
commands =
mypy sambacc tests
[testenv:py3-sys]
description = Run unit tests with system packages to validate Samba integration
# py3-sys -- more like sisyphus, am I right?
#
# In order to run tests that rely on "system level" packages (samba,
# xattr, etc.), and not have a lot of test skips, we have to enable the
# sitepackages option. However when it is enabled and you already have a tool
# (mypy, pytest, etc.) installed at the system tox emits a `command found but
# not installed in testenv` warning. We can avoid all those warnings except for
# the 'py3' env by putting all that system enablement stuff only in this
# section.
sitepackages = True
deps =
pytest
pytest-cov
dnspython
inotify_simple
pyxattr
allowlist_externals =
/usr/bin/py.test
[testenv:formatting]
description = Check the formatting for the source files
deps =
flake8
black>=24, <25
commands =
flake8 sambacc tests
black --check -v .
[testenv:schemacheck]
description = Check the JSON Schema files are valid
deps =
black>=24, <25
PyYAML
commands =
python -m sambacc.schema.tool
[testenv:schemaupdate]
description = Regenerate source files from JSON Schema file(s)
deps =
black>=24, <25
PyYAML
commands =
python -m sambacc.schema.tool --update
# this gitlint rule is not run by default.
# Run it manually with: tox -e gitlint
[testenv:gitlint]
description = Check the formatting of Git commit messages
deps =
gitlint==0.19.1
commands =
gitlint -C .gitlint --commits origin/master.. lint