fix: replace typing List/Tuple with built-in generics

This commit is contained in:
2025-12-23 05:17:24 +01:00
parent a635c964da
commit 620e1efa83
3 changed files with 4 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
"""Authentication helpers for the Auditui app."""
from pathlib import Path
from typing import Tuple
import audible
@@ -10,7 +9,7 @@ from .constants import AUTH_PATH
def authenticate(
auth_path: Path = AUTH_PATH,
) -> Tuple[audible.Authenticator, audible.Client]:
) -> tuple[audible.Authenticator, audible.Client]:
"""Authenticate with Audible and return authenticator and client."""
if not auth_path.exists():
raise FileNotFoundError(

View File

@@ -2,7 +2,6 @@
from getpass import getpass
from pathlib import Path
from typing import Tuple
import audible
@@ -11,7 +10,7 @@ from .constants import AUTH_PATH
def configure(
auth_path: Path = AUTH_PATH,
) -> Tuple[audible.Authenticator, audible.Client]:
) -> tuple[audible.Authenticator, audible.Client]:
"""Force re-authentication and save credentials."""
if auth_path.exists():
response = input(
@@ -37,4 +36,3 @@ def configure(
print("Authentication successful!")
audible_client = audible.Client(auth=authenticator)
return authenticator, audible_client

View File

@@ -1,6 +1,6 @@
"""Library helpers for fetching and formatting Audible data."""
from typing import Callable, List
from typing import Callable
import audible
@@ -26,7 +26,7 @@ class LibraryClient:
self, response_groups: str, on_progress: ProgressCallback | None = None
) -> list:
"""Fetch all pages of library items from the API."""
all_items: List[dict] = []
all_items: list[dict] = []
page = 1
page_size = 50