-
Notifications
You must be signed in to change notification settings - Fork 21
/
tox.ini
93 lines (87 loc) · 2.48 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
# Copyright (c) 2020 6WIND S.A.
# SPDX-License-Identifier: BSD-3-Clause
[tox]
envlist = format,lint,py{36,37,38,39,310,311,312,py3},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 {toxworkdir} {opts} {packages}
setenv =
SYSREPO_SHM_PREFIX = tox_{envname}
SYSREPO_REPOSITORY_PATH = {envdir}/etc/sysrepo
allowlist_externals =
/bin/rm
/usr/bin/rm
/usr/bin/find
{toxinidir}/tox-install.sh
commands =
rm -rf '{env:SYSREPO_REPOSITORY_PATH}'
-find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete
python -Wd -m unittest discover -c
-find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete
rm -rf '{env:SYSREPO_REPOSITORY_PATH}'
[testenv:coverage]
changedir = .
deps = coverage
install_command = {toxinidir}/tox-install.sh {envdir} {opts} {packages}
setenv =
SYSREPO_SHM_PREFIX = tox_{envname}
SYSREPO_REPOSITORY_PATH = {envdir}/etc/sysrepo
allowlist_externals =
/bin/rm
/usr/bin/rm
/usr/bin/find
{toxinidir}/tox-install.sh
commands =
rm -rf '{env:SYSREPO_REPOSITORY_PATH}'
-find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete
python -Wd -m coverage run -m unittest discover -c tests/
-find /dev/shm -name '{env:SYSREPO_SHM_PREFIX}*' -delete
rm -rf '{env:SYSREPO_REPOSITORY_PATH}'
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.
install_command = {toxinidir}/tox-install.sh {toxworkdir} {opts} {packages}
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
/usr/bin/git
{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")'