Skip to content

Commit 0be71e3

Browse files
committed
typecheck: fix asynccontextmanager return annotations
Signed-off-by: phernandez <[email protected]>
1 parent dbe7ceb commit 0be71e3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/basic_memory/cli/auth.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import time
99
import webbrowser
1010
from contextlib import asynccontextmanager
11-
from typing import AsyncContextManager, Callable
11+
from collections.abc import AsyncIterator, Callable
12+
from typing import AsyncContextManager
1213

1314
import httpx
1415
from rich.console import Console
@@ -38,7 +39,7 @@ def __init__(
3839
self._http_client_factory = http_client_factory
3940

4041
@asynccontextmanager
41-
async def _get_http_client(self) -> AsyncContextManager[httpx.AsyncClient]:
42+
async def _get_http_client(self) -> AsyncIterator[httpx.AsyncClient]:
4243
"""Create an AsyncClient, optionally via injected factory.
4344
4445
Why: enables reliable tests without monkeypatching httpx internals while

src/basic_memory/cli/commands/cloud/api_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Cloud API client utilities."""
22

3+
from collections.abc import AsyncIterator
34
from typing import Optional
45
from contextlib import asynccontextmanager
56
from typing import AsyncContextManager, Callable
@@ -58,7 +59,7 @@ async def get_authenticated_headers(auth: CLIAuth | None = None) -> dict[str, st
5859

5960

6061
@asynccontextmanager
61-
async def _default_http_client(timeout: float) -> AsyncContextManager[httpx.AsyncClient]:
62+
async def _default_http_client(timeout: float) -> AsyncIterator[httpx.AsyncClient]:
6263
async with httpx.AsyncClient(timeout=timeout) as client:
6364
yield client
6465

0 commit comments

Comments
 (0)