Skip to content

Commit 8fed2d7

Browse files
committed
fix lint issues, run and pin isort < 5
1 parent 0abeca2 commit 8fed2d7

7 files changed

Lines changed: 9 additions & 7 deletions

File tree

python/sqlcommenter-python/google/cloud/sqlcommenter/psycopg2/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
from google.cloud.sqlcommenter.opencensus import get_opencensus_values
2424
from google.cloud.sqlcommenter.opentelemetry import get_opentelemetry_values
2525

26-
2726
logger = logging.getLogger(__name__)
2827

28+
2929
# This integration extends psycopg2.extensions.cursor
3030
# by implementing a custom execute method.
3131
#

python/sqlcommenter-python/google/cloud/sqlcommenter/sqlalchemy/executor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# This integration implements the before_cursor_execute hook factory as per:
1818
# https://kite.com/python/docs/sqlalchemy.events.ConnectionEvents.before_execute
1919
from __future__ import absolute_import
20+
2021
import logging
2122

2223
import sqlalchemy
@@ -25,9 +26,9 @@
2526
from google.cloud.sqlcommenter.opencensus import get_opencensus_values
2627
from google.cloud.sqlcommenter.opentelemetry import get_opentelemetry_values
2728

28-
2929
logger = logging.getLogger(__name__)
3030

31+
3132
def BeforeExecuteFactory(
3233
with_framework=True, with_controller=True, with_route=True,
3334
with_opencensus=False, with_opentelemetry=False, with_db_driver=False,

python/sqlcommenter-python/setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818

1919
from setuptools import find_packages, setup
2020

21+
2122
def read_file(filename):
2223
with open(os.path.join(os.path.dirname(__file__), filename)) as file:
2324
return file.read()
2425

26+
2527
setup(
2628
name='google-cloud-sqlcommenter',
2729
version='1.0.0',

python/sqlcommenter-python/tests/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ def skipIfPy2(testcase):
3030
sys.version_info.major == 2, "Feature only support in python3+"
3131
)(testcase)
3232

33-
__all__ = ["mock"]
3433

34+
__all__ = ["mock"]

python/sqlcommenter-python/tests/psycopg2/tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_opentelemetry(self):
8888
"tracestate='some_key%%3Dsome_value'*/",
8989
with_opentelemetry=True,
9090
)
91-
91+
9292
def test_both_opentelemetry_and_opencensus_warn(self):
9393
with mock.patch(
9494
"google.cloud.sqlcommenter.psycopg2.extension.logger"
@@ -101,6 +101,7 @@ def test_both_opentelemetry_and_opencensus_warn(self):
101101
)
102102
self.assertEqual(len(logger_mock.warning.mock_calls), 1)
103103

104+
104105
class FlaskTests(Psycopg2TestCase):
105106
flask_info = {
106107
'framework': 'flask',

python/sqlcommenter-python/tests/sqlalchemy/tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# limitations under the License.
1616

1717
from unittest import TestCase
18-
from unittest.case import skip, skipIf
1918

2019
import sqlalchemy
2120
from google.cloud.sqlcommenter.sqlalchemy.executor import BeforeExecuteFactory
@@ -127,4 +126,3 @@ def test_route_disabled(self, get_info):
127126
"SELECT 1; /*controller='c',framework='flask'*/",
128127
with_route=False,
129128
)
130-

python/sqlcommenter-python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ commands =
2828
skip_install = True
2929
deps =
3030
flake8
31-
isort
31+
isort < 5
3232
commands =
3333
flake8
3434
isort --recursive --check-only --diff

0 commit comments

Comments
 (0)