Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
tox.ini 1.57 KiB
[tox]
minversion = 2.3.1
skipsdist = True
envlist = py35,py27,genconfig,pep8

[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps =
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
commands =
  find ccitools -type f -name "*.pyc" -delete
  stestr run {posargs}
whitelist_externals =
  bash
  find
passenv = PBR_VERSION

[testenv:pep8]
basepython = python3
deps =
     {[testenv]deps}
commands =
  flake8
  # Run security linter
  bandit -r ccitools -x tests

[testenv:bandit]
basepython = python3
commands = bandit -r ccitools -x tests

[testenv:venv]
basepython = python3
commands = {posargs}

[testenv:cover]
basepython = python3
setenv =
    PYTHON=coverage run --source ccitools --parallel-mode
commands =
    stestr run {posargs}
    coverage combine
    coverage html -d cover
    coverage xml -o cover/coverage.xml
    coverage report

[flake8]
filename= *.py
show-source = true
enable-extensions = H203,H904

# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D203: 1 blank line required before class docstring (deprecated in pep257)
# H202: assertRaises Exception too broad
ignore = D100,D101,D102,D103,D104,D203,H202

exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity=24

[testenv:genconfig]
basepython = python3
commands = oslo-config-generator --config-file=config-generator/ccitools.conf