distcloud-client/distributedcloud-client/tox.ini

69 lines
1.7 KiB
INI

[tox]
envlist = py39,pep8,pylint
minversion = 2.3
skipsdist = True
toxworkdir = /tmp/{env:USER}_dc_client_tox
[dcclient]
client_base_dir = .
[testenv]
basepython = python3.9
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
allowlist_externals =
rm
find
[testenv:py39]
skipdist = False
commands =
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
stestr --test-path={[dcclient]client_base_dir}/dcmanagerclient/tests run '{posargs}'
[testenv:pep8]
commands = flake8
[flake8]
# E203 whitespace before ':'
# W503 line break before binary operator
# W504 line break after binary operator
# W605 invalid escape sequence
# E203 and W503 are not compatible with Black formatter
show-source = True
max-line-length = 85
ignore = E203, W503, W504, W605
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[testenv:pylint]
commands =
pylint {posargs} dcmanagerclient --rcfile=./.pylintrc
[testenv:cover]
setenv =
PYTHON=coverage run --parallel-mode
PYTHONDONTWRITEBYTECODE=True
commands =
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
coverage erase
stestr --test-path={[dcclient]client_base_dir}/dcmanagerclient/tests run '{posargs}'
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:debug]
commands = oslo_debug_helper {posargs}