forked from ansible/ansible-lint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
120 lines (113 loc) · 3.46 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
[tox]
minversion = 3.5.3
envlist = lint,py{38,37,36,35}-ansible{29,28,devel}
isolated_build = true
requires =
setuptools >= 41.4.0
pip >= 19.3.0
skip_missing_interpreters = True
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false
[testenv]
description =
Run the tests with pytest under {basepython}
deps =
ansible28: ansible>=2.8,<2.9
ansible29: ansible>=2.9,<2.10
ansibledevel: ansible-base @ git+https://github.com/ansible/ansible.git@devel
# ATTENTION: The following tarball is a temporary ACD incarnation
# ATTENTION: and may be removed/disappear at any time.
# FIXME: Replace this once ACD is out:
ansibledevel: ansible @ https://toshio.fedorapeople.org/ansible/acd/ansible/ansible-2.10.0.tar.gz
ruamel.yaml==0.16.5 # NOTE: 0.15.34 has issues with py37
flake8
importlib-metadata
packaging
pep8-naming
pytest
pytest-cov
pytest-xdist
# Needed to avoid DeprecationWarning errors in pytest:
setuptools >= 40.4.3
wheel
commands =
ansibledevel: sh -c "{envpython} -m pip show ansible | >/dev/null grep '^Version: 2.10.0$'"
ansibledevel: sh -c "{envpython} -m pip show ansible-base | >/dev/null grep '^Version: 2.10.0.dev0$'"
# Collections outside of ACD that config/routing.yml points to in Core:
ansibledevel: ansible-galaxy collection install --collections-path "{envtmpdir}" amazon.aws
ansibledevel: ansible-galaxy collection install --collections-path "{envtmpdir}" --pre chocolatey.chocolatey
{envpython} -m pytest \
--cov "{envsitepackagesdir}/ansiblelint" \
--junitxml "{toxworkdir}/junit.{envname}.xml" \
{posargs:}
passenv =
CURL_CA_BUNDLE # https proxies, https://github.com/tox-dev/tox/issues/1437
HOME
REQUESTS_CA_BUNDLE # https proxies
SSL_CERT_FILE # https proxies
# recreate = True
setenv =
ANSIBLE_COLLECTIONS_PATHS = {envtmpdir}
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
PIP_DISABLE_PIP_VERSION_CHECK = 1
whitelist_externals =
ansibledevel: sh
[testenv:.dev-env]
#basepython = python3
basepython = /home/wk/.pyenv/versions/ansible-lint-py3.8.0-pyenv-venv/bin/python3
#{[testenv]deps}
deps =
# virtualenv >= 16
# setuptools >= 45.0.0
isolated_build = false
skip_install = true
recreate = false
usedevelop = false
[testenv:build-dists]
description =
Build dists with PEP 517 and save them in the dist/ dir
basepython = python3
skip_install = true
deps =
pep517 >= 0.7.0
commands =
{envpython} -c 'import os.path, shutil, sys; \
dist_dir = os.path.join("{toxinidir}", "dist"); \
os.path.isdir(dist_dir) or sys.exit(0); \
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
shutil.rmtree(dist_dir)'
{envpython} -m pep517.build \
--source \
--binary \
--out-dir {toxinidir}/dist/ \
{toxinidir}
# deprecated: use more generic 'lint' instead
[testenv:flake8]
deps = {[testenv:lint]deps}
envdir = {toxworkdir}/lint
skip_install = true
commands =
python -m pre_commit run --all-files flake8
[testenv:lint]
deps =
pre-commit>=1.20.0
skip_install = true
commands =
python -m pre_commit run {posargs:--all-files}
passenv =
{[testenv]passenv}
PRE_COMMIT_HOME
[testenv:docs]
whitelist_externals = make
deps = sphinx
commands = make -C docs/docsite htmldocs
[testenv:metadata-validation]
description =
Verify that dists under the dist/ dir have valid metadata
depends = build-dists
deps =
twine
skip_install = true
# Ref: https://twitter.com/di_codes/status/1044358639081975813
commands =
twine check {toxinidir}/dist/*