af88d16028
With this change, unit tests now pass on Python 2.7: tox -e py27. Changes: * Replace "yield from ..." with "for item in ...: yield item" * Remove last annotations from utils.py * tox.ini: use python3 as basepython rather than python3.5 to support Python 2.7 and Python 3.6 * tox.ini: add py27 to envlist Related-Bug: 1726399 Change-Id: Ief1a95402e8a31a34ada2937a7ae6a604f7f8757
80 lines
2.0 KiB
INI
80 lines
2.0 KiB
INI
[tox]
|
|
envlist = pep8,pip-check-reqs,cover,py35,py27
|
|
minversion = 1.9
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop=True
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
basepython = python3
|
|
commands =
|
|
python setup.py testr --testr-args='{posargs}'
|
|
|
|
[testenv:venv]
|
|
basepython = python2.7
|
|
commands = {posargs}
|
|
|
|
[testenv:run]
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
commands =
|
|
ospurge {posargs:--help}
|
|
|
|
[testenv:pep8]
|
|
skip_install = True
|
|
whitelist_externals = bash
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
flake8 {posargs}
|
|
bash -c "find {toxinidir}/tools -type f -name *.sh \
|
|
-print0 | xargs -0 bashate -v -iE006 -eE005,E042"
|
|
|
|
[testenv:cover]
|
|
commands =
|
|
coverage erase
|
|
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
|
|
whitelist_externals = bash
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
mypy;python_version>'3.2'
|
|
commands =
|
|
bash -c 'mypy --fast-parser --disallow-untyped-calls --check-untyped-defs --disallow-untyped-defs --ignore-missing-imports ospurge | grep -v ospurge/tests/'
|
|
|
|
[testenv:pip-check-reqs]
|
|
# Do not install test-requirements as that will pollute the virtualenv for
|
|
# determining missing packages.
|
|
# This also means that pip-check-reqs must be installed separately, outside
|
|
# of the requirements.txt files
|
|
deps = -r{toxinidir}/requirements.txt
|
|
pip_check_reqs
|
|
commands=
|
|
pip-extra-reqs -d ospurge
|
|
pip-missing-reqs -d ospurge
|
|
|
|
[testenv:docs]
|
|
basepython = python2.7
|
|
whitelist_externals = echo
|
|
skip_install = True
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
doc8 -e .rst doc/source README.rst
|
|
python setup.py build_sphinx -E
|
|
echo "Documentation location: {toxinidir}/doc/build/html/index.html"
|
|
|
|
[testenv:functional]
|
|
commands =
|
|
{toxinidir}/tools/func-tests.sh
|
|
|
|
[flake8]
|
|
ignore = H404,H405
|
|
enable-extensions = H106,H203,H904
|
|
show-source = True
|