Drop Python 3.8 support

This commit is contained in:
François Voron
2024-11-03 12:51:32 +00:00
committed by GitHub
parent 7f92a82e07
commit caa17889e1
41 changed files with 231 additions and 251 deletions

View File

@ -1,5 +1,5 @@
import secrets
from typing import Optional, Protocol, Tuple, Union
from typing import Optional, Protocol, Union
from pwdlib import PasswordHash
from pwdlib.hashers.argon2 import Argon2Hasher
@ -9,7 +9,7 @@ from pwdlib.hashers.bcrypt import BcryptHasher
class PasswordHelperProtocol(Protocol):
def verify_and_update(
self, plain_password: str, hashed_password: str
) -> Tuple[bool, Union[str, None]]: ... # pragma: no cover
) -> tuple[bool, Union[str, None]]: ... # pragma: no cover
def hash(self, password: str) -> str: ... # pragma: no cover
@ -30,7 +30,7 @@ class PasswordHelper(PasswordHelperProtocol):
def verify_and_update(
self, plain_password: str, hashed_password: str
) -> Tuple[bool, Union[str, None]]:
) -> tuple[bool, Union[str, None]]:
return self.password_hash.verify_and_update(plain_password, hashed_password)
def hash(self, password: str) -> str: