Drop Python 3.9 support

This commit is contained in:
François Voron
2025-10-25 08:19:03 +02:00
parent ae5ff025ef
commit fcf9a2041a
33 changed files with 224 additions and 234 deletions

View File

@ -1,4 +1,4 @@
from typing import Any, Generic, Optional
from typing import Any, Generic
from fastapi_users.models import ID, OAP, UOAP, UP
from fastapi_users.types import DependencyCallable
@ -7,15 +7,15 @@ from fastapi_users.types import DependencyCallable
class BaseUserDatabase(Generic[UP, ID]):
"""Base adapter for retrieving, creating and updating users from a database."""
async def get(self, id: ID) -> Optional[UP]:
async def get(self, id: ID) -> UP | None:
"""Get a single user by id."""
raise NotImplementedError()
async def get_by_email(self, email: str) -> Optional[UP]:
async def get_by_email(self, email: str) -> UP | None:
"""Get a single user by email."""
raise NotImplementedError()
async def get_by_oauth_account(self, oauth: str, account_id: str) -> Optional[UP]:
async def get_by_oauth_account(self, oauth: str, account_id: str) -> UP | None:
"""Get a single user by OAuth account id."""
raise NotImplementedError()