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,5 +1,5 @@
import secrets
from typing import Generic, Optional
from typing import Generic
import redis.asyncio
@ -12,7 +12,7 @@ class RedisStrategy(Strategy[models.UP, models.ID], Generic[models.UP, models.ID
def __init__(
self,
redis: redis.asyncio.Redis,
lifetime_seconds: Optional[int] = None,
lifetime_seconds: int | None = None,
*,
key_prefix: str = "fastapi_users_token:",
):
@ -21,8 +21,8 @@ class RedisStrategy(Strategy[models.UP, models.ID], Generic[models.UP, models.ID
self.key_prefix = key_prefix
async def read_token(
self, token: Optional[str], user_manager: BaseUserManager[models.UP, models.ID]
) -> Optional[models.UP]:
self, token: str | None, user_manager: BaseUserManager[models.UP, models.ID]
) -> models.UP | None:
if token is None:
return None