This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
tox.ini
86 lines (82 loc) · 2.5 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
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
minversion = 3.4.0
envlist = lint,py27,py35,py36,py37,devel,distros
skipsdist = True
skip_missing_interpreters = True
isolated_build = True
[testenv]
description =
Unit testing
; install_command =
; python -c 'import subprocess, sys; pip_inst_cmd = sys.executable, "-m", "pip", "install"; subprocess.check_call(pip_inst_cmd + ("pip<19.1", )); subprocess.check_call(pip_inst_cmd + tuple(sys.argv[1:]))' {opts} {packages}
usedevelop = True
deps =
pep517>=0.5.0
pytest>=3.0
; pytest-html>=1.21.0
; pytest-molecule
extras = test
commands =
pytest --collect-only
# pytest already needs built wheel in dist/
python -m pep517.build \
--source \
--binary \
--out-dir {toxinidir}/dist/ {toxinidir}
pytest --color=yes {tty:-s}
setenv =
ANSIBLE_FORCE_COLOR={env:ANSIBLE_FORCE_COLOR:1}
ANSIBLE_INVENTORY={toxinidir}/tests/hosts.ini
ANSIBLE_CONFIG={toxinidir}/ansible.cfg
ANSIBLE_NOCOWS=1
ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_STDOUT_CALLBACK={env:ANSIBLE_STDOUT_CALLBACK:debug}
ANSIBLE_VERBOSITY={env:ANSIBLE_VERBOSITY:0}
PIP_DISABLE_PIP_VERSION_CHECK=1
PY_COLORS={env:PY_COLORS:1}
# pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
PYTHONDONTWRITEBYTECODE=1
# This should pass these args to molecule, no effect here as this is the default
# but it validates that it accepts extra params.
MOLECULE_OPTS=--destroy always
passenv =
CURL_CA_BUNDLE
REQUESTS_CA_BUNDLE
SSL_CERT_FILE
TWINE_*
whitelist_externals =
bash
twine
pytest
pre-commit
[testenv:devel]
description= Unit testing using master branch of molecule
extras = test
commands =
pip install -q "git+https://github.com/ansible/molecule#egg=molecule"
{[testenv]commands}
[testenv:lint]
description = Performs linting, style checks, metadata-validation, packaging
skip_install = true
deps =
pep517>=0.5.0
pre-commit
twine
commands =
pre-commit run -a
bash -c "rm -rf {toxinidir}/dist/ && mkdir -p {toxinidir}/dist/"
python -m pep517.build \
--source \
--binary \
--out-dir {toxinidir}/dist/ \
{toxinidir}
twine check dist/*
[testenv:upload]
description = Builds the packages and uploads them to https://pypi.org
envdir={toxworkdir}/lint
deps={[testenv:lint]deps}
commands =
{[testenv:lint]commands}
twine upload --verbose dist/*