Skip to content

Commit 27a422e

Browse files
author
Thomas Preud'homme
committed
Fix all unused imports flake8 warnings
lnt/lnttool/main.py: - ignore flask.current_app and flask.g unused import warnings since they are used through locals() below lnt/lnttool/__init__.py: - ignore main.main unused import warning since it is LNT's entry point tests/testing/cPerf.py: - ignore lnt.testing.profile.cPerf import warning since the import is used to avoid a failing test if cPerf is not available lnt/server/ui/views.py and lnt/server/ui/regression_views.py: - remove flask.redirect imports which are no longer used since cc9b7c4 lnt/server/ui/globals.py: - remove lnt.server.ui.util unused import which is no longer used since 8082454 lnt/server/ui/decorators.py: - remove flask.render_template unused import which is no longer used since f5fa093 lnt/server/db/v4db.py: - remove sqlalchemy.orm.joinedload unused import which is no longer used since d464dd2 lnt/server/db/testsuitedb.py: - remove typing.List unused import which is no longer used since b9d4622 lnt/server/db/migrations/upgrade_2_to_3.py, lnt/server/db/migrations/upgrade_7_to_8.py, lnt/server/db/migrations/upgrade_8_to_9.py and lnt/server/db/migrations/upgrade_10_to_11.py: - remove sqlalchemy.orm.relation unused import which was never needed lnt/server/db/migrations/upgrade_12_to_13.py: - remove sqlalchemy unused import which stopped being used after c6c4b5d (doh!) lnt/server/db/migrations/upgrade_14_to_15.py: - remove lnt.server.db.migrations.util.rename_table unused import which was never needed lnt/server/db/rules/rule_update_profile_stats.py: - remove datetime unused import which was never needed tests/testing/cPerf.py: - remove time, threading and json unused import which were never needed tests/server/db/search.py: - remove logging unused import which is no longer used since 48bc5fc - remove contextlib unused import which was never needed tests/server/db/CreateV4TestSuite.py: - remove sys unused import which was never needed tests/server/db/CreateV4TestSuiteInstance.py: - remove lnt.server.db.testsuite unused import which is no longer used since 7f58502 Reviewed By: cmatthews Differential Revision: https://reviews.llvm.org/D94686
1 parent 5a4cfa9 commit 27a422e

19 files changed

+8
-21
lines changed

lnt/lnttool/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from __future__ import absolute_import
2-
from .main import main
2+
from .main import main # noqa: F401 # LNT entrypoint

lnt/lnttool/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def action_runserver(instance_path, hostname, port, reloader, debugger,
6565
app.wsgi_app, stream=open(profiler_file, 'w'),
6666
profile_dir=profiler_dir)
6767
if shell:
68-
from flask import current_app
69-
from flask import g
68+
from flask import current_app # noqa: F401 # Used in locals() below
69+
from flask import g # noqa: F401 # Used in locals() below
7070
import code
7171
ctx = app.test_request_context()
7272
ctx.push()

lnt/server/db/migrations/upgrade_10_to_11.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import sqlalchemy
55
from sqlalchemy import String, Integer, Column, ForeignKey
6-
from sqlalchemy.orm import relation
76

87
# Import the original schema from upgrade_0_to_1 since upgrade_1_to_2 does not
98
# change the actual schema, but rather adds functionality vis-a-vis orders.

lnt/server/db/migrations/upgrade_12_to_13.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Adds new table to store jsonschema previously used to construct testsuite.
2-
import sqlalchemy
32
from sqlalchemy.ext.declarative import declarative_base
43
from sqlalchemy import Column, String, Binary
54

lnt/server/db/migrations/upgrade_14_to_15.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Drop the "FieldChange" tables; they have been deprecated and replaced by
22
# "FieldChangeV2" for a long while now (but can still cause trouble when trying
33
# to delete old runs that are referenced from a FieldChange entry).
4-
from lnt.server.db.migrations.util import introspect_table, rename_table
4+
from lnt.server.db.migrations.util import introspect_table
55

66

77
def update_testsuite(engine, db_key_name):

lnt/server/db/migrations/upgrade_2_to_3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import sqlalchemy
55
from sqlalchemy import Integer, Column, ForeignKey
6-
from sqlalchemy.orm import relation
76

87
# Import the original schema from upgrade_0_to_1 since upgrade_1_to_2 does not
98
# change the actual schema, but rather adds functionality vis-a-vis orders.

lnt/server/db/migrations/upgrade_7_to_8.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import sqlalchemy
55
from sqlalchemy import Float, String, Integer, Column, ForeignKey
6-
from sqlalchemy.orm import relation
76

87
# Import the original schema from upgrade_0_to_1 since upgrade_1_to_2 does not
98
# change the actual schema, but rather adds functionality vis-a-vis orders.

lnt/server/db/migrations/upgrade_8_to_9.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import sqlalchemy
55
from sqlalchemy import String, Integer, Column, DateTime
6-
from sqlalchemy.orm import relation
76

87
# Import the original schema from upgrade_0_to_1 since upgrade_1_to_2 does not
98
# change the actual schema, but rather adds functionality vis-a-vis orders.

lnt/server/db/rules/rule_update_profile_stats.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Post submission hook to write the current state of the profiles directory. This
33
gets fed into the profile/admin page.
44
"""
5-
import datetime
65
import glob
76
import json
87
import os

lnt/server/db/testsuitedb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from sqlalchemy import Float, String, Integer, Column, ForeignKey, Binary, DateTime
1818
from sqlalchemy.orm import relation
1919
from sqlalchemy.orm.exc import ObjectDeletedError
20-
from typing import List
2120
from lnt.util import logger
2221

2322
from . import testsuite

0 commit comments

Comments
 (0)