[tox] minversion = 1.6 envlist = py{3,312},pep8,bandit [testenv] usedevelop = True install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} VIRTUALENV_NO_DOWNLOAD=1 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = coverage run --branch --include 'dlrn*' -m unittest {posargs:discover dlrn.tests} coverage report -m passenv = TERM [testenv:bindep] # Do not install any requirements. We want this to be fast and work even if # system dependencies are missing, since it's used to tell you what system # dependencies are missing! This also means that bindep must be installed # separately, outside of the requirements files. deps = bindep commands = bindep test [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html -d build/doctrees doc/source doc/build/html [testenv:pep8] commands = flake8 [testenv:venv] commands = {posargs} [testenv:cover] commands = python setup.py testr --coverage --testr-args='{posargs}' [flake8] # H803 skipped on purpose per list discussion. # E123, E125 skipped as they are invalid PEP-8. # F821 skipped for now, as flake8 is not recognizing session global. # It would might be better to pass a session around rather than the global. # rdoinfo skipped as we are changing to rdopkg # https://review.gerrithub.io/#/c/214249/ show-source = True extend-ignore = E123,E125,H803,F821,H216 builtins = _ exclude=.venv,venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,rdoinfo.py,*rdoinfo/*,verify.py,data [bandit] exclude = dlrn/tests,dlrn/dist,dlrn/build,dlrn/static,dlrn/DLRN.egg-info,dlrn/__pycache__,dlrn/UNKNOWN.egg-info,dlrn/lib,dlrn/bin,dlrn/migrations [testenv:bandit] basepython = python3 deps = -r{toxinidir}/test-requirements.txt bandit # Execute bandit on the dlrn directory with 5 lines of context, skipping low severity issues commands = bandit --ini tox.ini -n 5 -r dlrn -ll [testenv:pip-audit] basepython = python3 deps = -r{toxinidir}/test-requirements.txt pip-audit commands = pip-audit --requirement requirements.txt