config/sysinv/cgts-client/cgts-client/tox.ini

80 lines
2.3 KiB
INI

[tox]
envlist = py27,pep8,cover,pylint
minversion = 1.6
#skipsdist = True
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_cgtsclienttox
stxdir = {toxinidir}/../../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
# Note: Developers can leave STX_PREFIX unset in their env, and it will default to "stx-".
# Zuul sets STX_PREFIX to an empty string.
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_TEST_PATH=cgtsclient/tests
TESTR_START_DIR=cgtsclient/tests
STX_PREFIX = {env:STX_PREFIX:stx-}
basepython = python2.7
usedevelop = True
install_command = pip install \
-U \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
{opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/{env:STX_PREFIX}update/tsconfig/tsconfig
commands =
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
python setup.py testr --slowest --testr-args='{posargs}'
whitelist_externals =
bash
find
rm
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:pep8]
deps = -r{toxinidir}/test-requirements.txt
commands =
flake8 cgtsclient
[testenv:venv]
commands = {posargs}
[testenv:cover]
basepython = python2.7
commands =
find . -type f -name ".coverage\.*" -delete
rm -f .coverage
rm -Rf cover
rm -f coverage.xml
python setup.py testr --coverage --testr-args='{posargs}'
coverage xml
coverage report
[flake8]
show-source = true
exclude=.*,dist,*lib/python*,*egg,build
max-complexity=25
ignore = H102,H104,H105,H238,H404,H405,E501,F841
#H102 Apache 2.0 license header not found
#H104 File contains nothing but comments
#H105 Don't use author tags
#H238 old style class declaration, use new style (inherit from `object`)
#H404 multi line docstring should start without a leading new line
#H405 multi line docstring summary not separated with an empty line
#E501 line too long
#F841 local variable 'X' is assigned to but never used
[testenv:pylint]
basepython = python2.7
deps = {[testenv]deps}
pylint
commands = pylint {posargs} cgtsclient --rcfile=./pylint.rc --extension-pkg-whitelist=lxml.etree,greenlet