forked from CESNET/libyang-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
71 lines (65 loc) · 1.73 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]
envlist = format,lint,py{39,310,311,312,313,py3},lydevel,coverage
skip_missing_interpreters = true
isolated_build = true
distdir = {toxinidir}/dist
[tox:.package]
basepython = python3
[testenv]
description = Compile extension and run tests against {envname}.
changedir = tests/
install_command = {toxinidir}/tox-install.sh {envdir} {opts} {packages}
allowlist_externals =
{toxinidir}/tox-install.sh
commands = python -Wd -m unittest discover -c
[testenv:lydevel]
setenv =
LIBYANG_BRANCH=devel
[testenv:coverage]
changedir = .
deps = coverage
install_command = {toxinidir}/tox-install.sh {envdir} {opts} {packages}
allowlist_externals =
{toxinidir}/tox-install.sh
commands =
python -Wd -m coverage run -m unittest discover -c tests/
python -m coverage report
python -m coverage html
python -m coverage xml
[testenv:format]
basepython = python3
description = Format python code using isort and black.
changedir = .
deps =
black~=23.12.1
isort~=5.13.2
skip_install = true
install_command = python3 -m pip install {opts} {packages}
allowlist_externals =
/bin/sh
/usr/bin/sh
commands =
sh -ec 'python3 -m isort $(git ls-files "*.py")'
sh -ec 'python3 -m black -t py36 $(git ls-files "*.py")'
[testenv:lint]
basepython = python3
description = Run coding style checks.
changedir = .
deps =
astroid~=3.0.2
black~=23.12.1
flake8~=7.0.0
isort~=5.13.2
pycodestyle~=2.11.1
pyflakes~=3.2.0
pylint~=3.0.3
setuptools~=69.0.3
allowlist_externals =
/bin/sh
/usr/bin/sh
{toxinidir}/tox-install.sh
commands =
sh -ec 'python3 -m black -t py36 --diff --check $(git ls-files "*.py")'
sh -ec 'python3 -m flake8 $(git ls-files "*.py")'
sh -ec 'python3 -m isort --diff --check-only $(git ls-files "*.py")'
sh -ec 'python3 -m pylint $(git ls-files "*.py")'