Blob Blame History Raw
[tox]
envlist = py27, py3, xenial, pycodestyle, pyflakes, pylint
recreate = True

[testenv]
commands = python -m nose {posargs:tests/unittests cloudinit}
setenv =
    LC_ALL = en_US.utf-8

[testenv:pycodestyle]
basepython = python3
deps =
    pycodestyle==2.4.0
commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}

# https://github.com/gabrielfalcao/HTTPretty/issues/223
setenv =
    LC_ALL = en_US.utf-8

[testenv:pylint]
basepython = python3
deps =
    # requirements
    pylint==2.3.1
    # test-requirements because unit tests are now present in cloudinit tree
    -r{toxinidir}/test-requirements.txt
    -r{toxinidir}/integration-requirements.txt
commands = {envpython} -m pylint {posargs:cloudinit tests tools}

[testenv:py3]
basepython = python3
deps =
    nose-timer
    -r{toxinidir}/test-requirements.txt
commands = {envpython} -m nose --with-timer --timer-top-n 10 \
           {posargs:--with-coverage --cover-erase --cover-branches \
            --cover-inclusive --cover-package=cloudinit \
            tests/unittests cloudinit}

[testenv:py27]
basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt

[testenv:py26]
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests {posargs:tests/unittests cloudinit}
setenv =
    LC_ALL = C

[flake8]
#H102  Apache 2.0 license header not found
ignore=H404,H405,H105,H301,H104,H403,H101,H102,H106,H304
exclude = .venv,.tox,dist,doc,*egg,.git,build,tools

[testenv:doc]
basepython = python3
deps =
    -r{toxinidir}/doc-requirements.txt
commands =
    {envpython} -m sphinx {posargs:doc/rtd doc/rtd_html}
    doc8 doc/rtd

[testenv:xenial]
commands =
  python ./tools/pipremove jsonschema
  python -m nose {posargs:tests/unittests cloudinit}
basepython = python3
deps =
    # requirements
    jinja2==2.8
    pyyaml==3.11
    oauthlib==1.0.3
    pyserial==3.0.1
    configobj==5.0.6
    requests==2.9.1
    # jsonpatch in xenial is 1.10, not 1.19 (#839779). The oldest version
    # to work with python3.6 is 1.16 as found in Artful.  To keep default
    # invocation of 'tox' happy, accept the difference in version here.
    jsonpatch==1.16
    six==1.10.0
    # test-requirements
    httpretty==0.9.6
    mock==1.3.0
    nose==1.3.7
    unittest2==1.1.0
    contextlib2==0.5.1

[testenv:centos6]
basepython = python2.6
commands = nosetests {posargs:tests/unittests cloudinit}
deps =
    # requirements
    argparse==1.2.1
    jinja2==2.2.1
    pyyaml==3.10
    oauthlib==0.6.0
    configobj==4.6.0
    requests==2.6.0
    jsonpatch==1.2
    six==1.9.0
    -r{toxinidir}/test-requirements.txt

[testenv:opensusel150]
basepython = python2.7
commands = nosetests {posargs:tests/unittests cloudinit}
deps =
    # requirements
    jinja2==2.10
    PyYAML==3.12
    oauthlib==2.0.6
    configobj==5.0.6
    requests==2.18.4
    jsonpatch==1.16
    six==1.11.0
    -r{toxinidir}/test-requirements.txt

[testenv:tip-pycodestyle]
commands = {envpython} -m pycodestyle {posargs:cloudinit/ tests/ tools/}
deps = pycodestyle

[testenv:pyflakes]
commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/}
deps =
    pyflakes==1.6.0

[testenv:tip-pyflakes]
commands = {envpython} -m pyflakes {posargs:cloudinit/ tests/ tools/}
deps = pyflakes

[testenv:tip-pylint]
commands = {envpython} -m pylint {posargs:cloudinit tests tools}
deps =
    # requirements
    pylint
    # test-requirements
    -r{toxinidir}/test-requirements.txt
    -r{toxinidir}/integration-requirements.txt

[testenv:citest]
basepython = python3
commands = {envpython} -m tests.cloud_tests {posargs}
passenv = HOME
deps =
    -r{toxinidir}/integration-requirements.txt