This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
tox.ini
119 lines (112 loc) · 3.25 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
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
minversion = 3.9.0
envlist =
lint
packaging
py{36,37,38,39}
py-{36,37,38,39}-devel
skip_missing_interpreters = True
isolated_build = True
requires =
# 2020-resolver
pip >= 20.2.4
[testenv]
description =
Unit testing
usedevelop = True
extras =
ansible
lint
test
commands =
ansibledevel: ansible-galaxy install git+https://github.com/ansible-collections/community.general.git
# failsafe as pip may install incompatible dependencies
pip check
# use cookiecutter to deploy the functional test verify playbooks
cookiecutter -f molecule_goss/cookiecutter/ --output-dir molecule_goss/test/scenarios/docker/centos7/ --no-input
cookiecutter -f molecule_goss/cookiecutter/ --output-dir molecule_goss/test/scenarios/docker/ubuntu18.04/ --no-input
# failsafe for preventing changes that may break pytest collection
python -m pytest -p no:cov --collect-only
python -m pytest {posargs:-l}
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_NO_LOG=0
deps =
devel: ansible>=2.10.3,<2.11
py{36,37,38,39}: molecule[ansible,test]
py{36,37,38,39}-{devel}: git+https://github.com/ansible-community/molecule.git@master#egg=molecule[ansible,test]
dockerfile: ansible>=2.9.12
cookiecutter
molecule-docker
docker>=4.3.1
passenv =
CI
CURL_CA_BUNDLE
DOCKER_*
HOME
PYTEST_OPTIONS
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TOXENV
TRAVIS
TRAVIS_*
TWINE_*
VAGRANT_HOME
whitelist_externals =
bash
twine
pytest
pre-commit
[testenv:packaging]
usedevelop = false
skip_install = true
deps =
collective.checkdocs >= 0.2
pep517 >= 0.5.0
twine >= 2.0.0
commands =
bash -c "rm -rf {toxinidir}/dist/ {toxinidir}/build/ && mkdir -p {toxinidir}/dist/"
python -m pep517.build \
--source \
--binary \
--out-dir {toxinidir}/dist/ \
{toxinidir}
twine check dist/*
[testenv:devel]
description= Unit testing using master branches of molecule and ansible
extras = test
commands =
{[testenv]commands}
deps =
git+https://github.com/ansible/ansible.git#egg=ansible
git+https://github.com/ansible-community/molecule#egg=molecule
[testenv:lint]
description = Performs linting, style checks
skip_install = true
deps =
pre-commit
commands =
pre-commit run -a
[testenv:upload]
description = Builds the packages and uploads them to https://pypi.org
envdir={toxworkdir}/dist
deps=
{[testenv:packaging]deps}
commands =
{[testenv:packaging]commands}
twine upload --verbose dist/*