-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
115 lines (99 loc) · 2.96 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# -*- coding: utf-8 -*-
# udb, A web interface to manage IT network
# Copyright (C) 2022 IKUS Software inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
[tox]
envlist = py3,doc,bookworm,sqlalchemy2,flake8,black,isort,djlint
[testenv]
passenv =
TEST_DATABASE_URI
TEST_LDAP_URI
deps =
pytest-cov
psycopg2-binary
# Fix all version for Debian bookworm
bookworm: sqlalchemy==1.4.46
bookworm: wtforms==3.0.1
bookworm: CherryPy==18.8.0
bookworm: configargparse==1.5.3
bookworm: Jinja2==3.0.3
# Fix version of sqlalchemy2
sqlalchemy2: sqlalchemy>=2,<3
extras = test
commands =
pytest -v --debug --ignore=debian --override-ini junit_family=xunit1 --junit-xml=xunit.xml --cov=udb --cov-report xml:coverage.xml
[testenv:selenium]
allowlist_externals=
/usr/bin/xvfb-run
extras = test
commands =
xvfb-run pytest -v --debug --ignore=debian --junit-xml=xunit-selenium.xml --cov=udb --cov-report xml:coverage-selenium.xml
[testenv:doc]
deps =
sphinx
myst-parser
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html
skip_install = true
[testenv:black]
deps = black==22.6.0
commands = black --check --diff src
skip_install = true
[testenv:djlint]
deps = djlint==1.30.2
allowlist_externals = sh
commands = sh -c 'djlint --check src/udb/templates/*.html src/udb/templates/**/*.html'
skip_install = true
[testenv:flake8]
deps =
flake8
commands = flake8 src
skip_install = true
[testenv:isort]
deps = isort>=5.0.1
commands = isort --check --diff src
skip_install = true
[testenv:babel_extract]
deps =
babel
Jinja2
commands = pybabel extract -F babel.cfg --output-file src/udb/locales/messages.pot src
skip_install = true
[testenv:babel_init]
deps = babel
commands = pybabel init --domain messages --input-file src/udb/locales/messages.pot --output-dir src/udb/locales {posargs}
skip_install = true
[testenv:babel_update]
deps = babel
commands = pybabel update --domain messages --input-file src/udb/locales/messages.pot --output-dir src/udb/locales {posargs}
skip_install = true
[testenv:babel_compile]
deps = babel
commands = pybabel compile --domain messages --directory src/udb/locales
skip_install = true
domain = messages
directory = src/udb/locales
[flake8]
ignore =
# whitespace before ':'
E203
# line too long (86 > 79 characters)
E501
# line break before binary operator
W503
# ambiguous variable name 'I'
E741
filename =
*.py
max-complexity = 20