python-freezerclient/tox.ini
Ruslan Aliev 9b5458e504 Support upper-constraints in tox.ini
Update tox.ini to use upper constraints.
Since python-freezerclient is itself listed in upper-constraints.txt
we need to add some workaround. tox-install.sh was copied from
python-neutronclient [1].

[1] http://git.openstack.org/cgit/openstack/python-neutronclient/tree/tools/tox_install.sh

Change-Id: I9fb37f1bc103e487e139087125058ef63a26efd1
Closes-Bug: #1644612
2016-11-28 20:40:22 +03:00

84 lines
2.0 KiB
INI

[tox]
envlist = py27,py34,pep8,pylint,docs
skipsdist = True
[testenv]
usedevelop = True
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
install_command =
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
whitelist_externals =
find
coverage
rm
python_files = test_*.py
norecursedirs = .tox .venv
[testenv:venv]
commands = {posargs}
[testenv:py27]
basepython = python2.7
setenv =
OS_TEST_PATH = ./freezerclient/tests/unit
commands =
find . -type f -name "*.pyc" -delete
python setup.py testr --coverage --testr-args="{posargs}"
coverage report -m
rm -f .coverage
rm -rf .testrepository
[testenv:py34]
basepython = python3.4
setenv =
OS_TEST_PATH = ./freezerclient/tests/unit
commands =
find . -type f -name "*.pyc" -delete
python setup.py testr --coverage --testr-args="{posargs}"
coverage report -m
rm -f .coverage
rm -rf .testrepository
[testenv:py35]
basepython = python3.5
setenv =
OS_TEST_PATH = ./freezerclient/tests/unit
commands =
find . -type f -name "*.pyc" -delete
python setup.py testr --coverage --testr-args="{posargs}"
coverage report -m
rm -f .coverage
rm -rf .testrepository
[testenv:docs]
commands =
python setup.py build_sphinx
[testenv:pep8]
commands = flake8 freezerclient
[testenv:pylint]
commands = pylint --rcfile .pylintrc freezerclient
[flake8]
# it's not a bug that we aren't using all of hacking
# H102 -> apache2 license exists
# H103 -> license is apache
# H201 -> no bare excepts
# H501 -> don't use locals() for str formatting
# H903 -> \n not \r\n
ignore = H
select = H102, H103, H201, H501, H903, H201, H306, H301, H233
show-source = True
exclude = .venv,.tox,dist,doc,test,*egg,tests,releasenotes
[testenv:releasenotes]
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html