Skip to content

Commit b846e0d

Browse files
authored
Merge pull request #8 from IPLSplatoon/schemaUpdate
Update schema to match upstream API
2 parents 4972150 + eb45839 commit b846e0d

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ This script uses the GitHub API to check that the SHA stored in `tool.sendou-py.
7474
for the upstream schema.
7575

7676
```bash
77-
python3 python3 scripts/checkUpstreamSchema.py
77+
§§
7878
```
7979

8080

pyproject.toml

+9-14
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,36 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "sendou-py"
7-
version = "1.2.8"
7+
version = "1.2.9"
88
description = "An async Python library for Sendou.ink"
99
authors = [ "Vincent Lee <[email protected]>",]
1010
license = "MIT"
1111
readme = "README.md"
1212
homepage = "https://github.com/IPLSplatoon/sendou.py/"
1313
repository = "https://github.com/IPLSplatoon/sendou.py/"
1414
documentation = "https://sendou.opensource.iplabs.work/"
15-
keywords = ["splatoon", "sendou.ink"]
16-
classifiers = [
17-
"Topic :: Software Development :: Libraries :: Python Modules",
18-
"Development Status :: 4 - Beta",
19-
"Framework :: AsyncIO"
20-
]
21-
packages = [{include="sendou"}]
15+
keywords = [ "splatoon", "sendou.ink",]
16+
classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Development Status :: 4 - Beta", "Framework :: AsyncIO",]
17+
[[tool.poetry.packages]]
18+
include = "sendou"
2219

2320
[tool.poetry.dependencies]
2421
python = "^3.10"
2522
python-dateutil = "^2.8.2"
2623
aiohttp-client-cache = "^0.11.0"
2724

2825
[tool.sendou-py.source]
29-
schema_commit = "5ad69f941f3844d89153e4ac03184a0482e8df3b"
26+
schema_commit = "6d654baa3094813fa125fef404311c08352676f6"
3027
schema_path = "app/features/api-public/schema.ts"
3128

3229
[tool.pytest.ini_options]
33-
addopts = [
34-
"--import-mode=importlib",
35-
]
36-
testpaths = ["tests"]
30+
addopts = [ "--import-mode=importlib",]
31+
testpaths = [ "tests",]
3732

3833
[tool.poetry.group.dev.dependencies]
3934
pytest = "^8.3.2"
4035
asyncio = "^3.4.3"
4136
toml = "^0.10.2"
4237

4338
[tool.poetry.group.ci.dependencies]
44-
pytest-md-report = "^0.6.2"
39+
pytest-md-report = "^0.6.2"

scripts/updateUpstreamSchema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def main():
2727
exit(0)
2828
toml_data["tool"]["sendou-py"]["source"]["schema_commit"] = latest_sha
2929

30-
with open("../pyproject.toml", "w") as f:
30+
with open("./pyproject.toml", "w") as f:
3131
toml.dump(toml_data, f)
3232

3333
print("Updated schema_commit in pyproject.toml ✅")

sendou/models/tournament/bracket/bracket.py

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class BracketStage:
8282
created_at: Optional[datetime] # Provided as unix timestamp
8383

8484
def __init__(self, data: dict):
85+
self.created_at = None
8586
self.id = data.get("id", 0)
8687
self.name = data.get("name", "")
8788
self.number = data.get("number", 0)

sendou/models/tournament/tournament.py

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class Tournament(BaseModel):
107107
teams: TournamentTeamInfo
108108
brackets: List[TournamentBracket]
109109
organization_id: Optional[int]
110+
is_finalised: bool
110111

111112
def __init__(self, id: int, data: dict, request_client: RequestsClient):
112113
"""
@@ -127,6 +128,7 @@ def __init__(self, id: int, data: dict, request_client: RequestsClient):
127128
self.brackets = [TournamentBracket(bracket, index, self.id, request_client) for index, bracket in
128129
enumerate(data.get("brackets", []))]
129130
self.organization_id = data.get("organizationId", None)
131+
self.is_finalised = data.get("isFinalized", False)
130132

131133
async def get_teams(self) -> List[TournamentTeam]:
132134
"""

sendou/models/user.py

+4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ class UserSocials:
2020
"""
2121
twitch: Optional[str]
2222
twitter: Optional[str]
23+
battlefy: Optional[str]
24+
bsky: Optional[str]
2325

2426
def __init__(self, data: dict):
2527
self.twitch = data.get("twitch")
2628
self.twitter = data.get("twitter")
29+
self.battlefy = data.get("battlefy")
30+
self.bsky = data.get("bsky")
2731

2832

2933
class UserWeapon:

0 commit comments

Comments
 (0)