
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. Change-Id: If0b5bbc4c01d5c0fd22cad07498b5f151660a4b9 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
66 lines
1.8 KiB
INI
66 lines
1.8 KiB
INI
[tox]
|
|
minversion = 1.6
|
|
envlist = docs, linters
|
|
skipdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
whitelist_externals = bash
|
|
|
|
[testenv:bindep]
|
|
basepython = python3
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
# separately, outside of the requirements files.
|
|
deps = bindep
|
|
commands = bindep test
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
commands =
|
|
# Run hacking/flake8 check for all python files
|
|
bash -c "git ls-files | grep -v releasenotes | xargs grep --binary-files=without-match \
|
|
--files-with-match '^.!.*python$' \
|
|
--exclude-dir .tox \
|
|
--exclude-dir .git \
|
|
--exclude-dir .eggs \
|
|
--exclude-dir *.egg-info \
|
|
--exclude-dir dist \
|
|
--exclude-dir *lib/python* \
|
|
--exclude-dir doc \
|
|
| xargs flake8 --verbose"
|
|
|
|
[testenv:ansible-lint]
|
|
basepython=python2
|
|
commands =
|
|
bash ci-scripts/ansible-lint.sh
|
|
|
|
[testenv:linters]
|
|
basepython = python3
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/ansible-requirements.txt
|
|
commands =
|
|
{[testenv:pep8]commands}
|
|
{[testenv:ansible-lint]commands}
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
whitelist_externals = bash
|
|
commands = bash -c ci-scripts/releasenotes_tox.sh
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
# E265 deals with spaces inside of comments
|
|
show-source = True
|
|
ignore = E123,E125,E265
|
|
builtins = _
|