distcloud/distributedcloud/tox.ini
Al Bailey 501fa35af2 Update pylint for distributedcloud
The pylint that was specified as an upper constraint was not
as strict as the newer versions.

- Fixed or suppressed any new error codes being reported.
Suppressed error codes should be fixed by additional reviews.

- added a zuul target for pylint

- Added dcdbsync to the folders being processed by pylint.

- Removed the env:UPPER_CONSTRAINTS_FILE from tox.ini so that zuul
does not override the upper constraints with an newer version.

- Needed to add greenlet to the extension-pkg-whitelist since
runtime introspection of that component is not possible.

- oslo-messaging get_transport deprecated 'aliases' in pike, and
removed it in rocky. The packaged version in STX is 5.30.6
which still supports aliases. This requires us to explicitly
run tox with the version that we ship (pre-stein). This is
controlled by a local upper-constraints.txt file.
Related-Bug: 1865054

- Paste file handling reports a pylint issue which has been suppressed
Related-Bug: 1865085

Story: 2004515
Task: 38882
Change-Id: Ie7c8c2adab1eeb9100159a2aa29968a0b557e2e4
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
2020-02-27 15:02:43 -06:00

197 lines
5.7 KiB
INI

[tox]
envlist = pep8,py27,pylint
minversion = 2.3
skipsdist = True
[dc]
dc_base_dir = .
stx_fault_dir = ../../fault
nfv_client_src_dir = ../../nfv/nfv/nfv-client
fmclient_src_dir = {[dc]stx_fault_dir}/python-fmclient/fmclient
fm_api_src_dir = {[dc]stx_fault_dir}/fm-api
sysinv_src_dir = ../../config/sysinv/sysinv/sysinv
tsconfig_src_dir = ../../config/tsconfig/tsconfig
controllerconfig_src_dir = ../../config/controllerconfig/controllerconfig
cgtsclient_src_dir = ../../config/sysinv/cgts-client/cgts-client
cgcs_patch_src_dir = ../../update/cgcs-patch/cgcs-patch
[testenv]
install_command = pip install \
-c ./upper-constraints.txt \
-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
CURRENT_CFG_FILE={toxinidir}/.current.cfg
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
keyring
whitelist_externals =
rm
find
reno
[testenv:py27]
basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
keyring
-e{[dc]nfv_client_src_dir}
-e{[dc]sysinv_src_dir}
-e{[dc]tsconfig_src_dir}
-e{[dc]fmclient_src_dir}
-e{[dc]fm_api_src_dir}
-e{[dc]controllerconfig_src_dir}
-e{[dc]cgtsclient_src_dir}
setenv =
CURRENT_CFG_FILE={toxinidir}/.current.cfg
DATA_DIRECTORY={toxinidir}/dcmanager/tests/data
SINGLE_REPO=True
OSLO_LOCK_PATH={toxinidir}
commands =
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
python setup_ddt_tests.py testr --slowest --testr-args='{posargs}'
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper {posargs}
[testenv:debug-py34]
basepython = python3.4
commands = oslo_debug_helper {posargs}
[testenv:pep8]
basepython = python3
deps = hacking>=1.1.0,<=2.0.0
pycodestyle>=2.0.0
flake8-bugbear
commands = flake8
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:cover]
basepython = python2.7
usedevelop = True
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
keyring
-e../{[dc]nfv_client_src_dir}
-e../{[dc]sysinv_src_dir}
-e../{[dc]tsconfig_src_dir}
-e../{[dc]fmclient_src_dir}
-e../{[dc]fm_api_src_dir}
-e../{[dc]controllerconfig_src_dir}
-e../{[dc]cgtsclient_src_dir}
setenv =
CURRENT_CFG_FILE={toxinidir}/.current.cfg
DATA_DIRECTORY={toxinidir}/dcmanager/tests/data
SINGLE_REPO=True
commands =
coverage erase
rm -Rf cover
rm -f coverage.xml
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
python setup_ddt_tests.py testr --coverage --testr-args='{posargs}'
coverage xml --rcfile=.coveragerc_xml
coverage report
[testenv:docs]
basepython = python3
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/doc/requirements.txt
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
install_command = pip install -U {opts} {packages}
deps = -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
whitelist_externals = rm
[testenv:newnote]
basepython = python3
# Re-use the releasenotes venv
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt
commands = reno new {posargs}
[testenv:api-ref]
basepython = python3
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
whitelist_externals = rm
[testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs}
[flake8]
show-source = True
# Suppressed flake8 codes
# W503 line break before binary operator
# W504 line break after binary operator
# W605 invalid escape sequence
# E117 over-indented
# E123 closing bracket does not match indentation of opening bracket's line
# E125 continuation line with same indent as next logical line
# E305 expected 2 blank lines after class or function definition
# E402 module level import not at top of file
# E501 line too long
# E731 do not assign a lambda expression, use a def
# -B- codes are bugbear errors
# B005 Using .strip() with multi-character strings is misleading the reader.
# B006 Do not use mutable data structures for argument defaults.
# B007 Loop control variable not used within the loop body.
# B009 Do not call getattr with a constant attribute value,
# B306 `BaseException.message` has been deprecated as of Python 2.6 and is removed in Python 3
ignore = W503,W504,W605,
E117,E123,E125,E305,E402,E501,E731,
B005,B006,B007,B009,B306
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:genconfig]
basepython = python3
commands =
oslo-config-generator --config-file=tools/config-generator.conf
[hacking]
import_exceptions = dcmanager.common.i18n,dcorch.common.i18n
[testenv:pylint]
basepython = python2.7
sitepackages = False
deps = {[testenv:py27]deps}
-e{[dc]cgcs_patch_src_dir}
commands =
pylint {posargs} dcmanager dcorch dcdbsync --rcfile=./pylint.rc
[testenv:linters]
basepython = python3
# bashate ignore:
# E006 - accept long lines
# E040 - false positive on |& syntax (new in bash 4)
whitelist_externals = bash
commands =
bash -c "find {toxinidir} \
\( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-print0 | xargs -r -0 yamllint"