<commit_before>[tox]
envlist = py27,py36,py37,pep8
minversion = 2.0
skipsdist = True

[testenv]
usedevelop = True
whitelist_externals = rm
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
       -r{toxinidir}/requirements.txt
setenv = VIRTUAL_ENV={envdir}
         DISCOVER_DIRECTORY=blazar/tests
         PYTHONHASHSEED=0
commands =
  lockutils-wrapper python setup.py testr --slowest --testr-args="{posargs}"

sitepackages = False

[testenv:cover]
basepython = python3
setenv =
  {[testenv]setenv}
  PYTHON=coverage run --source blazar --parallel-mode
commands =
  coverage erase
  lockutils-wrapper python setup.py testr --testr-args="{posargs}"
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml
  coverage report

[testenv:pep8]
basepython = python3
commands = flake8 {posargs}

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

[testenv:docs]
basepython = python3
deps =
    -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt
commands =
    rm -rf doc/html doc/build
    rm -rf doc/source/apidoc doc/source/api
    python setup.py build_sphinx

[testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps}
whitelist_externals = make
commands =
    sphinx-build -b latex doc/source doc/build/pdf
    make -C doc/build/pdf

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

[flake8]
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,api-ref
# NOTE(tonyb): Ignore a few errors/warnings that are now "on by default".
ignore=H105,H238,E123
# [H904] Delay string interpolations at logging calls.
enable-extensions=H904

[hacking]
local-check-factory = blazar.hacking.checks.factory

[testenv:pylint]
basepython = python3
deps = -r{toxinidir}/requirements.txt
       pylint==1.9.1
commands = pylint blazar<commit_msg>Add max-complexity in tox pep8<commit_after>[tox]
envlist = py27,py36,py37,pep8
minversion = 2.0
skipsdist = True

[testenv]
usedevelop = True
whitelist_externals = rm
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
       -r{toxinidir}/requirements.txt
setenv = VIRTUAL_ENV={envdir}
         DISCOVER_DIRECTORY=blazar/tests
         PYTHONHASHSEED=0
commands =
  lockutils-wrapper python setup.py testr --slowest --testr-args="{posargs}"

sitepackages = False

[testenv:cover]
basepython = python3
setenv =
  {[testenv]setenv}
  PYTHON=coverage run --source blazar --parallel-mode
commands =
  coverage erase
  lockutils-wrapper python setup.py testr --testr-args="{posargs}"
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml
  coverage report

[testenv:pep8]
basepython = python3
commands = flake8 {posargs}

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

[testenv:docs]
basepython = python3
deps =
    -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt
commands =
    rm -rf doc/html doc/build
    rm -rf doc/source/apidoc doc/source/api
    python setup.py build_sphinx

[testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps}
whitelist_externals = make
commands =
    sphinx-build -b latex doc/source doc/build/pdf
    make -C doc/build/pdf

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

[flake8]
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,api-ref
# NOTE(tonyb): Ignore a few errors/warnings that are now "on by default".
ignore=H105,H238,E123
# [H904] Delay string interpolations at logging calls.
enable-extensions=H904
# To get a list of functions that have a complexity of 17 or more, set
# max-complexity to 17 and run 'tox -epep8'.
# 16 is currently the most complex thing we have:
# 'ManagerService.update_lease' - blazar/manager/service.py
max-complexity=17

[hacking]
local-check-factory = blazar.hacking.checks.factory

[testenv:pylint]
basepython = python3
deps = -r{toxinidir}/requirements.txt
       pylint==1.9.1
commands = pylint blazar
{'fraction_non_alphanumeric': 0.11558238318801699, 'fraction_numerical': 0.019226469930695284, 'mean_word_length': 4.523456790123457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7398947', 'n_tokens_mistral': 1693, 'n_tokens_neox': 1613, 'n_words': 341}