927bee2d66
flake8 2.5.5 fails on ubuntu-focal zuul machines running python3.8 with the following error: AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT' The update updates the version constraint to use newer flake8. pylint has been switched to running in python3 which has challenges related to the new pip resolver. The correct version of Django cannot be specified with the new resolver so the pylint errors caused by the newer version are suppressed for now. The docs targets for tox use their own install_command which does not include an upper constraint. A non ascii character was removed from the tox.ini file which prevented running tox on some ubuntu envs. Partial-Bug: 1895054 Signed-off-by: albailey <Al.Bailey@windriver.com> Change-Id: Ic6a50c2ecf2a654fd883ed92fc305336741d4303
110 lines
3.4 KiB
INI
110 lines
3.4 KiB
INI
[tox]
|
|
envlist = pep8,pylint
|
|
minversion = 2.3
|
|
skipsdist = True
|
|
stxdir = {toxinidir}/..
|
|
|
|
# Note: STX_DC_CLIENT is set by zuul to be distcloud-client, it is
|
|
# defaulted here to the path that works in developer environments
|
|
[testenv]
|
|
install_command = pip install \
|
|
-v -v -v \
|
|
-c https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt \
|
|
{opts} {packages}
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
STX_DC_CLIENT = {env:STX_DC_CLIENT:distributedcloud-client}
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:linters]
|
|
basepython = python3
|
|
whitelist_externals = bash
|
|
commands =
|
|
bash -c "find {toxinidir} \
|
|
-not \( -type d -name .?\* -prune \) \
|
|
-type f \
|
|
-not -name \*~ \
|
|
-not -name \*.md \
|
|
-name \*.sh \
|
|
-print0 | xargs --no-run-if-empty -0 bashate -v"
|
|
bash -c "find {toxinidir} \
|
|
-o \( -name .tox -prune \) \
|
|
-o -type f -name '*.yaml' \
|
|
-print0 | xargs --no-run-if-empty -0 yamllint"
|
|
|
|
[flake8]
|
|
# H102 Apache 2.0 license header not found
|
|
# W503 line break before binary operator
|
|
# W504 line break after binary operator
|
|
# E741 ambiguous variable name 'l'
|
|
ignore = H102,W503,W504,E741
|
|
# H106 Do not put vim configuration in source files (off by default).
|
|
# H203 Use assertIs(Not)None to check for None (off by default).
|
|
# H904 Delay string interpolations at logging calls (off by default).
|
|
enable-extensions = H106,H203,H904
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
usedevelop = False
|
|
skip_install = True
|
|
commands =
|
|
flake8
|
|
|
|
[testenv:pylint]
|
|
basepython = python3
|
|
usedevelop = False
|
|
skip_install = True
|
|
deps = {[testenv]deps}
|
|
-e{[tox]stxdir}/{env:STX_DC_CLIENT}/distributedcloud-client
|
|
-e{[tox]stxdir}/config/sysinv/cgts-client/cgts-client
|
|
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
|
|
-e{[tox]stxdir}/fault/python-fmclient/fmclient
|
|
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
|
|
-e{[tox]stxdir}/nfv/nfv/nfv-client
|
|
-e{[tox]stxdir}/ha/service-mgmt-client/sm-client
|
|
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
|
|
horizon
|
|
requests-toolbelt
|
|
commands =
|
|
pylint starlingx-dashboard/starlingx-dashboard/starlingx_dashboard --rcfile=./pylint.rc
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
install_command = pip install -U {opts} {packages}
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
|
|
whitelist_externals = rm
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
install_command = pip install -U {opts} {packages}
|
|
commands =
|
|
rm -rf releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
whitelist_externals =
|
|
rm
|
|
reno
|
|
|
|
[testenv:newnote]
|
|
basepython = python3
|
|
# Re-use the releasenotes venv
|
|
envdir = {toxworkdir}/releasenotes
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
install_command = pip install -U {opts} {packages}
|
|
commands = reno new {posargs}
|
|
|
|
[testenv:bandit]
|
|
basepython = python3
|
|
description = Bandit code scan for *.py files under config folder
|
|
commands = bandit -r {toxinidir}/ -x '**/.tox/**,**/.eggs/**' -lll
|