forked from CESNET/libyang-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
60 lines (55 loc) · 1.52 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
[tox]
envlist = format,lint,py{35,36,37,38,py3},py3-{master,devel},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/
setenv =
master: LIBYANG_BRANCH=master
devel: LIBYANG_BRANCH=devel
install_command = {toxinidir}/tox-install.sh {envdir} {opts} {packages}
commands = python -Wd -m unittest discover -c
[testenv:coverage]
changedir = .
deps = coverage
install_command = {toxinidir}/tox-install.sh {envdir} {opts} {packages}
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==20.8b1
isort<5
skip_install = true
install_command = python3 -m pip install {opts} {packages}
whitelist_externals =
/bin/sh
commands =
sh -ec 'python3 -m isort $(git ls-files "*.py")'
sh -ec 'python3 -m black -t py35 $(git ls-files "*.py")'
[testenv:lint]
basepython = python3
description = Run coding style checks.
changedir = .
deps =
black==20.8b1
flake8
flake8-copyright
isort<5
pylint>=2.5
whitelist_externals =
/bin/sh
commands =
sh -ec 'python3 -m black -t py35 --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")'