<commit_before>[tox]
minversion = 1.6
skipsdist = True
envlist = py26,py27,py33,py34,pep8,docs,sample_config

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
         # FIXME(dolph): overriding the hash seed with a constant is a
         # workaround for bug 1348818
         PYTHONHASHSEED=0
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
whitelist_externals = bash

[testenv:py33]
deps = -r{toxinidir}/requirements-py3.txt
       -r{toxinidir}/test-requirements-py3.txt
       nose
commands =
  nosetests --with-coverage --cover-package=keystone \
      --exclude test_ldap \
      keystone/tests/test_auth_plugin.py \
      keystone/tests/test_backend.py \
      keystone/tests/test_backend_rules.py \
      keystone/tests/test_cache_backend_mongo.py \
      keystone/tests/test_driver_hints.py \
      keystone/tests/test_hacking_checks.py \
      keystone/tests/test_injection.py \
      keystone/tests/test_matchers.py \
      keystone/tests/test_policy.py \
      keystone/tests/test_singular_plural.py \
      keystone/tests/test_sizelimit.py \
      keystone/tests/test_sql_migrate_extensions.py \
      keystone/tests/test_token_bind.py \
      keystone/tests/test_url_middleware.py \
      keystone/tests/test_utils.py \
      keystone/tests/test_validation.py \
      keystone/tests/test_v3_controller.py \
      keystone/tests/test_wsgi.py \
      keystone/tests/unit

[testenv:py34]
deps = -r{toxinidir}/requirements-py3.txt
       -r{toxinidir}/test-requirements-py3.txt
       nose
commands =
  nosetests --with-coverage --cover-package=keystone \
      --exclude test_ldap \
      keystone/tests/test_auth_plugin.py \
      keystone/tests/test_backend.py \
      keystone/tests/test_backend_rules.py \
      keystone/tests/test_cache_backend_mongo.py \
      keystone/tests/test_driver_hints.py \
      keystone/tests/test_hacking_checks.py \
      keystone/tests/test_injection.py \
      keystone/tests/test_matchers.py \
      keystone/tests/test_policy.py \
      keystone/tests/test_singular_plural.py \
      keystone/tests/test_sizelimit.py \
      keystone/tests/test_sql_migrate_extensions.py \
      keystone/tests/test_token_bind.py \
      keystone/tests/test_url_middleware.py \
      keystone/tests/test_utils.py \
      keystone/tests/test_validation.py \
      keystone/tests/test_v3_controller.py \
      keystone/tests/test_wsgi.py \
      keystone/tests/unit

[testenv:pep8]
commands =
  flake8 {posargs}
  # Run bash8 during pep8 runs to ensure violations are caught by
  # the check and gate queues
  bashate examples/pki/gen_pki.sh
  # Check that .po and .pot files are valid.
  # NOTE(jaegerandi): We search for files ending with '.po' or '.pot'.
  # The regex '.*\.pot?' does not work on OS X and we assume there are no
  # files with more than one "t" that have to be ignored.
  bash -c "find keystone -type f -regex '.*\.pot*' -print0| \
           xargs -0 -n 1 msgfmt --check-format -o /dev/null"

[tox:jenkins]
downloadcache = ~/cache/pip

[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'

[testenv:venv]
commands = {posargs}

[testenv:debug]
commands = oslo_debug_helper.sh {posargs}

[flake8]
filename= *.py,keystone-*
show-source = true

# H104  File contains nothing but comments
# H405  multi line docstring summary not separated with an empty line
# H803  Commit message should not end with a period (do not remove per list discussion)
# H904  Wrap long lines in parentheses instead of a backslash
ignore = H104,H405,H803,H904

builtins = _
exclude=.venv,.git,.tox,build,dist,doc,*openstack/common*,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot

[testenv:docs]
commands=
    python setup.py build_sphinx

[testenv:sample_config]<commit_msg>Add max-complexity to pep8 for Keystone<commit_after>[tox]
minversion = 1.6
skipsdist = True
envlist = py26,py27,py33,py34,pep8,docs,sample_config

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
         # FIXME(dolph): overriding the hash seed with a constant is a
         # workaround for bug 1348818
         PYTHONHASHSEED=0
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
whitelist_externals = bash

[testenv:py33]
deps = -r{toxinidir}/requirements-py3.txt
       -r{toxinidir}/test-requirements-py3.txt
       nose
commands =
  nosetests --with-coverage --cover-package=keystone \
      --exclude test_ldap \
      keystone/tests/test_auth_plugin.py \
      keystone/tests/test_backend.py \
      keystone/tests/test_backend_rules.py \
      keystone/tests/test_cache_backend_mongo.py \
      keystone/tests/test_driver_hints.py \
      keystone/tests/test_hacking_checks.py \
      keystone/tests/test_injection.py \
      keystone/tests/test_matchers.py \
      keystone/tests/test_policy.py \
      keystone/tests/test_singular_plural.py \
      keystone/tests/test_sizelimit.py \
      keystone/tests/test_sql_migrate_extensions.py \
      keystone/tests/test_token_bind.py \
      keystone/tests/test_url_middleware.py \
      keystone/tests/test_utils.py \
      keystone/tests/test_validation.py \
      keystone/tests/test_v3_controller.py \
      keystone/tests/test_wsgi.py \
      keystone/tests/unit

[testenv:py34]
deps = -r{toxinidir}/requirements-py3.txt
       -r{toxinidir}/test-requirements-py3.txt
       nose
commands =
  nosetests --with-coverage --cover-package=keystone \
      --exclude test_ldap \
      keystone/tests/test_auth_plugin.py \
      keystone/tests/test_backend.py \
      keystone/tests/test_backend_rules.py \
      keystone/tests/test_cache_backend_mongo.py \
      keystone/tests/test_driver_hints.py \
      keystone/tests/test_hacking_checks.py \
      keystone/tests/test_injection.py \
      keystone/tests/test_matchers.py \
      keystone/tests/test_policy.py \
      keystone/tests/test_singular_plural.py \
      keystone/tests/test_sizelimit.py \
      keystone/tests/test_sql_migrate_extensions.py \
      keystone/tests/test_token_bind.py \
      keystone/tests/test_url_middleware.py \
      keystone/tests/test_utils.py \
      keystone/tests/test_validation.py \
      keystone/tests/test_v3_controller.py \
      keystone/tests/test_wsgi.py \
      keystone/tests/unit

[testenv:pep8]
commands =
  flake8 {posargs}
  # Run bash8 during pep8 runs to ensure violations are caught by
  # the check and gate queues
  bashate examples/pki/gen_pki.sh
  # Check that .po and .pot files are valid.
  # NOTE(jaegerandi): We search for files ending with '.po' or '.pot'.
  # The regex '.*\.pot?' does not work on OS X and we assume there are no
  # files with more than one "t" that have to be ignored.
  bash -c "find keystone -type f -regex '.*\.pot*' -print0| \
           xargs -0 -n 1 msgfmt --check-format -o /dev/null"

[tox:jenkins]
downloadcache = ~/cache/pip

[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'

[testenv:venv]
commands = {posargs}

[testenv:debug]
commands = oslo_debug_helper.sh {posargs}

[flake8]
filename= *.py,keystone-*
show-source = true

# H104  File contains nothing but comments
# H405  multi line docstring summary not separated with an empty line
# H803  Commit message should not end with a period (do not remove per list discussion)
# H904  Wrap long lines in parentheses instead of a backslash
ignore = H104,H405,H803,H904

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

[testenv:docs]
commands=
    python setup.py build_sphinx

[testenv:sample_config]
{'fraction_non_alphanumeric': 0.10807026476578412, 'fraction_numerical': 0.01591140529531568, 'mean_word_length': 3.1418028465998944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7157946', 'n_tokens_mistral': 2968, 'n_tokens_neox': 2741, 'n_words': 527}