<commit_before>[tox]
minversion = 2.3
envlist = py35,py27,pep8
skipdist = True

[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
         OS_STDOUT_CAPTURE=1
         OS_STDERR_CAPTURE=1
         OS_TEST_TIMEOUT=60
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
commands = stestr run {posargs}
whitelist_externals = stestr

[testenv:fast8]
# Use same environment directory as pep8 env to save space and install time
envdir = {toxworkdir}/pep8
commands =
  {toxinidir}/tools/fast8.sh

[testenv:pep8]
commands =
    flake8
    bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101

[testenv:bandit]
# This command runs the bandit security linter against the openstackclient
# codebase minus the tests directory. Some tests are being excluded to
# reduce the number of positives before a team inspection, and to ensure a
# passing gate job for initial addition. The excluded tests are:
# B105-B107: hardcoded password checks - likely to generate false positives
#            in a gate environment
# B401: import subprocess - not necessarily a security issue; this plugin is
#       mainly used for penetration testing workflow
# B603,B606: process without shell - not necessarily a security issue; this
#            plugin is mainly used for penetration testing workflow
# B607: start process with a partial path - this should be a project level
#       decision
# NOTE(elmiko): The following tests are being excluded specifically for
# python-openstackclient, they are being excluded to ensure that voting jobs
# in the project and in bandit integration tests continue to pass. These
# tests have generated issue within the project and should be investigated
# by the project.
# B110: try, except, pass detected - possible security issue; this should be
#       investigated by the project for possible exploitation
# B605: process with a shell - possible security issue; this should be
#       investigated by the project for possible exploitation
# B101: use of assert - this code will be removed when compiling to optimized
#       byte code
commands =
    bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101

[testenv:unit-tips]
commands =
    pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
    pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
    pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
    pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
    pip install -q -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk"
    pip freeze
    stestr run {posargs}
whitelist_externals = stestr

[testenv:functional]
setenv = OS_TEST_PATH=./openstackclient/tests/functional
passenv = OS_*
whitelist_externals = openstackclient/tests/functional/run_stestr.sh
commands =
    {toxinidir}/openstackclient/tests/functional/run_stestr.sh {posargs}

[testenv:functional-tips]
setenv = OS_TEST_PATH=./openstackclient/tests/functional
passenv = OS_*
whitelist_externals = openstackclient/tests/functional/run_stestr.sh
commands =
    pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
    pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
    pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
    pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
    pip install -q -U -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk"
    pip freeze
    {toxinidir}/openstackclient/tests/functional/run_stestr.sh {posargs}

[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv =
    VIRTUAL_ENV={envdir}
    PYTHON=coverage run --source openstackclient --parallel-mode
commands =
    stestr -q run {posargs}
    coverage combine
    coverage html -d cover
    coverage xml -o cover/coverage.xml

[testenv:debug]
passenv = OS_*
commands =
    oslo_debug_helper -t openstackclient/tests {posargs}

[testenv:docs]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  sphinx-build -b html doc/source doc/build/html

[testenv:releasenotes]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[flake8]
show-source = True
# H203: Use assertIs(Not)None to check for None
enable-extensions = H203
exclude = .git,.tox,dist,doc,*lib/python*,*egg,build,tools
# If 'ignore' is not set there are default errors and warnings that are set
# Doc: http://flake8.readthedocs.org/en/latest/config.html#default
ignore = __
import-order-style = pep8
application_import_names = openstackclient
<commit_msg>Partially Revert "Update new documentation PTI jobs"<commit_after>[tox]
minversion = 2.3
envlist = py35,py27,pep8
skipdist = True

[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
         OS_STDOUT_CAPTURE=1
         OS_STDERR_CAPTURE=1
         OS_TEST_TIMEOUT=60
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
commands = stestr run {posargs}
whitelist_externals = stestr

[testenv:fast8]
# Use same environment directory as pep8 env to save space and install time
envdir = {toxworkdir}/pep8
commands =
  {toxinidir}/tools/fast8.sh

[testenv:pep8]
commands =
    flake8
    bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101

[testenv:bandit]
# This command runs the bandit security linter against the openstackclient
# codebase minus the tests directory. Some tests are being excluded to
# reduce the number of positives before a team inspection, and to ensure a
# passing gate job for initial addition. The excluded tests are:
# B105-B107: hardcoded password checks - likely to generate false positives
#            in a gate environment
# B401: import subprocess - not necessarily a security issue; this plugin is
#       mainly used for penetration testing workflow
# B603,B606: process without shell - not necessarily a security issue; this
#            plugin is mainly used for penetration testing workflow
# B607: start process with a partial path - this should be a project level
#       decision
# NOTE(elmiko): The following tests are being excluded specifically for
# python-openstackclient, they are being excluded to ensure that voting jobs
# in the project and in bandit integration tests continue to pass. These
# tests have generated issue within the project and should be investigated
# by the project.
# B110: try, except, pass detected - possible security issue; this should be
#       investigated by the project for possible exploitation
# B605: process with a shell - possible security issue; this should be
#       investigated by the project for possible exploitation
# B101: use of assert - this code will be removed when compiling to optimized
#       byte code
commands =
    bandit -r openstackclient -x tests -s B105,B106,B107,B401,B404,B603,B606,B607,B110,B605,B101

[testenv:unit-tips]
commands =
    pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
    pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
    pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
    pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
    pip install -q -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk"
    pip freeze
    stestr run {posargs}
whitelist_externals = stestr

[testenv:functional]
setenv = OS_TEST_PATH=./openstackclient/tests/functional
passenv = OS_*
whitelist_externals = openstackclient/tests/functional/run_stestr.sh
commands =
    {toxinidir}/openstackclient/tests/functional/run_stestr.sh {posargs}

[testenv:functional-tips]
setenv = OS_TEST_PATH=./openstackclient/tests/functional
passenv = OS_*
whitelist_externals = openstackclient/tests/functional/run_stestr.sh
commands =
    pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff"
    pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth"
    pip install -q -U -e "git+file://{toxinidir}/../osc-lib#egg=osc_lib"
    pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config"
    pip install -q -U -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk"
    pip freeze
    {toxinidir}/openstackclient/tests/functional/run_stestr.sh {posargs}

[testenv:venv]
commands = {posargs}

[testenv:cover]
setenv =
    VIRTUAL_ENV={envdir}
    PYTHON=coverage run --source openstackclient --parallel-mode
commands =
    stestr -q run {posargs}
    coverage combine
    coverage html -d cover
    coverage xml -o cover/coverage.xml

[testenv:debug]
passenv = OS_*
commands =
    oslo_debug_helper -t openstackclient/tests {posargs}

[testenv:docs]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands = python setup.py build_sphinx

[testenv:releasenotes]
deps =
  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/doc/requirements.txt
commands =
  sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[flake8]
show-source = True
# H203: Use assertIs(Not)None to check for None
enable-extensions = H203
exclude = .git,.tox,dist,doc,*lib/python*,*egg,build,tools
# If 'ignore' is not set there are default errors and warnings that are set
# Doc: http://flake8.readthedocs.org/en/latest/config.html#default
ignore = __
import-order-style = pep8
application_import_names = openstackclient

{'fraction_non_alphanumeric': 0.10817561725429917, 'fraction_numerical': 0.022864828513786146, 'mean_word_length': 4.244332493702771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '5635405', 'n_tokens_mistral': 3741, 'n_tokens_neox': 3499, 'n_words': 914}