Update hacking for Python3

The repo is Python 3 now, so update hacking to version 2.0 which
supports Python 3.

fix issues found by flake8.

Change-Id: I2f14cb6f67a0c9b4c0dcbf8d93c26eb99b9b9d33
This commit is contained in:
Andreas Jaeger 2020-03-28 08:29:02 +01:00
parent 157f0c0ae7
commit 77cdf205d4
8 changed files with 17 additions and 13 deletions

View File

@ -164,6 +164,7 @@ def add_command_parsers(subparsers):
"expiration point")
parser.set_defaults(func=expire_old)
command_opt = cfg.SubCommandOpt('command',
title='Command',
help='Available commands',
@ -183,5 +184,6 @@ def main():
db_api.get_session()
CONF.command.func(config, CONF.command.name)
if __name__ == "__main__":
sys.exit(main())

View File

@ -85,6 +85,7 @@ def run_migrations_online():
with context.begin_transaction():
context.run_migrations()
if context.is_offline_mode():
run_migrations_offline()
else:

View File

@ -27,9 +27,9 @@ down_revision = None
branch_labels = None
depends_on = None
from alembic import context
from alembic import op
import sqlalchemy as sa
from alembic import context # noqa: E402
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

View File

@ -27,9 +27,9 @@ down_revision = 'cb0e61ce633e'
branch_labels = None
depends_on = None
from alembic import context
from alembic import op
import sqlalchemy as sa
from alembic import context # noqa: E402
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

View File

@ -25,8 +25,8 @@ down_revision = '79dead6f7c26'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

View File

@ -27,8 +27,8 @@ down_revision = '52dfb338f74e'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.11,>=0.10.0
hacking>=2.0,<2.1 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
python-subunit>=0.0.18 # Apache-2.0/BSD

View File

@ -68,9 +68,10 @@ commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenote
# E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126
# E129 skipped because it is too limiting when combined with other rules
# E711 skipped because sqlalchemy filter() requires using == instead of is
# W503 line break before binary operator
# W504 line break after binary operator
show-source = True
ignore = E123,E125,E129,E711
ignore = E123,E125,E129,E711,W503,W504
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,releasenotes