Skip to content

Commit

Permalink
really drop python<=3.7 support
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
  • Loading branch information
kloczek committed Mar 21, 2024
1 parent 09f4456 commit 14fc37e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tests/benchmarks/test_fastapi_startup_generics.py
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
10 changes: 5 additions & 5 deletions tests/benchmarks/test_fastapi_startup_simple.py
Expand Up @@ -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 14fc37e

Please sign in to comment.