nfv/nova-api-proxy/tox.ini
albailey eafee58e62 Not require recreate of tox env when running tox
The upgrade test was written to copy a file required for
the test, but did not handle the file already being processed.
This fix adjusts the setup for the unit test to handle this
and allows the recreate to be removed, thus reducing designer
tox testing time (40 seconds down to 4 when re-running a single test)

This also aligns the version of hacking and pylint as the same as
other starlingx repos. A new pylint was released which was
breaking tox.

The code changes are to fix whitespace (rather than suppressing):
 E305 expected 2 blank lines after class or function definition
 E117 over-indented

Three new hacking warnings are being suppressed:
  W503 line break before binary operator
  W504  line break after binary operator
  W605 invalid escape sequence

Un-suppress these codes which are not broken in the code:
 E123 closing bracket does not match indentation of opening bracket
 E501 line too long (tox sets max length instead to a large val)
 F823 local variable referenced before assignment

yamllint 1.26.1 does not work with py2 or py3 in our env, so clamp it.

Story: 2008137
Task: 42200
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: Ia623315c5f1a690d20f597242b7722601776f26d
2021-04-06 09:48:36 -05:00

58 lines
1.5 KiB
INI
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[tox]
envlist = pep8,pylint
minversion = 2.3
skipsdist = True
[testenv]
basepython = python3
sitepackages = False
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE: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
PYTHONDONTWRITEBYTECODE=True
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
whitelist_externals = find
deps=-r{toxinidir}/test-requirements.txt
[testenv:venv]
commands = {posargs}
[flake8]
# - hacking codes -
# H104: File contains nothing but comments
# H301: one import per line
# H404: multi line docstring should start without a leading new line
# H405: multi line docstring summary not separated with an empty line
# H501: Do not use self.__dict__ for string formatting
ignore=H104,H301,H404,H405,H501
# H106 Dont 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
enable-extensions = H106,H203
max-line-length=84
[testenv:pep8]
usedevelop = False
skip_install = True
commands =
flake8
[testenv:pylint]
basepython = python2.7
deps=
-r{toxinidir}/test-requirements.txt
eventlet
oslo.config
oslo.log
paste
PasteDeploy
routes
webob
commands = pylint nova-api-proxy/nova_api_proxy --rcfile=pylint.rc