33import datetime
44import logging
55from contextlib import asynccontextmanager
6- from typing import List , Optional , Set , TypeVar
6+ from typing import Optional , TypeVar
77
88import uvicorn
99from fastapi import Depends , FastAPI , Path , Query , Response
1010from starlette import status
11- from typing_extensions import Annotated
11+ from typing import Annotated
1212
1313import tibiapy
1414from tibiapy .enums import (AuctionBattlEyeFilter , AuctionOrderBy , AuctionOrderDirection , AuctionSearchType ,
@@ -82,8 +82,8 @@ async def get_news_article(
8282async def get_news_archive (
8383 response : Response ,
8484 from_date : datetime .date = Path (..., alias = "fromDate" , description = FROM_DESCRIPTION ),
85- types : Set [NewsType ] = Query (None , alias = "type" , description = TYPES_DESCRIPTION ),
86- categories : Set [NewsCategory ] = Query (None , alias = "category" , description = CATEGORIES_DESCRIPTION ),
85+ types : set [NewsType ] = Query (None , alias = "type" , description = TYPES_DESCRIPTION ),
86+ categories : set [NewsCategory ] = Query (None , alias = "category" , description = CATEGORIES_DESCRIPTION ),
8787) -> TibiaResponse [NewsArchive ]:
8888 """Show the news archive from a start date to today."""
8989 return handle_response (response , await app .state .client .fetch_news_archive (from_date , None , categories , types ))
@@ -95,8 +95,8 @@ async def get_news_archive_between_dates(
9595 response : Response ,
9696 from_date : datetime .date = Path (..., alias = "fromDate" , description = FROM_DESCRIPTION ),
9797 to_date : datetime .date = Path (..., alias = "toDate" , description = TO_DESCRIPTION ),
98- types : Set [NewsType ] = Query (None , alias = "type" , description = TYPES_DESCRIPTION ),
99- categories : Set [NewsCategory ] = Query (None , alias = "category" , description = CATEGORIES_DESCRIPTION ),
98+ types : set [NewsType ] = Query (None , alias = "type" , description = TYPES_DESCRIPTION ),
99+ categories : set [NewsCategory ] = Query (None , alias = "category" , description = CATEGORIES_DESCRIPTION ),
100100) -> TibiaResponse [NewsArchive ]:
101101 """Show the news archive for a specific date period."""
102102 return handle_response (response , await app .state .client .fetch_news_archive (from_date , to_date , categories , types ))
@@ -106,8 +106,8 @@ async def get_news_archive_between_dates(
106106async def get_news_archive_by_days (
107107 response : Response ,
108108 days : int = Query (30 , description = "The number of days to look back for news." ),
109- types : Set [NewsType ] = Query (None , alias = "type" , description = TYPES_DESCRIPTION ),
110- categories : Set [NewsCategory ] = Query (None , alias = "category" , description = CATEGORIES_DESCRIPTION ),
109+ types : set [NewsType ] = Query (None , alias = "type" , description = TYPES_DESCRIPTION ),
110+ categories : set [NewsCategory ] = Query (None , alias = "category" , description = CATEGORIES_DESCRIPTION ),
111111) -> TibiaResponse [NewsArchive ]:
112112 return handle_response (response , await app .state .client .fetch_news_archive_by_days (days , categories , types ))
113113
@@ -244,7 +244,7 @@ async def get_highscores(
244244 category : HighscoresCategory = Query (HighscoresCategory .EXPERIENCE ),
245245 vocation : HighscoresProfession = Query (HighscoresProfession .ALL ),
246246 battleye : HighscoresBattlEyeType = Query (None ),
247- pvp_types : List [PvpTypeFilter ] = Query ([], alias = "pvp" ),
247+ pvp_types : list [PvpTypeFilter ] = Query ([], alias = "pvp" ),
248248) -> TibiaResponse [Highscores ]:
249249 if world .lower () in {"global" , "all" }:
250250 world = None
0 commit comments