Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 312f5ad

Browse files
committed
fix lint
1 parent c589d74 commit 312f5ad

File tree

2 files changed

+31
-33
lines changed

2 files changed

+31
-33
lines changed

google/auth/aio/transport/aiohttp.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
import asyncio
1818
import logging
19-
import typing
20-
from typing import Any, AsyncGenerator, Mapping, Optional, Union
19+
from typing import Any, AsyncGenerator, Mapping, Optional, TYPE_CHECKING, Union
2120

2221
try:
2322
import aiohttp # type: ignore
@@ -26,7 +25,12 @@
2625
"The aiohttp library is not installed from please install the aiohttp package to use the aiohttp transport."
2726
) from caught_exc
2827

29-
if typing.TYPE_CHECKING:
28+
from google.auth import _helpers
29+
from google.auth import exceptions
30+
from google.auth.aio import _helpers as _helpers_async
31+
from google.auth.aio import transport
32+
33+
if TYPE_CHECKING: # pragma: NO COVER
3034
from aiohttp import ClientTimeout # type: ignore
3135

3236
else:
@@ -36,11 +40,6 @@
3640
except ImportError:
3741
ClientTimeout = None
3842

39-
from google.auth import _helpers
40-
from google.auth import exceptions
41-
from google.auth.aio import _helpers as _helpers_async
42-
from google.auth.aio import transport
43-
4443
_LOGGER = logging.getLogger(__name__)
4544

4645

google/auth/aio/transport/sessions.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,14 @@
1616
from contextlib import asynccontextmanager
1717
import functools
1818
import time
19-
import typing
20-
from typing import Any, Mapping, Optional, Union
19+
from typing import Any, Mapping, Optional, TYPE_CHECKING, Union
2120

2221
from google.auth import _exponential_backoff, exceptions
2322
from google.auth.aio import transport
2423
from google.auth.aio.credentials import Credentials
2524
from google.auth.exceptions import TimeoutError
2625

27-
try:
28-
from google.auth.aio.transport.aiohttp import Request as AiohttpRequest
29-
30-
AIOHTTP_INSTALLED = True
31-
except ImportError: # pragma: NO COVER
32-
AIOHTTP_INSTALLED = False
33-
34-
if typing.TYPE_CHECKING:
26+
if TYPE_CHECKING: # pragma: NO COVER
3527
from aiohttp import ClientTimeout # type: ignore
3628

3729
else:
@@ -41,6 +33,13 @@
4133
except ImportError:
4234
ClientTimeout = None
4335

36+
try:
37+
from google.auth.aio.transport.aiohttp import Request as AiohttpRequest
38+
39+
AIOHTTP_INSTALLED = True
40+
except ImportError: # pragma: NO COVER
41+
AIOHTTP_INSTALLED = False
42+
4443

4544
@asynccontextmanager
4645
async def timeout_guard(timeout):
@@ -221,14 +220,14 @@ async def get(
221220
url (str): The URI to be requested.
222221
data (Optional[bytes]): The payload or body in HTTP request.
223222
headers (Optional[Mapping[str, str]]): Request headers.
224-
timeout (float, aiohttp.ClientTimeout):
225-
The amount of time in seconds to wait for the server response
226-
with each individual request.
227223
max_allowed_time (float):
228224
If the method runs longer than this, a ``Timeout`` exception is
229225
automatically raised. Unlike the ``timeout`` parameter, this
230226
value applies to the total method execution time, even if
231227
multiple requests are made under the hood.
228+
timeout (float, aiohttp.ClientTimeout):
229+
The amount of time in seconds to wait for the server response
230+
with each individual request.
232231
total_attempts (int):
233232
The total number of retry attempts.
234233
@@ -274,14 +273,14 @@ async def post(
274273
url (str): The URI to be requested.
275274
data (Optional[bytes]): The payload or body in HTTP request.
276275
headers (Optional[Mapping[str, str]]): Request headers.
277-
timeout (float, aiohttp.ClientTimeout):
278-
The amount of time in seconds to wait for the server response
279-
with each individual request.
280276
max_allowed_time (float):
281277
If the method runs longer than this, a ``Timeout`` exception is
282278
automatically raised. Unlike the ``timeout`` parameter, this
283279
value applies to the total method execution time, even if
284280
multiple requests are made under the hood.
281+
timeout (float, aiohttp.ClientTimeout):
282+
The amount of time in seconds to wait for the server response
283+
with each individual request.
285284
total_attempts (int):
286285
The total number of retry attempts.
287286
@@ -327,14 +326,14 @@ async def put(
327326
url (str): The URI to be requested.
328327
data (Optional[bytes]): The payload or body in HTTP request.
329328
headers (Optional[Mapping[str, str]]): Request headers.
330-
timeout (float, aiohttp.ClientTimeout):
331-
The amount of time in seconds to wait for the server response
332-
with each individual request.
333329
max_allowed_time (float):
334330
If the method runs longer than this, a ``Timeout`` exception is
335331
automatically raised. Unlike the ``timeout`` parameter, this
336332
value applies to the total method execution time, even if
337333
multiple requests are made under the hood.
334+
timeout (float, aiohttp.ClientTimeout):
335+
The amount of time in seconds to wait for the server response
336+
with each individual request.
338337
total_attempts (int):
339338
The total number of retry attempts.
340339
@@ -380,14 +379,14 @@ async def patch(
380379
url (str): The URI to be requested.
381380
data (Optional[bytes]): The payload or body in HTTP request.
382381
headers (Optional[Mapping[str, str]]): Request headers.
383-
timeout (float, aiohttp.ClientTimeout):
384-
The amount of time in seconds to wait for the server response
385-
with each individual request.
386382
max_allowed_time (float):
387383
If the method runs longer than this, a ``Timeout`` exception is
388384
automatically raised. Unlike the ``timeout`` parameter, this
389385
value applies to the total method execution time, even if
390386
multiple requests are made under the hood.
387+
timeout (float, aiohttp.ClientTimeout):
388+
The amount of time in seconds to wait for the server response
389+
with each individual request.
391390
total_attempts (int):
392391
The total number of retry attempts.
393392
@@ -433,14 +432,14 @@ async def delete(
433432
url (str): The URI to be requested.
434433
data (Optional[bytes]): The payload or body in HTTP request.
435434
headers (Optional[Mapping[str, str]]): Request headers.
436-
timeout (float, aiohttp.ClientTimeout):
437-
The amount of time in seconds to wait for the server response
438-
with each individual request.
439435
max_allowed_time (float):
440436
If the method runs longer than this, a ``Timeout`` exception is
441437
automatically raised. Unlike the ``timeout`` parameter, this
442438
value applies to the total method execution time, even if
443439
multiple requests are made under the hood.
440+
timeout (float, aiohttp.ClientTimeout):
441+
The amount of time in seconds to wait for the server response
442+
with each individual request.
444443
total_attempts (int):
445444
The total number of retry attempts.
446445

0 commit comments

Comments
 (0)