Browse Source

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
changes/94/715594/2
Andreas Jaeger 2 years ago
parent
commit
77cdf205d4
  1. 2
      coverage2sql/migrations/cli.py
  2. 1
      coverage2sql/migrations/env.py
  3. 6
      coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py
  4. 6
      coverage2sql/migrations/versions/79dead6f7c26_add_files_table.py
  5. 4
      coverage2sql/migrations/versions/8857b04071a2_add_metadata_column.py
  6. 4
      coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py
  7. 2
      test-requirements.txt
  8. 5
      tox.ini

2
coverage2sql/migrations/cli.py

@ -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())

1
coverage2sql/migrations/env.py

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

6
coverage2sql/migrations/versions/52dfb338f74e_add_coverages_table.py

@ -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():

6
coverage2sql/migrations/versions/79dead6f7c26_add_files_table.py

@ -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():

4
coverage2sql/migrations/versions/8857b04071a2_add_metadata_column.py

@ -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():

4
coverage2sql/migrations/versions/cb0e61ce633e_add_test_type_column.py

@ -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():

2
test-requirements.txt

@ -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

5
tox.ini

@ -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

Loading…
Cancel
Save