forked from sysrepo/sysrepo-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
89 lines (83 loc) · 2.44 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
# Copyright (c) 2020 6WIND S.A.
# SPDX-License-Identifier: BSD-3-Clause
[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/
install_command = {toxinidir}/tox-install.sh {toxworkdir} {opts} {packages}
setenv =
SYSREPO_SHM_PREFIX = tox_{envname}
SYSREPO_REPOSITORY_PATH = {envdir}/etc/sysrepo
master: LIBYANG_BRANCH = master
master: SYSREPO_BRANCH = master
devel: LIBYANG_BRANCH = devel
devel: SYSREPO_BRANCH = devel
whitelist_externals =
/bin/rm
/usr/bin/find
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
LIBYANG_BRANCH = master
SYSREPO_BRANCH = master
whitelist_externals =
/bin/rm
/usr/bin/find
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==20.8b1
isort
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.
install_command = {toxinidir}/tox-install.sh {toxworkdir} {opts} {packages}
changedir = .
deps =
black==20.8b1
flake8
flake8-copyright
isort
pylint>=2.5
whitelist_externals =
/bin/sh
/usr/bin/git
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")'