[tox] minversion = 2.3 envlist = py27,py36,py39,pep8,pylint,pep8_Debian,pylint_Debian skipsdist = True toxworkdir = /tmp/{env:USER}_dc_client_tox [dcclient] client_base_dir = . [testenv] 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 # DISCOVER_DIRECTORY=dcmanagerclient/tests deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt whitelist_externals = rm find reno [testenv:py27] basepython = python2.7 commands = find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete stestr --test-path={[dcclient]client_base_dir}/dcmanagerclient/tests run '{posargs}' [testenv:py36] basepython = python3.6 commands = find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete stestr --test-path={[dcclient]client_base_dir}/dcmanagerclient/tests run '{posargs}' [testenv:py39] skipdist = False basepython = python3.9 install_command = pip install \ -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/victoria/upper-constraints.txt} \ {opts} {packages} 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] basepython = python3 deps = {[testenv]deps} commands = flake8 {posargs} [testenv:pep8_Debian] basepython = python3.9 deps = -r{toxinidir}/test-requirements-debian.txt install_command = pip install -v -v -v \ -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ {opts} {packages} commands = flake8 [testenv:pylint] basepython = python3 sitepackages = False deps = {[testenv]deps} commands = pylint {posargs} dcmanagerclient --rcfile=./pylint.rc [testenv:pylint_Debian] basepython = python3.9 deps = -r{toxinidir}/test-requirements-debian.txt install_command = pip install -v -v -v \ -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ {opts} {packages} commands = pylint {posargs} dcmanagerclient --rcfile=./pylint.rc [testenv:venv] basepython = python3 commands = {posargs} [testenv:cover] basepython = python3 setenv = PYTHON=coverage run --parallel-mode PYTHONDONTWRITEBYTECODE=True deps = {[testenv]deps} coverage 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:cover_Debian] basepython = python3.9 setenv = PYTHON=coverage run --parallel-mode PYTHONDONTWRITEBYTECODE=True deps = -r{toxinidir}/test-requirements-debian.txt coverage install_command = pip install -v -v -v \ -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ {opts} {packages} 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] basepython = python3 commands = oslo_debug_helper {posargs} [flake8] # E123, E125 skipped as they are invalid PEP-8. # W504 line break after binary operator # W605 invalid escape sequence show-source = True ignore = E123,E125,W504,W605,H102 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build [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 -0 yamllint" [testenv:docs] basepython = python3 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 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 reno [testenv:newnote] basepython = python3 # Re-use the releasenotes venv envdir = {toxworkdir}/releasenotes deps = -r{toxinidir}/doc/requirements.txt commands = reno new {posargs}