-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
tox.ini
147 lines (140 loc) · 3.37 KB
/
tox.ini
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
[tox]
envlist =
lint
docs
pkg
py
integration
minversion = 4.11.3
isolated_build = true
skip_missing_interpreters = false
requires =
tox-extra
[testenv]
description = Run the tests with pytest
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
PIP_DISABLE_PIP_VERSION_CHECK = 1
PYTHONHASHSEED = 0
VIRTUALENV_NO_DOWNLOAD = 1
PYTEST_REQPASS = 7
passenv =
HOME
PYTEST_*
PYTHONHTTPSVERIFY
REQUESTS_CA_BUNDLE
SHELL
SSL_CERT_FILE
SSH_AUTH_SOCK
TERM
TMPDIR
http_proxy
https_proxy
no_proxy
allowlist_externals =
bash
rm
sh
commands =
; pytest {tty:--color=yes}
coverage run -m pytest {posargs:\
-ra \
--showlocals \
--doctest-modules \
--durations=10 \
-m "not eco" \
}
sh -c "coverage combine -a -q --data-file=.coverage .tox/.coverage.*"
package = editable
extras =
test
[testenv:deps]
description = Update dependency lock files
# Force it to use oldest supported version of python or we would lose ability
# to get pinning correctly.
basepython = python3.10
skip_install = true
deps =
pip-tools >= 6.12.3
setenv =
PIP_CONSTRAINT=
commands =
pip-compile --upgrade --no-annotate --strip-extras --output-file=.config/constraints.txt --all-extras pyproject.toml
[testenv:docs]
description = Builds docs
extras =
docs
setenv =
# Disable colors until markdown-exec supports it:
# https://github.com/pawamoy/markdown-exec/issues/11
NO_COLOR = 1
TERM = dump
skip_install = false
usedevelop = true
commands =
mkdocs build {posargs:}
[testenv:lint]
description = Run linters
passenv = {[testenv]passenv}
# without PROGRAMDATA cloning using git for Windows will fail with an
# `error setting certificate verify locations` error
PROGRAMDATA
extras = lint
deps =
pre-commit >= 2.4.0
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
# don't install package itself in this env
skip_install = true
setenv =
PIP_CONSTRAINT=
commands =
python -m pre_commit run {tty:--color=always} --all-files --show-diff-on-failure
[testenv:integration]
description = Run integrations tests
setenv =
ANSIBLE_NOCOWS=1
ANSIBLE_FORCE_COLOR=1
extras =
test
deps =
ansible-core>=2.12
nox
commands =
ansible --version
nox --version
mk test-integration
package = editable
[testenv:pkg]
description =
Do packaging/distribution. If tag is not present or PEP440 compliant upload to
PYPI could fail
deps =
collective.checkdocs >= 0.2
build >= 0.3.1.post1
twine >= 1.14.0
commands =
rm -rfv {toxinidir}/dist/
python -m build \
--sdist \
--wheel \
--outdir {toxinidir}/dist/ \
{toxinidir}
# metadata validation
python -m twine check --strict {toxinidir}/dist/*
[testenv:coverage]
description = Combines and displays coverage results
skip_install = true
usedevelop = false
setenv =
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
commands =
python3 -m coverage --version
# needed by codecov github actions, also ignored result to reach report one.
python3 -m coverage xml --fail-under=0
# just for humans running it:
python3 -m coverage report
deps =
coverage[toml]>=7.0.5