tenks/tox.ini
Sharpz7 7cfe9fe177 [codespell] Adding Tox Target for Codespell
Second in a series of commits to add Codespell to Ironic Repos. This one adds the command that was used to fix the spelling errors.

Future Commits will add CI support and potentially a git-blame-ignore-revs file if their are lots of spelling mistakes that could clutter git blame.

Change-Id: Ie92e24f7181f37a7b9a6a960a2c5d6ec0eb08773
2024-11-13 20:31:43 +00:00

106 lines
2.8 KiB
INI

[tox]
minversion = 3.2.1
envlist = py3,pep8,alint,cover
skipsdist = True
ignore_basepython_conflict=true
[testenv]
basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}
passenv =
HOME
allowlist_externals =
bash
rm
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
[testenv:py36]
deps =
-c https://releases.openstack.org/constraints/upper/yoga
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
commands =
flake8 {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals = make
commands = sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:venv]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source tenks,ansible --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage report
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:alint]
allowlist_externals = bash
# ansible-lint doesn't support custom modules, so add ours to the Ansible path.
setenv = ANSIBLE_LIBRARY = {toxinidir}/ansible/action_plugins/
# Exclude roles downloaded from Galaxy (in the form 'author.role') from
# linting.
commands = bash -c "ansible-lint \
{toxinidir}/ansible/deploy.yml \
{toxinidir}/ansible/teardown.yml"
[testenv:releasenotes]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
extend-ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8
application-import-names = tenks
filename = *.py
[testenv:codespell]
description =
Run codespell to check spelling
deps = codespell
# note(JayF): {posargs} lets us run `tox -ecodespell -- -w` to get codespell
# to correct spelling issues in our code it's aware of.
commands =
codespell {posargs}