Files
distcloud/distributedcloud/tox.ini
Hugo Brito 30df79b36a Apply black formatter to dcmanager/orchestrator
This commit applies the Black format to the `dcmanager/orchestrator`
files to ensure that it adheres to the Black code style guidelines.

Test Plan:
PASS: Success in stx-distcloud-tox-black

Story: 2011149
Task: 50444

Change-Id: I89cd3c661eb783468fa486e685c7f2aec6a56f0f
Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
2024-07-29 21:25:33 -03:00

106 lines
3.0 KiB
INI

[tox]
envlist = py39,pep8,pylint,black
minversion = 4.4.0
skipsdist = True
# move tox work directory out of the source tree
toxworkdir = /tmp/{env:USER}_dctox
[dc]
stx_config_dir = ../../config
stx_fault_dir = ../../fault
cgcs_patch_src_dir = ../../update/sw-patch/cgcs-patch
cgtsclient_src_dir = {[dc]stx_config_dir}/sysinv/cgts-client/cgts-client
fmclient_src_dir = {[dc]stx_fault_dir}/python-fmclient/fmclient
fm_api_src_dir = {[dc]stx_fault_dir}/fm-api/source
nfv_client_src_dir = ../../nfv/nfv/nfv-client
tsconfig_src_dir = {[dc]stx_config_dir}/tsconfig/tsconfig
[testenv]
basepython = python3.9
sitepackages = False
setenv =
VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
CURRENT_CFG_FILE={toxinidir}/.current.cfg
SINGLE_REPO=True
OSLO_LOCK_PATH={toxinidir}
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[dc]cgcs_patch_src_dir}
-e{[dc]cgtsclient_src_dir}
-e{[dc]fmclient_src_dir}
-e{[dc]fm_api_src_dir}
-e{[dc]nfv_client_src_dir}
-e{[dc]tsconfig_src_dir}
allowlist_externals =
rm
find
[testenv:py39]
commands =
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8
[testenv:cover]
commands =
coverage erase
rm -Rf cover
rm -f coverage.xml
find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
python setup.py testr --coverage --testr-args='{posargs}'
coverage html -d cover
coverage xml --rcfile=.coveragerc_xml
coverage report
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
show-source = True
max-line-length = 88
# Suppressed flake8 codes
# E203 whitespace before ':'; conflict with Black
# E731 do not assign a lambda expression, use a def
# H301 one import per line; conflict with Black
# W503 line break before binary operator; conflict with Black
# W504 line break after binary operator
# W605 invalid escape sequence
ignore = E203,E731,H301,W503,W504,W605
builtins = _
[testenv:genconfig]
commands =
oslo-config-generator --config-file=tools/config-generator.conf
[hacking]
import_exceptions = dcmanager.common.i18n,dcorch.common.i18n
[testenv:pylint]
setenv =
{[testenv]setenv}
PYTHONPATH = {toxinidir}
commands =
pylint {posargs} dccommon dcdbsync dcmanager dcorch dcagent --rcfile=./.pylintrc
[testenv:black]
# This environment checks and displays the recommended changes by Black for formatting
# Python files.
# To apply the format in a specific file, use the following command: black <file_path>
deps =
black>=23.11.0 # MIT
# Note: After all files being formatted by Black, the following command should be used
# as default for the black environment and run_black.py script should be deleted.
; commands =
; black --check --diff .
commands =
python run_black.py