tripleo-ci/tox.ini
Sorin Sbarnea db10400e88 Use python3 for tox linting
fix tox python3 overrides 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, add tox-linters job to gate so that changes like this can merge.
The files section limit what runs - and if *nothing* run, there's no +2
from CI. Another reason to add this job is that we run voting jobs in
both check and gate, and this one was only in check.

Change-Id: I742695bfcd071c4930c4170553af7d9a59f6a432
2018-09-24 08:13:16 +02:00

54 lines
1.4 KiB
INI

[tox]
envlist = linters, py27, py35
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
[testenv:venv]
commands = {posargs}
[testenv:pyflakes]
basepython = python3
deps = pyflakes
commands = pyflakes setup.py scripts
[testenv:linters]
basepython = python3
whitelist_externals = bash
commands = flake8 --max-line-length 80 {toxinidir} {posargs}
# deprecated: use linters instead. kept only as a convenience alias
[testenv:pep8]
envdir = {toxworkdir}/linters
whitelist_externals = {[testenv:linters]whitelist_externals}
commands = {[testenv:linters]commands}
[testenv:cireport]
passenv =
SSH_AUTH_SOCK
commands = python scripts/tripleo-jobs-gerrit.py {posargs}
# This environment can be used to quickly validate that all needed system
# packages required to successfully execute test targets are installed
[testenv:bindep]
# 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
# This environment is used to run unit tests
[testenv:py27]
deps = {[testenv]deps}
changedir = scripts/emit_releases_file
commands = pytest
[testenv:py35]
deps={[testenv]deps}
changedir = {[testenv:py27]changedir}
commands = {[testenv:py27]commands}