Skip to content

Commit 327e773

Browse files
authored
chore: migrate to ruff formater (#540)
Fixes #443.
1 parent 2e8dd40 commit 327e773

22 files changed

Lines changed: 100 additions & 111 deletions

.flake8

Lines changed: 0 additions & 32 deletions
This file was deleted.

google/cloud/alloydb/connector/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from google.cloud.alloydbconnector import __version__
1514
from google.cloud.alloydbconnector import AsyncConnector
1615
from google.cloud.alloydbconnector import Connector
1716
from google.cloud.alloydbconnector import IPTypes
1817
from google.cloud.alloydbconnector import RefreshStrategy
18+
from google.cloud.alloydbconnector import __version__
1919

2020
__all__ = [
2121
"__version__",

google/cloud/alloydbconnector/async_connector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
import asyncio
1818
import logging
1919
from types import TracebackType
20-
from typing import Any, Optional, TYPE_CHECKING
20+
from typing import TYPE_CHECKING
21+
from typing import Any
22+
from typing import Optional
2123

2224
import google.auth
2325
from google.auth.credentials import with_scopes_if_required
2426
import google.auth.transport.requests
25-
2627
import google.cloud.alloydbconnector.asyncpg as asyncpg
2728
from google.cloud.alloydbconnector.client import AlloyDBClient
2829
from google.cloud.alloydbconnector.enums import IPTypes
@@ -178,8 +179,7 @@ async def connect(
178179
cache = LazyRefreshCache(instance_uri, self._client, self._keys)
179180
else:
180181
logger.debug(
181-
f"['{instance_uri}']: Refresh strategy is set to background"
182-
" refresh"
182+
f"['{instance_uri}']: Refresh strategy is set to background refresh"
183183
)
184184
cache = RefreshAheadCache(instance_uri, self._client, self._keys)
185185
self._cache[instance_uri] = cache

google/cloud/alloydbconnector/asyncpg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# limitations under the License.
1414

1515
import ssl
16-
from typing import Any, TYPE_CHECKING
16+
from typing import TYPE_CHECKING
17+
from typing import Any
1718

1819
SERVER_PROXY_PORT = 5433
1920

google/cloud/alloydbconnector/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616

1717
import asyncio
1818
import logging
19-
from typing import Optional, TYPE_CHECKING
19+
from typing import TYPE_CHECKING
20+
from typing import Optional
2021

2122
from cryptography import x509
23+
2224
from google.api_core.client_options import ClientOptions
2325
from google.api_core.gapic_v1.client_info import ClientInfo
2426
from google.auth.credentials import TokenState
2527
from google.auth.transport import requests
2628
import google.cloud.alloydb_v1beta as v1beta
27-
from google.protobuf import duration_pb2
28-
2929
from google.cloud.alloydbconnector.connection_info import ConnectionInfo
3030
from google.cloud.alloydbconnector.version import __version__ as version
31+
from google.protobuf import duration_pb2
3132

3233
if TYPE_CHECKING:
3334
from google.auth.credentials import Credentials

google/cloud/alloydbconnector/connection_info.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
from dataclasses import dataclass
1818
import logging
1919
import ssl
20-
from typing import Optional, TYPE_CHECKING
20+
from typing import TYPE_CHECKING
21+
from typing import Optional
2122

2223
from aiofiles.tempfile import TemporaryDirectory
2324

google/cloud/alloydbconnector/connector.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
import struct
2525
from threading import Thread
2626
from types import TracebackType
27-
from typing import Any, Callable, Optional, TYPE_CHECKING
27+
from typing import TYPE_CHECKING
28+
from typing import Any
29+
from typing import Callable
30+
from typing import Optional
2831

2932
from google.auth import default
3033
from google.auth.credentials import TokenState
3134
from google.auth.credentials import with_scopes_if_required
3235
from google.auth.transport import requests
33-
3436
import google.cloud.alloydb_connectors_v1.proto.resources_pb2 as connectorspb
3537
from google.cloud.alloydbconnector.client import AlloyDBClient
3638
from google.cloud.alloydbconnector.enums import IPTypes
@@ -221,8 +223,7 @@ async def connect_async(self, instance_uri: str, driver: str, **kwargs: Any) ->
221223
cache = LazyRefreshCache(instance_uri, self._client, self._keys)
222224
else:
223225
logger.debug(
224-
f"['{instance_uri}']: Refresh strategy is set to background"
225-
" refresh"
226+
f"['{instance_uri}']: Refresh strategy is set to background refresh"
226227
)
227228
cache = RefreshAheadCache(instance_uri, self._client, self._keys)
228229
self._cache[instance_uri] = cache

google/cloud/alloydbconnector/instance.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ async def _perform_refresh(self) -> ConnectionInfo:
121121
self._keys,
122122
)
123123
logger.debug(
124-
f"['{self._instance_uri}']: Connection info refresh operation"
125-
" complete"
124+
f"['{self._instance_uri}']: Connection info refresh operation complete"
126125
)
127126
logger.debug(
128127
f"['{self._instance_uri}']: Current certificate expiration = "

google/cloud/alloydbconnector/lazy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ async def connect_info(self) -> ConnectionInfo:
9191
)
9292
return self._cached
9393
logger.debug(
94-
f"['{self._instance_uri}']: Connection info "
95-
"refresh operation started"
94+
f"['{self._instance_uri}']: Connection info refresh operation started"
9695
)
9796
try:
9897
conn_info = await self._client.get_connection_info(

google/cloud/alloydbconnector/pg8000.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from typing import Any, TYPE_CHECKING
14+
from typing import TYPE_CHECKING
15+
from typing import Any
1516

1617
if TYPE_CHECKING:
1718
import ssl

0 commit comments

Comments
 (0)