Files
requirements/tox.ini
2025-10-27 17:32:00 +00:00

129 lines
3.5 KiB
INI

[tox]
minversion = 4.11.0
envlist = validate,py3,pep8,pip-install
[testenv]
usedevelop = true
deps =
-c{toxinidir}/upper-constraints.txt
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
stestr run {posargs}
[testenv:py310-check-uc]
basepython = python3.10
skip_install = true
# For now we need something due to an issue in the tox_install_sibling_packages
# AnseibleModule
deps = setuptools
commands = python -m pip install --dry-run -r{toxinidir}/upper-constraints.txt
[testenv:py311-check-uc]
basepython = python3.11
skip_install = true
# For now we need something due to an issue in the tox_install_sibling_packages
# AnseibleModule
deps = setuptools
commands = {[testenv:py310-check-uc]commands}
[testenv:py312-check-uc]
basepython = python3.12
skip_install = true
# For now we need something due to an issue in the tox_install_sibling_packages
# AnseibleModule
deps = setuptools
commands = {[testenv:py310-check-uc]commands}
[testenv:py313-check-uc]
basepython = python3.13
skip_install = true
# For now we need something due to an issue in the tox_install_sibling_packages
# AnseibleModule
deps = setuptools
commands = {[testenv:py310-check-uc]commands}
[testenv:venv]
commands = {posargs}
[testenv:generate]
allowlist_externals =
generate-constraints
description = Regenerates upper-constraints.txt
# Generate needs an unconstrained install to get new dependencies
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = generate-constraints {posargs: -d denylist.txt -r global-requirements.txt -p python3.9 -p python3.10 -p python3.11 -p python3.12 -p python3.13 > upper-constraints.txt}
[testenv:validate]
allowlist_externals =
validate-constraints
commands =
validate-constraints {toxinidir}/global-requirements.txt {toxinidir}/upper-constraints.txt {toxinidir}/denylist.txt
[testenv:validate-projects]
allowlist_externals =
validate-projects
commands = validate-projects {toxinidir}/projects.txt
[testenv:pep8]
description = Perform linting
skip_install = true
deps =
ruff~=0.13.0 # MIT
hacking~=7.0 # Apache-2.0
bashate~=2.1 # Apache-2.0
allowlist_externals =
bash
commands =
ruff check --fix --unsafe-fixes
ruff format
flake8
bash -c "find {toxinidir}/tools \
-type f \
-name \*.sh \
-print0 | xargs -0 bashate -v -iE006,E010"
[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!
skip_install = true
deps = bindep
commands = bindep test
usedevelop = False
[testenv:docs]
allowlist_externals =
sphinx-build
deps =
-c{env:TOX_CONSTRAINTS_FILE:{toxinidir}/upper-constraints.txt}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pip-install]
recreate = true
deps = .
commands = python {toxinidir}/tools/check-install.py
[testenv:requirements-check]
allowlist_externals =
{toxinidir}/playbooks/files/project-requirements-change.py
deps = -r{toxinidir}/requirements.txt
commands =
{toxinidir}/playbooks/files/project-requirements-change.py --local {posargs}
[testenv:babel]
skip_install = true
# Use the local upper-constraints.txt file
allowlist_externals =
{toxinidir}/tools/babel-test.sh
deps = Babel
commands = {toxinidir}/tools/babel-test.sh
[flake8]
# We only enable the hacking (H) checks
select = H
exclude = .venv,.git,.tox,dist,doc,*egg,build