Skip to content

Commit 28a6544

Browse files
committed
🔧 Drop support for Python 3.8
1 parent f15bfd8 commit 28a6544

14 files changed

Lines changed: 181 additions & 1012 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ jobs:
2525
test:
2626
strategy:
2727
matrix:
28-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
28+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
2929
pydantic-version: ["v2"]
3030
include:
31-
- python-version: "3.8"
32-
pydantic-version: "v1"
3331
- python-version: "3.9"
3432
pydantic-version: "v1"
3533
- python-version: "3.10"

‎.python-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8
1+
3.9

‎pyproject.toml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "fastapi-cloud-cli"
33
dynamic = ["version"]
44
description = "Deploy and manage FastAPI Cloud apps from the command line 🚀"
55
authors = [{ name = "Patrick Arminio", email = "patrick@fastapilabs.com" }]
6-
requires-python = ">=3.8"
6+
requires-python = ">=3.9"
77
readme = "README.md"
88
license = { text = "MIT" }
99
classifiers = [
@@ -22,7 +22,6 @@ classifiers = [
2222
"Intended Audience :: Developers",
2323
"License :: OSI Approved :: MIT License",
2424
"Programming Language :: Python :: 3 :: Only",
25-
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
2827
"Programming Language :: Python :: 3.11",

‎src/fastapi_cloud_cli/commands/deploy.py‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from itertools import cycle
88
from pathlib import Path
99
from textwrap import dedent
10-
from typing import Any, Dict, List, Optional, Union
10+
from typing import Annotated, Any, Optional, Union
1111

1212
import fastar
1313
import rignore
@@ -17,7 +17,6 @@
1717
from rich.text import Text
1818
from rich_toolkit import RichToolkit
1919
from rich_toolkit.menu import Option
20-
from typing_extensions import Annotated
2120

2221
from fastapi_cloud_cli.commands.login import login
2322
from fastapi_cloud_cli.utils.api import APIClient, BuildLogError, TooManyRetriesError
@@ -102,7 +101,7 @@ class Team(BaseModel):
102101
name: str
103102

104103

105-
def _get_teams() -> List[Team]:
104+
def _get_teams() -> list[Team]:
106105
with APIClient() as client:
107106
response = client.get("/teams/")
108107
response.raise_for_status()
@@ -184,7 +183,7 @@ def _create_deployment(app_id: str) -> CreateDeploymentResponse:
184183

185184
class RequestUploadResponse(BaseModel):
186185
url: str
187-
fields: Dict[str, str]
186+
fields: dict[str, str]
188187

189188

190189
def _upload_deployment(deployment_id: str, archive_path: Path) -> None:
@@ -242,7 +241,7 @@ def _get_app(app_slug: str) -> Optional[AppResponse]:
242241
return model_validate(AppResponse, data)
243242

244243

245-
def _get_apps(team_id: str) -> List[AppResponse]:
244+
def _get_apps(team_id: str) -> list[AppResponse]:
246245
with APIClient() as client:
247246
response = client.get("/apps/", params={"team_id": team_id})
248247
response.raise_for_status()
@@ -363,9 +362,12 @@ def _wait_for_deployment(
363362

364363
last_message_changed_at = time.monotonic()
365364

366-
with toolkit.progress(
367-
next(messages), inline_logs=True, lines_to_show=20
368-
) as progress, APIClient() as client:
365+
with (
366+
toolkit.progress(
367+
next(messages), inline_logs=True, lines_to_show=20
368+
) as progress,
369+
APIClient() as client,
370+
):
369371
try:
370372
for log in client.stream_build_logs(deployment.id):
371373
time_elapsed = time.monotonic() - started_at
@@ -609,9 +611,10 @@ def deploy(
609611
archive_path = Path(temp_dir) / "archive.tar"
610612
archive(path or Path.cwd(), archive_path)
611613

612-
with toolkit.progress(
613-
title="Creating deployment"
614-
) as progress, handle_http_errors(progress):
614+
with (
615+
toolkit.progress(title="Creating deployment") as progress,
616+
handle_http_errors(progress),
617+
):
615618
logger.debug("Creating deployment for app: %s", app.id)
616619
deployment = _create_deployment(app.id)
617620

‎src/fastapi_cloud_cli/commands/env.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import logging
22
from pathlib import Path
3-
from typing import Any, List, Union
3+
from typing import Annotated, Any, Union
44

55
import typer
66
from pydantic import BaseModel
7-
from typing_extensions import Annotated
87

98
from fastapi_cloud_cli.utils.api import APIClient
109
from fastapi_cloud_cli.utils.apps import get_app_config
@@ -22,7 +21,7 @@ class EnvironmentVariable(BaseModel):
2221

2322

2423
class EnvironmentVariableResponse(BaseModel):
25-
data: List[EnvironmentVariable]
24+
data: list[EnvironmentVariable]
2625

2726

2827
def _get_environment_variables(app_id: str) -> EnvironmentVariableResponse:

‎src/fastapi_cloud_cli/utils/api.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import json
22
import logging
33
import time
4+
from collections.abc import Generator
45
from contextlib import contextmanager
56
from datetime import timedelta
67
from functools import wraps
78
from typing import (
9+
Annotated,
810
Callable,
9-
Generator,
1011
Literal,
1112
Optional,
1213
TypeVar,
@@ -15,7 +16,7 @@
1516

1617
import httpx
1718
from pydantic import BaseModel, Field, ValidationError
18-
from typing_extensions import Annotated, ParamSpec
19+
from typing_extensions import ParamSpec
1920

2021
from fastapi_cloud_cli import __version__
2122
from fastapi_cloud_cli.config import Settings

‎src/fastapi_cloud_cli/utils/cli.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import contextlib
22
import logging
3-
from typing import Any, Dict, Generator, List, Optional, Tuple
3+
from collections.abc import Generator
4+
from typing import Any, Optional
45

56
import typer
67
from httpx import HTTPError, HTTPStatusError, ReadTimeout
@@ -18,10 +19,10 @@ def __init__(self, tag_width: int = 11):
1819

1920
def _get_tag_segments(
2021
self,
21-
metadata: Dict[str, Any],
22+
metadata: dict[str, Any],
2223
is_animated: bool = False,
2324
done: bool = False,
24-
) -> Tuple[List[Segment], int]:
25+
) -> tuple[list[Segment], int]:
2526
if not is_animated:
2627
return super()._get_tag_segments(metadata, is_animated, done)
2728

‎src/fastapi_cloud_cli/utils/pydantic_compat.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Dict, Generic, Type, TypeVar
1+
from typing import Any, Generic, TypeVar
22

33
from pydantic import BaseModel
44
from pydantic.version import VERSION as PYDANTIC_VERSION
@@ -11,21 +11,21 @@
1111
Model = TypeVar("Model", bound=BaseModel)
1212

1313

14-
def model_validate(model_class: Type[Model], data: Dict[Any, Any]) -> Model:
14+
def model_validate(model_class: type[Model], data: dict[Any, Any]) -> Model:
1515
if PYDANTIC_V2:
1616
return model_class.model_validate(data) # type: ignore[no-any-return, unused-ignore, attr-defined]
1717
else:
1818
return model_class.parse_obj(data) # type: ignore[no-any-return, unused-ignore, attr-defined]
1919

2020

21-
def model_validate_json(model_class: Type[Model], data: str) -> Model:
21+
def model_validate_json(model_class: type[Model], data: str) -> Model:
2222
if PYDANTIC_V2:
2323
return model_class.model_validate_json(data) # type: ignore[no-any-return, unused-ignore, attr-defined]
2424
else:
2525
return model_class.parse_raw(data) # type: ignore[no-any-return, unused-ignore, attr-defined]
2626

2727

28-
def model_dump(obj: BaseModel, **kwargs: Any) -> Dict[Any, Any]:
28+
def model_dump(obj: BaseModel, **kwargs: Any) -> dict[Any, Any]:
2929
if PYDANTIC_V2:
3030
return obj.model_dump(**kwargs) # type: ignore[no-any-return, unused-ignore, attr-defined]
3131
else:
@@ -41,7 +41,7 @@ def model_dump_json(obj: BaseModel) -> str:
4141

4242

4343
class TypeAdapter(Generic[T]):
44-
def __init__(self, type_: Type[T]) -> None:
44+
def __init__(self, type_: type[T]) -> None:
4545
self.type_ = type_
4646

4747
if PYDANTIC_V2:

‎tests/conftest.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
2+
from collections.abc import Generator
23
from dataclasses import dataclass
34
from pathlib import Path
4-
from typing import Generator
55
from unittest.mock import patch
66

77
import pytest

0 commit comments

Comments
 (0)