storyboard/tox.ini
Adam Coldrick 983bb8e2d7 Unpin webob and hacking to fix compatibility issues
The pinned versions of webob and hacking weren't functioning properly
with modern Python, so they are unpinned.

Unpinning hacking brought a number of extra rules into use, so this
commit also contains a number of code style fixes.

There was also an incompatibility in the test_setup.sh script, which
meant it doesn't work with MySQL 8.0 (which is in Ubuntu 20.04). This
is also fixed in this commit.

Change-Id: I0889bc35f8babfeec42f6f577d302bb5fbce1c95
2020-09-11 12:26:47 +01:00

79 lines
2.1 KiB
INI

[tox]
minversion = 2.9.1
skipsdist = True
envlist = py3,pep8
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -U {opts} {packages}
passenv = OS_* STORYBOARD_*
setenv =
VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
stestr slowest
whitelist_externals = bash
[testenv:sqlite]
setenv =
{[testenv]setenv}
STORYBOARD_TEST_DB=sqlite:///{envtmpdir}
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/html doc/build
rm -rf doc/source/apidoc doc/source/api
sphinx-build -W -b html doc/source doc/build/html
whitelist_externals = rm
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source storyboard --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[flake8]
# E125 and E128 are ignored on purpose, they are invalid pep8
# W503 is ignored on purpose, it is no longer valid pep8
# The following rules should either be addressed or determined to be
# skippable long term.
# E265 is ignored to make switch to newer hacking easier
# H405 is ignored to make switch to newer hacking easier
ignore = E125,E128,E265,H405,W503
builtins = _
show-source = True
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[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
[testenv:lpimport]
# The Launchpad bug import tool uses launchpadlib, which is not a typical
# runtime dependency of anything else in StoryBoard
deps = launchpadlib
commands = storyboard-migrate {posargs}
[hacking]
import_exceptions = storyboard._i18n