StarlingX Installation/Update/Patching/Backup/Restore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
3.6 KiB

# Copyright (c) 2019 Wind River Systems, Inc.
# SPDX-License-Identifier: Apache-2.0
envlist = pep8,py36,py39,pylint,bandit,cover
minversion = 2.3.2
skipsdist = True
stxdir = {toxinidir}/../../..
basepython = python3
deps = -r{toxinidir}/requirements.txt
install_command = pip install \
-v -v -v \
{opts} {packages}
passenv =
setenv = VIRTUAL_ENV={envdir}
sitepackages = False
usedevelop = true
whitelist_externals = find
commands =
find . -name "*.pyc" -delete
stestr run {posargs}
stestr slowest
basepython = python3.6
commands = {[testenv:stestr]commands}
basepython = python3.9
commands = {[testenv:stestr]commands}
# B101: Test for use of assert
# B104: Test for binding to all interfaces
# B110: Try, Except, Pass detected.
# B303: Use of insecure MD2, MD4, MD5, or SHA1 hash function.
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purposes
# B318: Blacklisted calls to xml.dom.minidom
# B320: Blacklisted calls to lxml.etree.parse
# B404: Import of subprocess module
# B408: import xml.minidom
# B410: import etree
# B602: Test for use of popen with shell equals true
# B603: Test for use of subprocess without shell equals true
# B607: Test for starting a process with a partial path
skips = B101,B104,B110,B303,B311,B318,B320,B404,B408,B410,B602,B603,B607
exclude = tests
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = bandit --ini tox.ini -n 5 -r cgcs_patch
# ignore below errors , will fix flake8 errors in future
# H306 imports not in alphabetical order
# H401 docstring should not start with a space
# H404 multi line docstring should start without a leading new line
# H405 multi line docstring summary not separated with an empty line
# Note: W503 and W504 are mutually exclusive. Must select one of them to suppress.
# W504 line break after binary operator
# E501 line too long. skipped because some of the code files include templates
# that end up quite wide
show-source = True
ignore = H306,H401,H404,H405,W504,E501
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
# H106: Don't put vim configuration in source files (off by default).
# H203: Use assertIs(Not)None to check for None (off by default).
# (todo) enable H904 Delay string interpolations at logging calls (off by default)
enable-extensions = H106 H203,H904
max-line-length = 80
commands = flake8 {posargs}
commands = flake8 {posargs}
commands = pylint cgcs_patch --rcfile=./pylint.rc
setenv =
PYTHON=coverage run --parallel-mode
commands = coverage erase
find . -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report