[tox] minversion = 3.28.0 envlist = dev,pep8,py38,bandit,docs,list-tests skipsdist = true [testenv:dev] useddevelop = True basepython = python3 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY allowlist_externals = find setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning deps = freeze-req: -r{toxinidir}/requirements-frozen.txt list-tests: -r {toxinidir}/requirements-frozen.txt envdir= {toxinidir}/.tox/{envname} commands_pre = find . -type f -name "*.pyc" list-tests: stestr init [testenv:venv] commands = {posargs} [testenv:freeze] basepython=python3 recreate = True allowlist_externals= rm sh deps= -r{toxinidir}/requirements-direct.txt commands= rm -f requirements-frozen.txt sh -c "pip freeze --all | grep -vE 'pyinotify|pkg-resources==0.0.0' > requirements-frozen.txt" [testenv:py38] setenv = PYTHONWARNING=all KUBECONFIG={env:HOME}/.kube/config deps = -r{toxinidir}/requirements-frozen.txt -r{toxinidir}/test-requirements.txt allowlist_externals= pytest commands = pytest -vv \ {posargs} [testenv:cover] setenv = PYTHONWARNING=all KUBECONFIG={env:HOME}/.kube/config deps = -r{toxinidir}/requirements-frozen.txt -r{toxinidir}/test-requirements.txt allowlist_externals= pytest commands= py.test \ --cov=kube_utility_container \ --cov-report html:cover \ --cov-report xml:cover/coverage.xml \ --cov-report term \ -vv \ {toxinidir}/kube_utility_container/tests/unit/services \ {toxinidir}/kube_utility_container/tests/utility/compute \ {toxinidir}/kube_utility_container/tests/utility/etcd \ {toxinidir}/kube_utility_container/tests/utility/calico \ {toxinidir}/kube_utility_container/tests/utility/ceph \ {toxinidir}/kube_utility_container/tests/utility/openstack \ {toxinidir}/kube_utility_container/tests/utility/postgresql \ {toxinidir}/kube_utility_container/tests/utility/mysqlclient [testenv:bandit] deps = -r{toxinidir}/test-requirements.txt commands = bandit -r {toxinidir} [testenv:docs] pass_env = {[pkgenv]pass_env} allowlist_externals = rm deps = -r{toxinidir}/doc/requirements.txt -r{toxinidir}/requirements-frozen.txt commands = rm -rf doc/build sphinx-build -W -b html doc/source doc/build/html [testenv:pep8] deps = -r{toxinidir}/test-requirements.txt commands = yapf -ri {toxinidir}/setup.py {toxinidir}/tests {toxinidir}/docs {toxinidir}/kube_utility_container flake8 {toxinidir} bandit -r {toxinidir}/kube_utility_container [flake8] # [H106] Don't put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None. # [H204] Use assert(Not)Equal to check for equality. # [H205] Use assert(Greater|Less)(Equal) for comparison. # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls # [H904] Delay string interpolations at logging calls. enable-extensions = H106,H203,H204,H205,H210 # [E731] Do not assign a lambda expression, use a def. This reduces readability in some cases. ignore = E126,E731,F405,H102,H301,H306,H401,H404,H405,H904,W503,W504 exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc,alembic/versions