From 235cb921e06fbc979276aca8d753084033678df2 Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Tue, 9 Oct 2018 15:16:25 +0300 Subject: Add flake8 and yamllint tox environments and fix tox errors JIRA: SDNVPN-231 This patch adds flake8 and yamllint tox environments. Furthermore, it fixes tox errors and applies general tox improvements. Change-Id: Id180695ef034562efb236932e6f783b0e91157c2 Signed-off-by: Stamatis Katsaounis --- tox.ini | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'tox.ini') diff --git a/tox.ini b/tox.ini index 69aa189..7880718 100644 --- a/tox.ini +++ b/tox.ini @@ -2,16 +2,52 @@ minversion = 1.6 envlist = docs, - docs-linkcheck + docs-linkcheck, + pep8, + yamllint skipsdist = true +[testenv] +usedevelop = False +setenv= + HOME = {envtmpdir} + PYTHONPATH = {toxinidir} +deps = + -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master + -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=master + -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt +install_command = pip install {opts} {packages} + [testenv:docs] -deps = -rdocs/requirements.txt +basepython = python2.7 +deps = -r{toxinidir}/docs/requirements.txt commands = - sphinx-build -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html + sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html echo "Generated docs available in {toxinidir}/docs/_build/html" whitelist_externals = echo [testenv:docs-linkcheck] -deps = -rdocs/requirements.txt -commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck +basepython = python2.7 +deps = -r{toxinidir}/docs/requirements.txt +commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck + +[testenv:yamllint] +basepython = python2.7 +files = + {toxinidir}/docs + {toxinidir}/sdnvpn/test/functest/ +commands = + yamllint -s {[testenv:yamllint]files} + +[testenv:pep8] +basepython = python2.7 +commands = flake8 {toxinidir} + +[flake8] +# E123, E125 skipped as they are invalid PEP-8. + +show-source = True +ignore = E123,E125 +builtins = _ +exclude = build,dist,doc,legacy,.eggs,.git,.tox,.venv,testapi_venv,venv -- cgit 1.2.3-korg