|
Packit Service |
a04d08 |
[tox]
|
|
Packit Service |
9bfd13 |
envlist = py3, xenial-dev, flake8, pylint
|
|
Packit Service |
a04d08 |
recreate = True
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv]
|
|
Packit Service |
9bfd13 |
commands = {envpython} -m pytest {posargs:tests/unittests cloudinit}
|
|
Packit Service |
a04d08 |
setenv =
|
|
Packit Service |
a04d08 |
LC_ALL = en_US.utf-8
|
|
Packit Service |
9bfd13 |
passenv=
|
|
Packit Service |
9bfd13 |
PYTEST_ADDOPTS
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
9bfd13 |
[testenv:flake8]
|
|
Packit Service |
a04d08 |
basepython = python3
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
9bfd13 |
flake8==3.8.2
|
|
Packit Service |
9bfd13 |
commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/}
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
# https://github.com/gabrielfalcao/HTTPretty/issues/223
|
|
Packit Service |
a04d08 |
setenv =
|
|
Packit Service |
a04d08 |
LC_ALL = en_US.utf-8
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv:pylint]
|
|
Packit Service |
a04d08 |
basepython = python3
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
a04d08 |
# requirements
|
|
Packit Service |
9bfd13 |
pylint==2.6.0
|
|
Packit Service |
a04d08 |
# test-requirements because unit tests are now present in cloudinit tree
|
|
Packit Service |
a04d08 |
-r{toxinidir}/test-requirements.txt
|
|
Packit Service |
a04d08 |
-r{toxinidir}/integration-requirements.txt
|
|
Packit Service |
a04d08 |
commands = {envpython} -m pylint {posargs:cloudinit tests tools}
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv:py3]
|
|
Packit Service |
a04d08 |
basepython = python3
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
a04d08 |
-r{toxinidir}/test-requirements.txt
|
|
Packit Service |
9bfd13 |
commands = {envpython} -m pytest \
|
|
Packit Service |
9bfd13 |
--durations 10 \
|
|
Packit Service |
9bfd13 |
{posargs:--cov=cloudinit --cov-branch \
|
|
Packit Service |
a04d08 |
tests/unittests cloudinit}
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv:py27]
|
|
Packit Service |
a04d08 |
basepython = python2.7
|
|
Packit Service |
a04d08 |
deps = -r{toxinidir}/test-requirements.txt
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[flake8]
|
|
Packit Service |
9bfd13 |
# E226: missing whitespace around arithmetic operator
|
|
Packit Service |
9bfd13 |
# W503: line break before binary operator
|
|
Packit Service |
9bfd13 |
# W504: line break after binary operator
|
|
Packit Service |
9bfd13 |
ignore=E226,W503,W504
|
|
Packit Service |
a04d08 |
exclude = .venv,.tox,dist,doc,*egg,.git,build,tools
|
|
Packit Service |
9bfd13 |
per-file-ignores =
|
|
Packit Service |
9bfd13 |
cloudinit/cmd/main.py:E402
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv:doc]
|
|
Packit Service |
a04d08 |
basepython = python3
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
a04d08 |
-r{toxinidir}/doc-requirements.txt
|
|
Packit Service |
a04d08 |
commands =
|
|
Packit Service |
a04d08 |
{envpython} -m sphinx {posargs:doc/rtd doc/rtd_html}
|
|
Packit Service |
a04d08 |
doc8 doc/rtd
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
9bfd13 |
[xenial-shared-deps]
|
|
Packit Service |
9bfd13 |
# The version of pytest in xenial doesn't work with Python 3.8, so we define
|
|
Packit Service |
9bfd13 |
# two xenial environments: [testenv:xenial] runs the tests with exactly the
|
|
Packit Service |
9bfd13 |
# version of pytest present in xenial, and is used in CI. [testenv:xenial-dev]
|
|
Packit Service |
9bfd13 |
# runs the tests with the lowest version of pytest that works with Python 3.8,
|
|
Packit Service |
9bfd13 |
# 3.0.7, but keeps the other dependencies at xenial's level.
|
|
Packit Service |
9bfd13 |
#
|
|
Packit Service |
9bfd13 |
# (This section is not a testenv, it is used to maintain a single definition of
|
|
Packit Service |
9bfd13 |
# the dependencies shared between the two xenial testenvs.)
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
a04d08 |
# requirements
|
|
Packit Service |
a04d08 |
jinja2==2.8
|
|
Packit Service |
a04d08 |
pyyaml==3.11
|
|
Packit Service |
a04d08 |
oauthlib==1.0.3
|
|
Packit Service |
a04d08 |
pyserial==3.0.1
|
|
Packit Service |
a04d08 |
configobj==5.0.6
|
|
Packit Service |
a04d08 |
requests==2.9.1
|
|
Packit Service |
a04d08 |
# test-requirements
|
|
Packit Service |
9bfd13 |
pytest-catchlog==1.2.1
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
9bfd13 |
[testenv:xenial]
|
|
Packit Service |
9bfd13 |
# When updating this commands definition, also update the definition in
|
|
Packit Service |
9bfd13 |
# [testenv:xenial-dev]. See the comment there for details.
|
|
Packit Service |
9bfd13 |
commands =
|
|
Packit Service |
9bfd13 |
python ./tools/pipremove jsonschema
|
|
Packit Service |
9bfd13 |
python -m pytest {posargs:tests/unittests cloudinit}
|
|
Packit Service |
9bfd13 |
basepython = python3
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
9bfd13 |
# Refer to the comment in [xenial-shared-deps] for details
|
|
Packit Service |
9bfd13 |
{[xenial-shared-deps]deps}
|
|
Packit Service |
9bfd13 |
httpretty==0.8.6
|
|
Packit Service |
9bfd13 |
jsonpatch==1.10
|
|
Packit Service |
9bfd13 |
pytest==2.8.7
|
|
Packit Service |
9bfd13 |
|
|
Packit Service |
9bfd13 |
[testenv:xenial-dev]
|
|
Packit Service |
9bfd13 |
# This should be:
|
|
Packit Service |
9bfd13 |
# commands = {[testenv:xenial]commands}
|
|
Packit Service |
9bfd13 |
# but the version of pytest in xenial has a bug
|
|
Packit Service |
9bfd13 |
# (https://github.com/tox-dev/tox/issues/208) which means that the {posargs}
|
|
Packit Service |
9bfd13 |
# substitution variable is misparsed and causes a traceback. Ensure that any
|
|
Packit Service |
9bfd13 |
# changes here are reflected in [testenv:xenial].
|
|
Packit Service |
9bfd13 |
commands =
|
|
Packit Service |
9bfd13 |
python ./tools/pipremove jsonschema
|
|
Packit Service |
9bfd13 |
python -m pytest {posargs:tests/unittests cloudinit}
|
|
Packit Service |
9bfd13 |
basepython = {[testenv:xenial]basepython}
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
9bfd13 |
# Refer to the comment in [xenial-shared-deps] for details
|
|
Packit Service |
9bfd13 |
{[xenial-shared-deps]deps}
|
|
Packit Service |
9bfd13 |
# httpretty in xenial is 0.8.6, not 0.9.5. The oldest version to work with
|
|
Packit Service |
9bfd13 |
# Python 3.7+ is 0.9.5, because it is the first to include this commit:
|
|
Packit Service |
9bfd13 |
# https://github.com/gabrielfalcao/HTTPretty/commit/5776d97da3992b9071db5e21faf175f6e8729060
|
|
Packit Service |
9bfd13 |
httpretty==0.9.5
|
|
Packit Service |
9bfd13 |
# jsonpatch in xenial is 1.10, not 1.19 (#839779). The oldest version
|
|
Packit Service |
9bfd13 |
# to work with python3.6 is 1.16 as found in Artful. To keep default
|
|
Packit Service |
9bfd13 |
# invocation of 'tox' happy, accept the difference in version here.
|
|
Packit Service |
a04d08 |
jsonpatch==1.16
|
|
Packit Service |
9bfd13 |
pytest==3.0.7
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
9bfd13 |
[testenv:tip-flake8]
|
|
Packit Service |
9bfd13 |
commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/}
|
|
Packit Service |
9bfd13 |
deps = flake8
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv:tip-pylint]
|
|
Packit Service |
a04d08 |
commands = {envpython} -m pylint {posargs:cloudinit tests tools}
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
a04d08 |
# requirements
|
|
Packit Service |
a04d08 |
pylint
|
|
Packit Service |
a04d08 |
# test-requirements
|
|
Packit Service |
a04d08 |
-r{toxinidir}/test-requirements.txt
|
|
Packit Service |
a04d08 |
-r{toxinidir}/integration-requirements.txt
|
|
Packit Service |
a04d08 |
|
|
Packit Service |
a04d08 |
[testenv:citest]
|
|
Packit Service |
a04d08 |
basepython = python3
|
|
Packit Service |
a04d08 |
commands = {envpython} -m tests.cloud_tests {posargs}
|
|
Packit Service |
9bfd13 |
passenv = HOME TRAVIS
|
|
Packit Service |
a04d08 |
deps =
|
|
Packit Service |
a04d08 |
-r{toxinidir}/integration-requirements.txt
|
|
Packit Service |
9bfd13 |
|
|
Packit Service |
9bfd13 |
[pytest]
|
|
Packit Service |
9bfd13 |
# TODO: s/--strict/--strict-markers/ once xenial support is dropped
|
|
Packit Service |
9bfd13 |
addopts = --strict
|
|
Packit Service |
9bfd13 |
markers =
|
|
Packit Service |
9bfd13 |
allow_subp_for: allow subp usage for the given commands (disable_subp_usage)
|
|
Packit Service |
9bfd13 |
allow_all_subp: allow all subp usage (disable_subp_usage)
|
|
Packit Service |
9bfd13 |
ds_sys_cfg: a sys_cfg dict to be used by datasource fixtures
|