Skip to content

Commit 908d418

Browse files
Lint fixes
1 parent 8dc719d commit 908d418

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/unstructured_client/_hooks/custom/auth_header_hook.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import httpx
1818

1919
from unstructured_client._hooks.types import BeforeRequestContext, BeforeRequestHook
20+
from unstructured_client.auth._base import _ExchangeCallableBase
2021

2122

2223
class AuthHeaderBeforeRequestHook(BeforeRequestHook):
@@ -43,11 +44,8 @@ def _is_exchange_callable(security_source: object) -> bool:
4344
token-exchange callables.
4445
4546
The SDK wraps a user-supplied callable into an internal factory and
46-
attaches ``__wrapped_callable__`` to it (see ``sdk.py``). We import
47-
the base class lazily to avoid any cycle at module load.
47+
attaches ``__wrapped_callable__`` to it (see ``sdk.py``).
4848
"""
49-
from unstructured_client.auth._base import _ExchangeCallableBase
50-
5149
if security_source is None:
5250
return False
5351

src/unstructured_client/auth/_base.py

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

1717
from __future__ import annotations
1818

19-
import asyncio
2019
import logging
2120
import random
2221
import threading

src/unstructured_client/auth/client_credentials.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
from __future__ import annotations
2020

2121
import asyncio
22+
import concurrent.futures
2223
import time
2324
from typing import Any, Dict, Optional
2425

2526
import httpx
2627

2728
from ._base import _ExchangeCallableBase
28-
from ._exceptions import InvalidCredentialError, TokenExchangeError
29+
from ._exceptions import TokenExchangeError
2930

3031

3132
class ClientCredentials(_ExchangeCallableBase):
@@ -254,14 +255,12 @@ def __call__(self) -> str:
254255
temporary loop via :func:`asyncio.run`.
255256
"""
256257
try:
257-
loop = asyncio.get_running_loop()
258+
asyncio.get_running_loop()
258259
except RuntimeError:
259260
return asyncio.run(self.acquire())
260261

261262
# Inside a running loop - offload to a worker thread that drives its
262263
# own event loop so we don't block the caller's loop on httpx IO.
263-
import concurrent.futures
264-
265264
def _run_in_new_loop() -> str:
266265
return asyncio.run(self.acquire())
267266

0 commit comments

Comments
 (0)