From 3ea94225fc4ff55b740867c0590f07fde2d56fe5 Mon Sep 17 00:00:00 2001 From: Jordan Pittier Date: Fri, 2 Dec 2016 16:31:24 +0100 Subject: [PATCH] OSPurge; rework tox.ini to test multiple versions of Python Change-Id: I01e0b61c1a39c9ce8fe425ac4c0922fc8c18ce4e --- test-requirements.txt | 1 - tox.ini | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 2652dee..a44ac16 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,6 @@ bashate>=0.2 # Apache-2.0 coverage>=4.0 # Apache-2.0 doc8 # Apache-2.0 hacking>=0.12.0,<0.13 # Apache-2.0 -mypy-lang openstackdocstheme>=1.5.0 # Apache-2.0 sphinx>=1.2.1,!=1.3b1,<1.4 # BSD testrepository>=0.0.18 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 49e120e..066f44d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = pep8,pip-check-reqs,coverage +envlist = pep8,pip-check-reqs,cover,py35 minversion = 1.9 skipsdist = True @@ -7,10 +7,15 @@ skipsdist = True deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -basepython = python3.5 +basepython = + run,pep8,cover,mypy,pip-check-reqs,py35: python3.5 + docs,venv: python2 commands = python setup.py testr --testr-args='{posargs}' +[testenv:venv] +commands = {posargs} + [testenv:run] usedevelop=True deps = @@ -28,16 +33,17 @@ commands = bash -c "find {toxinidir}/tools -type f -name *.sh \ -print0 | xargs -0 bashate -v -iE006 -eE005,E042" -[testenv:coverage] +[testenv:cover] commands = coverage erase - coverage run --source=ospurge -m unittest discover --verbose - coverage report --omit="ospurge/tests/*" --show-missing --skip-covered --fail-under 100 + python setup.py testr --coverage --omit="ospurge/tests/*" --testr-args='{posargs}' + coverage report --omit="ospurge/tests/*" --show-missing --fail-under 100 [testenv:mypy] skip_install = True deps = -r{toxinidir}/test-requirements.txt + mypy-lang;python_version>'3.2' commands = mypy --check-untyped-defs --disallow-untyped-defs --silent-imports ospurge @@ -59,7 +65,7 @@ deps = -r{toxinidir}/test-requirements.txt commands = doc8 -e .rst doc/source README.rst - python setup.py build_sphinx -E -b html + python setup.py build_sphinx -E echo "Documentation location: {toxinidir}/doc/build/html/index.html" [flake8]