Skip to content

Commit 8143c17

Browse files
committed
Fix type annotations
1 parent 3ce2f56 commit 8143c17

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/fastapi_cloud_cli/utils/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import logging
22
import time
3-
from contextlib import AbstractContextManager, contextmanager
3+
from contextlib import contextmanager
44
from datetime import timedelta
55
from enum import Enum
6-
from typing import Generator, Optional
6+
from typing import ContextManager, Generator, Optional
77

88
import httpx
99
from pydantic import BaseModel, ValidationError
@@ -31,8 +31,8 @@ class BuildLogType(str, Enum):
3131

3232
class BuildLogLine(BaseModel):
3333
type: BuildLogType
34-
message: str | None = None
35-
id: str | None = None
34+
message: Optional[str] = None
35+
id: Optional[str] = None
3636

3737

3838
@contextmanager
@@ -79,7 +79,7 @@ def _backoff() -> None:
7979

8080
def attempts(
8181
total_attempts: int = 3, timeout: timedelta = timedelta(minutes=5)
82-
) -> Generator[AbstractContextManager[None], None, None]:
82+
) -> Generator[ContextManager[None], None, None]:
8383
start = time.monotonic()
8484

8585
for attempt_number in range(total_attempts):

tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def changing_dir(directory: Union[str, Path]) -> Generator[None, None, None]:
1616
os.chdir(initial_dir)
1717

1818

19-
def build_logs_response(*logs: dict[str, Any]) -> str:
19+
def build_logs_response(*logs: Dict[str, Any]) -> str:
2020
"""Helper to create NDJSON build logs response."""
2121
return "\n".join(json.dumps(log) for log in logs)
2222

0 commit comments

Comments
 (0)