Skip to content

Commit

Permalink
really drop python<=3.7 support (#9047)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Co-authored-by: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com>
  • Loading branch information
kloczek and sydney-runkle committed Mar 21, 2024
1 parent e7baf58 commit 04cc047
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
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

0 comments on commit 04cc047

Please sign in to comment.