Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

really drop python<=3.7 support #9047

Merged
merged 3 commits into from Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/benchmarks/test_fastapi_startup_generics.py
Expand Up @@ -2,7 +2,7 @@
from __future__ import annotations

from pathlib import Path
from typing import Any, Dict, Generic, List, TypeVar
from typing import Any, Generic, List, TypeVar

from typing_extensions import Annotated

Expand Down Expand Up @@ -59,17 +59,17 @@ class GetModel2(GetModel[T], Generic[T]):
bar: str

class GetManyModel(BaseModel, Generic[T]):
res: List[T]
res: list[T]

class GetManyModel2(GetManyModel[T], Generic[T]):
foo: str
bar: str

class GetManyModel3(BaseModel, Generic[T]):
res: Dict[str, T]
res: dict[str, T]

class GetManyModel4(BaseModel, Generic[T]):
res: Dict[str, List[T]]
res: dict[str, list[T]]

class PutModel(BaseModel, Generic[T]):
data: T
Expand All @@ -79,13 +79,13 @@ class PutModel2(PutModel[T], Generic[T]):
bar: str

class PutManyModel(BaseModel, Generic[T]):
data: List[T]
data: list[T]

class PutManyModel2(PutManyModel[T], Generic[T]):
foo: str
bar: str

api_models: List[Any] = [
api_models: list[Any] = [
GetModel,
GetModel2,
GetManyModel,
Expand Down
12 changes: 6 additions & 6 deletions tests/benchmarks/test_fastapi_startup_simple.py
Expand Up @@ -3,7 +3,7 @@

from datetime import datetime
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
from typing import Any, Callable, Dict, List, Tuple
from uuid import UUID

from annotated_types import Gt
Expand All @@ -20,7 +20,7 @@ class User(BaseModel):
id: int
username: str
email: EmailStr
full_name: Optional[str] = None
full_name: str | None = None

class Address(BaseModel):
street: str
Expand All @@ -32,7 +32,7 @@ class Product(BaseModel):
id: int
name: str
price: Annotated[float, Gt(0)]
description: Optional[str] = None
description: str | None = None

class BlogPost(BaseModel):
title: Annotated[str, StringConstraints(pattern=r'[A-Za-z0-9]+')]
Expand All @@ -43,13 +43,13 @@ class BlogPost(BaseModel):
class Website(BaseModel):
name: str
url: AnyUrl
description: Optional[str] = None
description: str | None = None

class Order(BaseModel):
order_id: str
customer: User
shipping_address: Address
products: List[Product]
products: list[Product]

class Comment(BaseModel):
text: str
Expand All @@ -65,7 +65,7 @@ class Event(BaseModel):

class Category(BaseModel):
name: str
description: Optional[str] = None
description: str | None = None

ReviewGroup = List[Dict[Tuple[User, Product], Comment]]

Expand Down