File: tox.ini

package info (click to toggle)
python-octaviaclient 3.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,184 kB
  • sloc: python: 12,641; sh: 57; makefile: 23
file content (139 lines) | stat: -rw-r--r-- 4,148 bytes parent folder | download
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
[tox]
minversion = 3.18.0
envlist = py3,pep8
ignore_basepython_conflict = True

[testenv]
usedevelop = True
allowlist_externals =
    find
    rm
install_command = pip install {opts} {packages}
setenv =
   VIRTUAL_ENV={envdir}
   PYTHONWARNINGS=default::DeprecationWarning
deps =
    -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt
commands =
    find . -type f -name "*.pyc" -delete
    stestr run {posargs}
    stestr slowest

[testenv:pep8]
commands = flake8
           # RST linter
           doc8 doc/source octaviaclient HACKING.rst README.rst \
           CONTRIBUTING.rst
           # Run security linter
           {[testenv:bandit]commands}
           {toxinidir}/tools/coding-checks.sh --pylint {posargs}
allowlist_externals =
  sh
  find
  bash
  {toxinidir}/tools/coding-checks.sh

[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv =
  {[testenv]setenv}
  PYTHON=coverage run --source octaviaclient --parallel-mode
allowlist_externals =
  find
commands =
  find octaviaclient -type f -name "*.pyc" -delete
  coverage erase
  stestr run {posargs}
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml
  coverage report --fail-under=90 --skip-covered

[testenv:docs]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/doc/requirements.txt
commands =
  rm -rf doc/build/html
  sphinx-build -W -b html doc/source doc/build/html

[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
  make
  rm
commands =
  rm -rf doc/build/pdf
  sphinx-build -W -b latex doc/source doc/build/pdf
  make -C doc/build/pdf

[testenv:releasenotes]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  -r{toxinidir}/doc/requirements.txt
commands =
  rm -rf releasenotes/build
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[testenv:debug]
passenv = OS_*
commands =
    pip install -q -U ipdb
    oslo_debug_helper -t octaviaclient/tests {posargs}

[flake8]
# [H104]: Empty file with only comments
# [W504]: Line break after binary operator
# [I202]: Additional newline in a group of imports.
ignore = H104,W504,I202
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8
# [H106]: Don't put vim configuration in source files
# [H203]: Use assertIs(Not)None to check for None
# [H204]: Use assert(Not)Equal to check for equality
# [H205]: Use assert(Greater|Less)(Equal) for comparison
# [H904]: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904

[testenv:bashate]
envdir = {toxworkdir}/shared
commands = bash -c "find {toxinidir}             \
         -not \( -type d -name .tox\* -prune \)  \
         -not \( -type d -name .venv\* -prune \) \
         -type f                                 \
         -name \*.sh                             \
# [E005]: File does not begin with #! or have a .sh prefix
# [E006]: Check for lines longer than 79 columns
# [E042]: Local declaration hides errors
# [E043]: Arithmetic compound has inconsistent return semantics
         -print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"

[flake8:local-plugins]
extension =
  O323 = checks:assert_equal_true_or_false
  O324 = checks:no_mutable_default_args
  O339 = checks:no_log_warn
  O340 = checks:no_xrange
  O341 = checks:no_translate_logs
  O342 = checks:check_raised_localized_exceptions
  O343 = checks:check_no_basestring
  O345 = checks:check_no_eventlet_imports
  O346 = checks:check_line_continuation_no_backslash
paths =
  ./octaviaclient/hacking

[testenv:requirements]
deps =
  -egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
allowlist_externals = sh
commands =
    sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'

[testenv:bandit]
commands = bandit -r octaviaclient -ll -ii -x tests