Skip to content

Commit e876fa0

Browse files
committed
upgrade to python 3.9
1 parent e823bc7 commit e876fa0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+273
-274
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
12+
python-version: ["3.9", "3.10", "3.11", "3.12" ]
1313
steps:
1414
- name: Checkout 🚚
1515
uses: actions/[email protected]

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ maintainers = [
1919
]
2020
license = { text = 'Apache 2.0' }
2121
description = "API that parses website content into python data."
22-
requires-python = '>=3.8'
22+
requires-python = '>=3.9'
2323
readme = "README.md"
2424
classifiers = [
2525
'Development Status :: 5 - Production/Stable',
@@ -30,7 +30,6 @@ classifiers = [
3030
'Natural Language :: English',
3131
'Operating System :: OS Independent',
3232
'Programming Language :: Python :: 3 :: Only',
33-
'Programming Language :: Python :: 3.8',
3433
'Programming Language :: Python :: 3.9',
3534
'Programming Language :: Python :: 3.10',
3635
'Programming Language :: Python :: 3.11',

server.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import datetime
44
import logging
55
from contextlib import asynccontextmanager
6-
from typing import List, Optional, Set, TypeVar
6+
from typing import Optional, TypeVar
77

88
import uvicorn
99
from fastapi import Depends, FastAPI, Path, Query, Response
1010
from starlette import status
11-
from typing_extensions import Annotated
11+
from typing import Annotated
1212

1313
import tibiapy
1414
from tibiapy.enums import (AuctionBattlEyeFilter, AuctionOrderBy, AuctionOrderDirection, AuctionSearchType,
@@ -82,8 +82,8 @@ async def get_news_article(
8282
async 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(
106106
async 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

tibiapy/builders/bazaar.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33

4-
from typing import List, Optional, TYPE_CHECKING
4+
from typing import Optional, TYPE_CHECKING
55

66
from tibiapy.models import Auction, CharacterBazaar
77
from tibiapy.models.bazaar import AuctionDetails, RevealedGem
@@ -35,7 +35,7 @@ def results_count(self, results_count: int) -> Self:
3535
self._results_count = results_count
3636
return self
3737

38-
def entries(self, entries: List[Auction]) -> Self:
38+
def entries(self, entries: list[Auction]) -> Self:
3939
self._entries = entries
4040
return self
4141

@@ -107,15 +107,15 @@ def outfit(self, outfit: OutfitImage) -> Self:
107107
self._outfit = outfit
108108
return self
109109

110-
def displayed_items(self, displayed_items: List[ItemEntry]) -> Self:
110+
def displayed_items(self, displayed_items: list[ItemEntry]) -> Self:
111111
self._displayed_items = displayed_items
112112
return self
113113

114114
def add_displayed_item(self, displayed_item: ItemEntry) -> Self:
115115
self._displayed_items.append(displayed_item)
116116
return self
117117

118-
def sales_arguments(self, sales_arguments: List[SalesArgument]) -> Self:
118+
def sales_arguments(self, sales_arguments: list[SalesArgument]) -> Self:
119119
self._sales_arguments = sales_arguments
120120
return self
121121

@@ -244,7 +244,7 @@ def titles_count(self, titles_count: int) -> Self:
244244
self._titles_count = titles_count
245245
return self
246246

247-
def skills(self, skills: List[SkillEntry]) -> Self:
247+
def skills(self, skills: list[SkillEntry]) -> Self:
248248
self._skills = skills
249249
return self
250250

@@ -359,39 +359,39 @@ def familiars(self, familiars: Familiars) -> Self:
359359
self._familiars = familiars
360360
return self
361361

362-
def blessings(self, blessings: List[BlessingEntry]) -> Self:
362+
def blessings(self, blessings: list[BlessingEntry]) -> Self:
363363
self._blessings = blessings
364364
return self
365365

366-
def imbuements(self, imbuements: List[str]) -> Self:
366+
def imbuements(self, imbuements: list[str]) -> Self:
367367
self._imbuements = imbuements
368368
return self
369369

370-
def charms(self, charms: List[CharmEntry]) -> Self:
370+
def charms(self, charms: list[CharmEntry]) -> Self:
371371
self._charms = charms
372372
return self
373373

374-
def completed_cyclopedia_map_areas(self, completed_cyclopedia_map_areas: List[str]) -> Self:
374+
def completed_cyclopedia_map_areas(self, completed_cyclopedia_map_areas: list[str]) -> Self:
375375
self._completed_cyclopedia_map_areas = completed_cyclopedia_map_areas
376376
return self
377377

378-
def completed_quest_lines(self, completed_quest_lines: List[str]) -> Self:
378+
def completed_quest_lines(self, completed_quest_lines: list[str]) -> Self:
379379
self._completed_quest_lines = completed_quest_lines
380380
return self
381381

382-
def titles(self, titles: List[str]) -> Self:
382+
def titles(self, titles: list[str]) -> Self:
383383
self._titles = titles
384384
return self
385385

386-
def achievements(self, achievements: List[AchievementEntry]) -> Self:
386+
def achievements(self, achievements: list[AchievementEntry]) -> Self:
387387
self._achievements = achievements
388388
return self
389389

390-
def bestiary_progress(self, bestiary_progress: List[BestiaryEntry]) -> Self:
390+
def bestiary_progress(self, bestiary_progress: list[BestiaryEntry]) -> Self:
391391
self._bestiary_progress = bestiary_progress
392392
return self
393393

394-
def bosstiary_progress(self, bosstiary_progress: List[BestiaryEntry]) -> Self:
394+
def bosstiary_progress(self, bosstiary_progress: list[BestiaryEntry]) -> Self:
395395
self._bosstiary_progress = bosstiary_progress
396396
return self
397397

tibiapy/builders/character.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Optional, List, TYPE_CHECKING
3+
from typing import Optional, TYPE_CHECKING
44

55
from tibiapy.models import Character
66

@@ -54,7 +54,7 @@ def deletion_date(self, deletion_date: Optional[datetime.datetime]) -> Self:
5454
self._deletion_date = deletion_date
5555
return self
5656

57-
def former_names(self, former_names: List[str]) -> Self:
57+
def former_names(self, former_names: list[str]) -> Self:
5858
self._former_names = former_names
5959
return self
6060

@@ -98,7 +98,7 @@ def married_to(self, married_to: Optional[str]) -> Self:
9898
self._married_to = married_to
9999
return self
100100

101-
def houses(self, houses: List[CharacterHouse]) -> Self:
101+
def houses(self, houses: list[CharacterHouse]) -> Self:
102102
self._houses = houses
103103
return self
104104

@@ -130,19 +130,19 @@ def add_account_badge(self, account_badge: AccountBadge) -> Self:
130130
self._account_badges.append(account_badge)
131131
return self
132132

133-
def account_badges(self, account_badges: List[AccountBadge]) -> Self:
133+
def account_badges(self, account_badges: list[AccountBadge]) -> Self:
134134
self._account_badges = account_badges
135135
return self
136136

137-
def achievements(self, achievements: List[Achievement]) -> Self:
137+
def achievements(self, achievements: list[Achievement]) -> Self:
138138
self._achievements = achievements
139139
return self
140140

141141
def add_achievement(self, achievement: Achievement) -> Self:
142142
self._achievements.append(achievement)
143143
return self
144144

145-
def deaths(self, deaths: List[Death]) -> Self:
145+
def deaths(self, deaths: list[Death]) -> Self:
146146
self._deaths = deaths
147147
return self
148148

@@ -162,7 +162,7 @@ def add_other_character(self, other_character: OtherCharacter) -> Self:
162162
self._other_characters.append(other_character)
163163
return self
164164

165-
def other_characters(self, other_characters: List[OtherCharacter]) -> Self:
165+
def other_characters(self, other_characters: list[OtherCharacter]) -> Self:
166166
self._other_characters = other_characters
167167
return self
168168

tibiapy/builders/creature.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from __future__ import annotations
2-
from typing import List, TYPE_CHECKING
2+
from typing import TYPE_CHECKING
33

44
from tibiapy.models.creature import CreatureEntry, Creature
55

@@ -63,15 +63,15 @@ def experience(self, experience: int) -> Self:
6363
self._experience = experience
6464
return self
6565

66-
def immune_to(self, immune_to: List[str]) -> Self:
66+
def immune_to(self, immune_to: list[str]) -> Self:
6767
self._immune_to = immune_to
6868
return self
6969

70-
def weak_against(self, weak_against: List[str]) -> Self:
70+
def weak_against(self, weak_against: list[str]) -> Self:
7171
self._weak_against = weak_against
7272
return self
7373

74-
def strong_against(self, strong_against: List[str]) -> Self:
74+
def strong_against(self, strong_against: list[str]) -> Self:
7575
self._strong_against = strong_against
7676
return self
7777

tibiapy/builders/event.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import List, TYPE_CHECKING
3+
from typing import TYPE_CHECKING
44

55
from tibiapy.models.event import EventSchedule
66

@@ -24,7 +24,7 @@ def year(self, year: int) -> Self:
2424
self._year = year
2525
return self
2626

27-
def events(self, events: List[EventEntry]) -> Self:
27+
def events(self, events: list[EventEntry]) -> Self:
2828
self._events = events
2929
return self
3030

0 commit comments

Comments
 (0)