Skip to content

Commit 6dbfec3

Browse files
committed
clean up imports using ruff
1 parent 74ad3a3 commit 6dbfec3

38 files changed

+519
-141
lines changed

server.py

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,65 @@
33
import datetime
44
import logging
55
from contextlib import asynccontextmanager
6-
from typing import Optional, TypeVar
6+
from typing import Annotated, Optional, TypeVar
77

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

1312
import tibiapy
14-
from tibiapy.enums import (AuctionBattlEyeFilter, AuctionOrderBy, AuctionOrderDirection, AuctionSearchType,
15-
AuctionSkillFilter, AuctionVocationFilter, HighscoresBattlEyeType, HighscoresCategory,
16-
HighscoresProfession, HouseOrder, HouseStatus, HouseType, NewsCategory, NewsType,
17-
PvpTypeFilter,
18-
SpellGroup, SpellSorting, SpellType, SpellVocationFilter)
19-
from tibiapy.models import (Auction, AuctionFilters, BoostableBosses, BossEntry, Character, CharacterBazaar, Creature,
20-
CreatureEntry, CreaturesSection, EventSchedule, FansitesSection, ForumBoard, ForumSection,
21-
ForumThread,
22-
Guild, GuildWars,
23-
GuildsSection, Highscores, House, HousesSection, KillStatistics, Leaderboard, News,
24-
NewsArchive, Spell,
25-
SpellsSection, TibiaResponse, World, WorldOverview)
13+
from tibiapy.enums import (
14+
AuctionBattlEyeFilter,
15+
AuctionOrderBy,
16+
AuctionOrderDirection,
17+
AuctionSearchType,
18+
AuctionSkillFilter,
19+
AuctionVocationFilter,
20+
HighscoresBattlEyeType,
21+
HighscoresCategory,
22+
HighscoresProfession,
23+
HouseOrder,
24+
HouseStatus,
25+
HouseType,
26+
NewsCategory,
27+
NewsType,
28+
PvpTypeFilter,
29+
SpellGroup,
30+
SpellSorting,
31+
SpellType,
32+
SpellVocationFilter,
33+
)
34+
from tibiapy.models import (
35+
Auction,
36+
AuctionFilters,
37+
BoostableBosses,
38+
BossEntry,
39+
Character,
40+
CharacterBazaar,
41+
Creature,
42+
CreatureEntry,
43+
CreaturesSection,
44+
EventSchedule,
45+
FansitesSection,
46+
ForumBoard,
47+
ForumSection,
48+
ForumThread,
49+
Guild,
50+
GuildsSection,
51+
GuildWars,
52+
Highscores,
53+
House,
54+
HousesSection,
55+
KillStatistics,
56+
Leaderboard,
57+
News,
58+
NewsArchive,
59+
Spell,
60+
SpellsSection,
61+
TibiaResponse,
62+
World,
63+
WorldOverview,
64+
)
2665

2766
logging_formatter = logging.Formatter("[%(asctime)s][%(levelname)s] %(message)s")
2867
console_handler = logging.StreamHandler()

tibiapy/builders/bazaar.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
from __future__ import annotations
22

3-
4-
from typing import Optional, TYPE_CHECKING
3+
from typing import TYPE_CHECKING, Optional
54

65
from tibiapy.models import Auction, CharacterBazaar
76
from tibiapy.models.bazaar import AuctionDetails, RevealedGem
87

98
if TYPE_CHECKING:
109
import datetime
10+
1111
from typing_extensions import Self
12-
from tibiapy.enums import BazaarType, Vocation, Sex, BidType, AuctionStatus
13-
from tibiapy.models import (AuctionFilters, OutfitImage, ItemEntry, SalesArgument, SkillEntry, ItemSummary, Mounts,
14-
Outfits, Familiars, BlessingEntry, CharmEntry, AchievementEntry, BestiaryEntry)
12+
13+
from tibiapy.enums import AuctionStatus, BazaarType, BidType, Sex, Vocation
14+
from tibiapy.models import (
15+
AchievementEntry,
16+
AuctionFilters,
17+
BestiaryEntry,
18+
BlessingEntry,
19+
CharmEntry,
20+
Familiars,
21+
ItemEntry,
22+
ItemSummary,
23+
Mounts,
24+
OutfitImage,
25+
Outfits,
26+
SalesArgument,
27+
SkillEntry,
28+
)
1529

1630

1731
class CharacterBazaarBuilder:

tibiapy/builders/character.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
from __future__ import annotations
22

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

55
from tibiapy.models import Character
66

77
if TYPE_CHECKING:
88
import datetime
9+
910
from typing_extensions import Self
11+
1012
from tibiapy.enums import Sex, Vocation
11-
from tibiapy.models import (CharacterHouse, GuildMembership, AccountBadge, Achievement, Death, AccountInformation,
12-
OtherCharacter)
13+
from tibiapy.models import (
14+
AccountBadge,
15+
AccountInformation,
16+
Achievement,
17+
CharacterHouse,
18+
Death,
19+
GuildMembership,
20+
OtherCharacter,
21+
)
1322

1423

1524
class CharacterBuilder:

tibiapy/builders/event.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
if TYPE_CHECKING:
88
from typing_extensions import Self
9+
910
from tibiapy.models.event import EventEntry
1011

1112

tibiapy/builders/forum.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
from __future__ import annotations
22

33
import datetime
4-
from typing import Optional, TYPE_CHECKING
4+
from typing import TYPE_CHECKING, Optional
55

66
from tibiapy.models import AnnouncementEntry, ForumAuthor, ForumPost, ThreadEntry
7-
from tibiapy.models.forum import CMPostArchive, CMPost, ForumAnnouncement, ForumBoard, ForumThread
7+
from tibiapy.models.forum import (
8+
CMPost,
9+
CMPostArchive,
10+
ForumAnnouncement,
11+
ForumBoard,
12+
ForumThread,
13+
)
814

915
if TYPE_CHECKING:
1016
from typing_extensions import Self

tibiapy/builders/guild.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from __future__ import annotations
22

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

5-
from tibiapy.models import GuildEntry, Guild, GuildWars, GuildWarEntry
5+
from tibiapy.models import Guild, GuildEntry, GuildWarEntry, GuildWars
66

77
if TYPE_CHECKING:
88
import datetime
9+
910
from typing_extensions import Self
10-
from tibiapy.models import GuildHouse, GuildMember, GuildInvite
11+
12+
from tibiapy.models import GuildHouse, GuildInvite, GuildMember
1113

1214

1315
class _BaseGuildBuilder:

tibiapy/builders/highscores.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66

77
if TYPE_CHECKING:
88
import datetime
9+
910
from typing_extensions import Self
10-
from tibiapy.enums import HighscoresCategory, HighscoresProfession, HighscoresBattlEyeType, PvpTypeFilter
11+
12+
from tibiapy.enums import (
13+
HighscoresBattlEyeType,
14+
HighscoresCategory,
15+
HighscoresProfession,
16+
PvpTypeFilter,
17+
)
1118
from tibiapy.models import HighscoresEntry
1219

1320

tibiapy/builders/house.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from __future__ import annotations
22

3-
43
from typing import TYPE_CHECKING, Optional
54

65
from typing_extensions import Self
76

8-
from tibiapy.models.house import HouseEntry, HousesSection, House
7+
from tibiapy.models.house import House, HouseEntry, HousesSection
98

109
if TYPE_CHECKING:
1110
import datetime
12-
from tibiapy.enums import HouseStatus, HouseType, HouseOrder, Sex
11+
12+
from tibiapy.enums import HouseOrder, HouseStatus, HouseType, Sex
1313

1414

1515
class HousesSectionBuilder:

tibiapy/builders/kill_statistics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
if TYPE_CHECKING:
88
from typing_extensions import Self
9+
910
from tibiapy.models import RaceEntry
1011

1112

tibiapy/builders/leaderboard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from __future__ import annotations
22

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

5-
from tibiapy.models.leaderboard import LeaderboardEntry, Leaderboard
5+
from tibiapy.models.leaderboard import Leaderboard, LeaderboardEntry
66

77
if TYPE_CHECKING:
88
import datetime
9+
910
from typing_extensions import Self
11+
1012
from tibiapy.models.leaderboard import LeaderboardRotation
1113

1214

0 commit comments

Comments
 (0)