656e7ccb3c
We want to default to running all tox environments under python 3, so set the basepython value in each environment. We do not want to specify a minor version number, because we do not want to have to update the file every time we upgrade python. We do not want to set the override once in testenv, because that breaks the more specific versions used in default environments like py35 and py36. Also update pylint to 1.9.2. Change-Id: I3492f6f9061a08d28bfde1a1ea1bc820c2b082c8 Signed-off-by: Doug Hellmann <doug@doughellmann.com> Signed-off-by: Chuck Short <chucks@redhat.com>
89 lines
2.3 KiB
INI
89 lines
2.3 KiB
INI
[tox]
|
||
envlist = py27,py35,pep8,pylint,docs
|
||
skipsdist = True
|
||
|
||
[testenv]
|
||
usedevelop = True
|
||
deps =
|
||
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||
-r{toxinidir}/requirements.txt
|
||
-r{toxinidir}/test-requirements.txt
|
||
|
||
install_command = pip install {opts} {packages}
|
||
setenv =
|
||
VIRTUAL_ENV={envdir}
|
||
PYTHON=coverage run --source freezerclient --parallel-mode
|
||
OS_TEST_PATH = ./freezerclient/tests/unit
|
||
commands =
|
||
find . -type f -name "*.py[c|o]" -delete
|
||
stestr run '{posargs}'
|
||
coverage combine
|
||
coverage html -d cover
|
||
coverage xml -o cover/coverage.xml
|
||
coverage report -m
|
||
rm -f .coverage
|
||
rm -rf .testrepository
|
||
|
||
whitelist_externals =
|
||
find
|
||
coverage
|
||
rm
|
||
|
||
python_files = test_*.py
|
||
norecursedirs = .tox .venv
|
||
|
||
[testenv:venv]
|
||
basepython = python3
|
||
commands = {posargs}
|
||
|
||
[testenv:py27]
|
||
basepython = python2.7
|
||
|
||
[testenv:py35]
|
||
basepython = python3.5
|
||
|
||
[testenv:py36]
|
||
basepython = python3.6
|
||
|
||
[testenv:docs]
|
||
basepython = python3
|
||
deps = -r{toxinidir}/doc/requirements.txt
|
||
commands = sphinx-build -b html doc/source doc/build/html
|
||
|
||
[testenv:pep8]
|
||
basepython = python3
|
||
commands = flake8 freezerclient
|
||
|
||
[testenv:pylint]
|
||
basepython = python3
|
||
commands = pylint --rcfile .pylintrc freezerclient
|
||
|
||
[flake8]
|
||
# Ignored hackings:
|
||
# H104 -> empty file, only comments
|
||
# H202 -> assertRaises(Exception, ...) too broad
|
||
# H404 -> Multi line docstrings should start without a leading new line.
|
||
# H405 -> Multi line docstrings should start with a one line summary followed by an empty line.
|
||
ignore = H104,H202,H404,H405
|
||
# H106: Don’t put vim configuration in source files
|
||
# H203: Use assertIs(Not)None to check for None
|
||
enable-extensions=H106,H203
|
||
show-source = True
|
||
exclude = .venv,.tox,dist,doc,*egg,releasenotes
|
||
|
||
|
||
[testenv:releasenotes]
|
||
basepython = python3
|
||
deps =
|
||
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||
-r{toxinidir}/requirements.txt
|
||
-r{toxinidir}/doc/requirements.txt
|
||
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||
|
||
[testenv:lower-constraints]
|
||
basepython = python3
|
||
deps =
|
||
-c{toxinidir}/lower-constraints.txt
|
||
-r{toxinidir}/test-requirements.txt
|
||
-r{toxinidir}/requirements.txt
|