4d23d8aab5
Depends-On: https://review.opendev.org/c/openstack/governance/+/910581 Change-Id: I87866224d9ac89d3da150c95a86a20afb48dc4d2
80 lines
2.8 KiB
INI
80 lines
2.8 KiB
INI
[tox]
|
|
minversion = 4.3.0
|
|
envlist = pep8,py311
|
|
ignore_basepython_conflict=True
|
|
|
|
[testenv]
|
|
description =
|
|
Run unit tests.
|
|
package = editable
|
|
passenv =
|
|
setenv =
|
|
LANG=en_US.UTF-8
|
|
LANGUAGE=en_US:en
|
|
install_command = python -I -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
commands =
|
|
# A very dirty hack to bypass dependency conflict of openapi-core/jsonchema/referencing
|
|
pip install -U openapi-core
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:functional{,-py310,-py311}]
|
|
description =
|
|
Run functional tests.
|
|
setenv =
|
|
{[testenv]setenv}
|
|
commands =
|
|
# Generators conflict with each other since every service is screwing
|
|
# OsloConfig to its own flavor and I have not found a working way to deal with
|
|
# that except of physically isolating them
|
|
stestr --test-path ./codegenerator/tests/functional/ run {posargs}
|
|
stestr slowest
|
|
|
|
[testenv:docs{,-py310,-py311}]
|
|
description =
|
|
Build documentation in HTML format.
|
|
# We do not want the package (because of heavy dependencies for docs)
|
|
skip_install = True
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
sphinx-build -W --keep-going -b html -j auto doc/source/ doc/build/html
|
|
|
|
[testenv:releasenotes{,-py310,-py311}]
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
skip_install = True
|
|
commands =
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:pep8]
|
|
description =
|
|
Run style checks.
|
|
deps =
|
|
pre-commit
|
|
commands =
|
|
pre-commit run --all-files --show-diff-on-failure
|
|
|
|
[flake8]
|
|
application-import-names = codegenerator
|
|
# The following are ignored on purpose. It's not super worth it to fix them.
|
|
# However, if you feel strongly about it, patches will be accepted to fix them
|
|
# if they fix ALL of the occurances of one and only one of them.
|
|
# E203 Black will put spaces after colons in list comprehensions
|
|
# E501 Black takes care of line length for us
|
|
# H238 New Style Classes are the default in Python3
|
|
# H301 Black will put commas after imports that can't fit on one line
|
|
# H4 Are about docstrings and there's just a huge pile of pre-existing issues.
|
|
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
|
|
# Also, both openstacksdk and Donald Knuth disagree with the rule. Line
|
|
# breaks should occur before the binary operator for readability.
|
|
ignore = E203, E501, H301, H238, H4, W503
|
|
import-order-style = pep8
|
|
show-source = True
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,
|