forked from ansible/pytest-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
79 lines (74 loc) · 1.84 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
[tox]
envlist =
lint,
pkg,
py,
devel,
py37,
py38
skip_missing_interpreters = true
[testenv]
description =
Run tests
devel: with ansible-core devel branch and without dependencies constraints
commands =
coverage run --parallel --source pytest_ansible -m pytest -v --doctest-glob='*.md' {posargs}
coverage combine
coverage report -m
passenv =
ANSIBLE_DEBUG
setenv =
ANSIBLE_REMOTE_TEMP = {envdir}/.ansible-remote
ANSIBLE_LOCAL_TEMP = {envdir}/.ansible-local
PIP_CONSTRAINT = {toxinidir}/.config/requirements.txt
devel: PIP_CONSTRAINT = /dev/null
py37: PIP_CONSTRAINT = /dev/null
py38: PIP_CONSTRAINT = /dev/null
extras =
test
allowlist_externals =
git
rm
sh
deps =
devel: ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+
[testenv:lint]
deps =
pre-commit
commands =
pre-commit --version
[testenv:deps]
description = Bump all test dependencies
# we reuse the lint environment
envdir = {toxworkdir}/lint
skip_install = true
basepython = python3.9
deps =
{[testenv:lint]deps}
setenv =
# without his upgrade would likely not do anything
PIP_CONSTRAINT = /dev/null
commands =
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual lock
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
# Update pre-commit hooks
-pre-commit autoupdate
# We fail if files are modified at the end
git diff --exit-code
[testenv:pkg]
description =
Do packaging/distribution
usedevelop = false
# don't install molecule itself in this env
skip_install = true
deps =
build >= 0.9.0
twine >= 4.0.2 # pyup: ignore
setenv =
commands =
rm -rfv {toxinidir}/dist/
python -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}
# metadata validation
sh -c "python -m twine check --strict {toxinidir}/dist/*"