Files
python-watcherclient/tox.ini
Matt Riedemann 2cab116e30 Use upper-constraints in tox runs
The upper-constraints file wasn't being enforced
when installing dependencies in tox runs which can
lead to failures like installing Sphinx>2.0 in py27
where it's not supported.

This is loosely based on novaclient change
I8be883215f27abb58d15b85e8542cbdf32000bac for the
same kind of issue.

Note there are other things that should be done
in here regarding requirements cleanup, like the
sphinx dependnecies should move to a
doc/requirements.txt file to separate them from
unit test runs, but that can be dealt with in a
follow up change.

Change-Id: I359a35af5b653299110a8d0faddb255da0b10118
Closes-Bug: #1828698
2019-05-11 18:45:44 -04:00

70 lines
1.6 KiB
INI

[tox]
minversion = 2.0
envlist = py36,py27,pep8
skipsdist = True
[testenv]
usedevelop = True
passenv = ZUUL_CACHE_DIR
REQUIREMENTS_PIP_LOCATION
install_command = pip install {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands = rm -f .testrepository/times.dbm
stestr --test-path=./watcherclient/tests/unit run {posargs}
stestr slowest
[testenv:pep8]
basepython = python3
commands = flake8
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:cover]
basepython = python3
setenv =
PYTHON=coverage run --source watcherclient --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
basepython = python3
commands = python setup.py build_sphinx
[testenv:debug]
basepython = python3
commands = oslo_debug_helper -t watcherclient/tests/unit {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
enable-extensions = H203,H106
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[testenv:wheel]
basepython = python3
commands = python setup.py bdist_wheel
[hacking]
import_exceptions = watcherclient._i18n
[testenv:lower-constraints]
basepython = python3
install_command = pip install -U {opts} {packages}
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt