OSPurge; rework tox.ini to test multiple versions of Python

Change-Id: I01e0b61c1a39c9ce8fe425ac4c0922fc8c18ce4e
This commit is contained in:
Jordan Pittier 2016-12-02 16:31:24 +01:00
parent 3a612efd53
commit 3ea94225fc
2 changed files with 12 additions and 7 deletions

View File

@ -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

18
tox.ini
View File

@ -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]