gear/tox.ini
Jeremy Stanley f995fba9a6 Update testing to Python 3.9 and linters
In preparation for an upcoming release, add testing for latest
Python (3.9). Switch tox to use Python 3 by default, and rename the
testenv for flake8 from pep8 to linters, consistent with other tools
and libraries OpenDev maintains. Update to a newer hacking plugin,
which will use newer flake8 as well. Ignore rules about line breaks
around comparison operators, as well as those related to ambiguous
variable names, at least for now. Also build distribution artifacts
on a more recent platform so we get newer Setuptools with support
for the latest package metadata, in preparation for a coming change
to update that.

Change-Id: I2130d66fc9aadaa9fe09635b59475be71938132e
2021-03-30 14:56:40 +02:00

51 lines
1.2 KiB
INI

[tox]
minversion = 1.6
skipsdist = True
envlist = py3,py27,linters
ignore_basepython_conflict = true
[testenv]
setenv = VIRTUAL_ENV={envdir}
usedevelop = True
basepython = python3
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
python setup.py testr --slowest --testr-args='{posargs}'
[tox:jenkins]
sitepackages = True
[testenv:linters]
commands = flake8
[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
commands =
python setup.py testr --coverage
[testenv:venv]
commands = {posargs}
[flake8]
exclude = .venv,.tox,dist,doc,*.egg
show-source = true
# E123, E125, E129 and H ignored intentionally in this code-base
ignore = E123,E125,E129,E741,W504,H
[testenv:docs]
basepython = python3
deps =
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -E -W -d doc/build/doctrees -b html doc/source/ doc/build/html
[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