Use pre-commit for 'pep8' tox target

This avoids some duplication.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Id3fb0770ce128b34777418da3d33cc63a61c06ea
This commit is contained in:
Stephen Finucane 2023-06-01 12:22:24 +01:00 committed by Goutham Pacha Ravi
parent a675490108
commit b1c45a720e
2 changed files with 4 additions and 26 deletions

View File

@ -1,11 +1,5 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# hacking should be first
hacking>=3.1.0,<3.2.0 # Apache-2.0
bashate>=0.5.1 # Apache-2.0
coverage>=5.2.1 # Apache-2.0
ddt>=1.4.1 # MIT
fixtures>=3.0.0 # Apache-2.0/BSD

24
tox.ini
View File

@ -35,7 +35,7 @@ allowlist_externals = rm
[testenv:newnote]
allowlist_externals = reno
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = reno new {posargs}
@ -43,27 +43,13 @@ commands = reno new {posargs}
commands = oslo_debug_helper {posargs}
[testenv:pep8]
deps =
pre-commit
allowlist_externals =
{toxinidir}/tools/check_exec.py
{toxinidir}/tools/check_logging.sh
# Let's gate pep8 under py3 by default because the py3 checks are stricter.
commands =
flake8 {posargs}
# Run bashate during pep8 runs to ensure violations are caught by
# the check and gate queues.
bashate -i E006,E042,E043 \
tools/enable-pre-commit-hook.sh \
contrib/ci/pre_test_hook.sh \
contrib/ci/post_test_hook.sh \
devstack/plugin.sh \
devstack/upgrade/from-mitaka/upgrade-manila \
devstack/upgrade/resources.sh \
devstack/upgrade/shutdown.sh \
devstack/upgrade/upgrade.sh \
tools/cover.sh \
tools/check_logging.sh \
tools/coding-checks.sh
pre-commit run --all-files --show-diff-on-failure
{toxinidir}/tools/check_exec.py {toxinidir}/manila
{toxinidir}/tools/check_logging.sh {toxinidir}/manila
@ -89,8 +75,6 @@ deps =
commands =
rm -rf doc/build
sphinx-build -W -b html doc/source doc/build/html
# Ignore D001 since we allow lines in excess of 79 characters.
doc8 --ignore D001 --ignore-path .tox --ignore-path doc/build --ignore-path manila.egg-info -e .txt -e .rst -e .inc
allowlist_externals = rm
[testenv:pdf-docs]