diff --git a/noxfile.py b/noxfile.py index 31b71fd..0610d28 100644 --- a/noxfile.py +++ b/noxfile.py @@ -27,17 +27,20 @@ from pathlib import Path import nox -import toml +import msgspec SessionT = Callable[[nox.Session], None] InjectorT = Callable[[SessionT], SessionT] def parse_dependencies() -> t.Dict[str, str]: - data = toml.load("pyproject.toml")["tool"]["poetry"] + with open("pyproject.toml", "rb") as f: + data = msgspec.toml.decode(f.read()) + + poetry = data["tool"]["poetry"] deps: t.Dict[str, t.Union[str, t.Dict[str, str]]] = { - **data["dependencies"], - **data["group"]["dev"]["dependencies"], + **poetry["dependencies"], + **poetry["group"]["dev"]["dependencies"], } for k, v in deps.items(): diff --git a/pyproject.toml b/pyproject.toml index fe2a305..cbff3d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,8 +50,6 @@ pyright = "==1.1.344" pytest = "==7.4.4" pytest-asyncio = "==0.23.3" pytest-testdox = "==3.1.0" -types-toml = "==0.10.8.7" -toml = "==0.10.2" [tool.black] line-length = 99 diff --git a/wom/models/groups/models.py b/wom/models/groups/models.py index ca02633..d4293bd 100644 --- a/wom/models/groups/models.py +++ b/wom/models/groups/models.py @@ -24,6 +24,8 @@ import typing as t from datetime import datetime +import msgspec + from wom import enums from ..base import BaseModel @@ -318,16 +320,7 @@ class MetricLeaders(BaseModel): """ -class GroupStatistics( - BaseModel, - rename={ - "maxed_combat_count": "maxedCombatCount", - "maxed_total_count": "maxedTotalCount", - "maxed_200ms_count": "maxed200msCount", - "average_stats": "averageStats", - "metric_leaders": "metricLeaders", - }, -): +class GroupStatistics(BaseModel): """Represents accumulated group statistics.""" maxed_combat_count: int @@ -336,7 +329,7 @@ class GroupStatistics( maxed_total_count: int """The number of maxed total level players in the group.""" - maxed_200ms_count: int + maxed_200ms_count: int = msgspec.field(name="maxed200msCount") """The number of maxed 200M xp players in the group.""" average_stats: Snapshot