1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
[tox]
minversion = 4.0
envlist =
lint
pkg
deps
py
isolated_build = True
requires =
tox>=4.0.12
[testenv]
usedevelop = True
# do not put * in passenv as it may break builds do to reduced isolation
passenv =
CI
GITHUB_*
HOME
PIP_*
PUBLISH
PYTEST_*
SSH_AUTH_SOCK
TERM
setenv =
PIP_DISABLE_VERSION_CHECK=1
PYTEST_REQPASS=16
py38: PYTEST_REQPASS=15
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1
commands =
python -m pytest
deps =
ansible-core
extras =
test
allowlist_externals =
find
rm
sh
changedir = {toxinidir}
[testenv:docs]
description = Build docs
extras =
docs
commands =
mkdocs build --strict
[testenv:lint]
description = Runs all linting tasks
commands =
# to run a single linter you can do "pre-commit run flake8"
python -m pre_commit run {posargs:--all}
deps = pre-commit>=1.18.1
extras =
skip_install = true
usedevelop = false
[testenv:pkg]
description =
Do packaging and distribution tests, PEP-440,PEP-517,PEP-621
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
# don't install package in this env
skip_install = true
deps =
build >= 0.9.0
twine >= 4.0.1
setenv =
commands =
rm -rfv {toxinidir}/dist/
python -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}
# metadata validation
python -m twine check --strict {toxinidir}/dist/*
|