Skip to content

Commit 2a1330c

Browse files
authored
Add support for CollectionsLogged (#79)
* Add support for CollectionsLogged Bump version to 2.0 Remove support for py3.8 Upgrade dependencies * Lint - upgrade CI to use py3.13
1 parent 946ce1a commit 2a1330c

File tree

15 files changed

+71
-44
lines changed

15 files changed

+71
-44
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1717
runs-on: ${{ matrix.os }}
1818

1919
steps:
@@ -56,13 +56,13 @@ jobs:
5656
- name: Checkout code
5757
uses: actions/checkout@v3
5858

59-
- name: Install python 3.8
59+
- name: Install python 3.13
6060
uses: actions/setup-python@v3
6161
with:
62-
python-version: "3.8"
62+
python-version: "3.13"
6363

6464
- name: Install poetry
65-
uses: Gr1N/setup-poetry@v8
65+
uses: Gr1N/setup-poetry@v9
6666

6767
- name: Lint and format
6868
run: |

.github/workflows/dev-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python-version: "3.10"
2323

2424
- name: Install poetry
25-
uses: Gr1N/setup-poetry@v8
25+
uses: Gr1N/setup-poetry@v9
2626

2727
- name: Install dependencies
2828
run: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
python-version: "3.10"
5858

5959
- name: Install poetry
60-
uses: Gr1N/setup-poetry@v8
60+
uses: Gr1N/setup-poetry@v9
6161

6262
- name: Install dependencies
6363
run: |

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# v2.0 (Jan 2025)
2+
3+
# Breaking
4+
5+
- Drop support for Python 3.8.
6+
- Minimum msgspec version is now `0.19.0`.
7+
8+
## Additions
9+
10+
- Add `CollectionsLogged` metric.
11+
- Add support for Python 3.13.
12+
13+
---
14+
115
# v1.0.1 (Sep 2024)
216

317
## Additions

docs/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Installation
22

3-
Python version 3.8 or greater is required to use wom.py.
3+
Python version 3.9 or greater is required to use wom.py.
44

55
## Stable
66

docs/migrating/v2.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Migrating to V2
2+
3+
When upgrading from `v1` to `v2.*` the only breaking change to take
4+
into account is that support for Python 3.8 has been dropped.
5+
6+
Additionally the minimum required version of the msgspec dependency
7+
is now 0.19.0 - which may be breaking for some users on a lower version.
8+
This change was made to support Python 3.13.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ nav:
102102
- "getting-started/result.md"
103103
- "Migration guides":
104104
- "migrating/v1.md"
105+
- "migrating/v2.md"

noxfile.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,15 @@ def wrapper(session: nox.Session) -> None:
6868
return inner
6969

7070

71+
def run(session: nox.Session, *args: str) -> None:
72+
session.run(*args, external=True)
73+
74+
7175
@nox.session(reuse_venv=True)
7276
@install("pytest", "pytest-asyncio", "pytest-testdox", "coverage", "aiohttp", "msgspec")
7377
def tests(session: nox.Session) -> None:
74-
session.run(
78+
run(
79+
session,
7580
"coverage",
7681
"run",
7782
"--omit",
@@ -89,28 +94,28 @@ def coverage(session: nox.Session) -> None:
8994
if not Path(".coverage").exists():
9095
session.skip("Skipping coverage")
9196

92-
session.run("coverage", "report", "-m")
97+
run(session, "coverage", "report", "-m")
9398

9499

95100
@nox.session(reuse_venv=True)
96101
@install("pyright", "mypy", "aiohttp", "msgspec")
97102
def types(session: nox.Session) -> None:
98-
session.run("mypy")
99-
session.run("pyright")
103+
run(session, "mypy")
104+
run(session, "pyright")
100105

101106

102107
@nox.session(reuse_venv=True)
103-
@install("black", "len8")
108+
@install("black")
104109
def formatting(session: nox.Session) -> None:
105-
session.run("black", ".", "--check")
106-
session.run("len8")
110+
run(session, "black", ".", "--check")
107111

108112

109113
@nox.session(reuse_venv=True)
110114
@install("flake8", "isort")
111115
def imports(session: nox.Session) -> None:
112-
session.run("isort", "wom", "tests", "-cq")
113-
session.run(
116+
run(session, "isort", "wom", "tests", "-cq")
117+
run(
118+
session,
114119
"flake8",
115120
"wom",
116121
"tests",
@@ -150,4 +155,4 @@ def licensing(session: nox.Session) -> None:
150155
@nox.session(reuse_venv=True)
151156
def alls(session: nox.Session) -> None:
152157
session.install(".")
153-
session.run("python", "scripts/alls.py")
158+
run(session, "python", "scripts/alls.py")

pyproject.toml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "wom.py"
3-
version = "1.0.1"
3+
version = "2.0.0"
44
description = "An asynchronous wrapper for the Wise Old Man API."
55
authors = ["Jonxslays"]
66
license = "MIT"
@@ -30,26 +30,25 @@ classifiers = [
3030
wom = "wom.__main__:_main"
3131

3232
[tool.poetry.dependencies]
33-
python = ">=3.8"
33+
python = ">=3.9"
3434
aiohttp = ">3.8.1"
35-
msgspec = ">=0.18.5"
35+
msgspec = ">=0.19.0"
3636

3737
[tool.poetry.group.dev.dependencies]
38-
black = "==23.12.1"
39-
coverage = "==7.4.0"
40-
flake8 = { version = "==7.0.0", python = ">=3.8.1" }
38+
black = "==25.1.0"
39+
coverage = "==7.6.10"
40+
flake8 = "==7.1.1"
4141
griffe = "==0.47.0"
42-
isort = "==5.13.2"
43-
len8 = { version = "==0.7.3.post0", python = "<3.12" }
42+
isort = "==6.0.0"
4443
mike = "==2.0.0"
45-
mkdocs-include-markdown-plugin = { version = "==6.0.4", python = "<3.12" }
46-
mkdocs-material = "==9.5.3"
47-
mkdocstrings = { version = "==0.24.0", extras = ["python"] }
48-
mypy = "==1.8.0"
49-
nox = "==2023.4.22"
50-
pyright = "==1.1.344"
51-
pytest = "==7.4.4"
52-
pytest-asyncio = "==0.23.3"
44+
mkdocs-include-markdown-plugin = "==6.2.2"
45+
mkdocs-material = "==9.5.50"
46+
mkdocstrings = { version = "==0.27.0", extras = ["python"] }
47+
mypy = "==1.14.1"
48+
nox = "==2024.10.9 "
49+
pyright = "==1.1.393"
50+
pytest = "==8.3.4"
51+
pytest-asyncio = "==0.25.3"
5352
pytest-testdox = "==3.1.0"
5453

5554
[tool.black]
@@ -59,12 +58,6 @@ line-length = 99
5958
profile = "black"
6059
force_single_line = true
6160

62-
[tool.len8]
63-
include = ["noxfile.py", "tests", "wom"]
64-
code-length = 99
65-
docs-length = 80
66-
strict = true
67-
6861
[tool.mypy]
6962
packages = ["wom"]
7063
strict = true

wom/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from typing import Final
3333

3434
__packagename__: Final[str] = "wom.py"
35-
__version__: Final[str] = "1.0.1"
35+
__version__: Final[str] = "2.0.0"
3636
__author__: Final[str] = "Jonxslays"
3737
__copyright__: Final[str] = "2023-present Jonxslays"
3838
__description__: Final[str] = "An asynchronous wrapper for the Wise Old Man API."

wom/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ def records(self) -> services.RecordService:
170170
return self._records
171171

172172
def __init_service(self, service: t.Type[ServiceT]) -> ServiceT:
173-
if not issubclass(service, services.BaseService):
173+
if not issubclass(
174+
service, services.BaseService
175+
): # pyright: ignore[reportUnnecessaryIsInstance]
174176
raise TypeError(f"{service.__name__!r} can not be initialized as a service.")
175177

176178
return service(self._http, self._serializer)

wom/enums.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class Metric(BaseEnum):
120120
ClueScrollsHard = "clue_scrolls_hard"
121121
ClueScrollsElite = "clue_scrolls_elite"
122122
ClueScrollsMaster = "clue_scrolls_master"
123+
CollectionsLogged = "collections_logged"
123124
ColosseumGlory = "colosseum_glory"
124125
LastManStanding = "last_man_standing"
125126
PvpArena = "pvp_arena"
@@ -242,6 +243,7 @@ class Metric(BaseEnum):
242243
Metric.ClueScrollsHard,
243244
Metric.ClueScrollsElite,
244245
Metric.ClueScrollsMaster,
246+
Metric.CollectionsLogged,
245247
Metric.ColosseumGlory,
246248
Metric.LastManStanding,
247249
Metric.PvpArena,

wom/models/competitions/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class CompetitionParticipationDetail(CompetitionParticipation):
175175
competitions."""
176176

177177

178-
class CompetitionDetail(Competition):
178+
class CompetitionDetail(Competition): # type: ignore[override]
179179
"""Represents competition details."""
180180

181181
participations: t.List[CompetitionParticipationDetail] = [] # type: ignore[assignment]

wom/serializer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def get_decoder(self, model_type: t.Type[T]) -> Decoder[T]:
6868
The requested decoder.
6969
"""
7070
if not (decoder := self._decoders.get(model_type)):
71-
decoder = self._decoders[model_type] = Decoder(model_type)
71+
decoder = self._decoders[model_type] = Decoder( # pyright: ignore[reportArgumentType]
72+
model_type
73+
)
7274

7375
return decoder # type: ignore[return-value]

wom/services/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _get_request_func(self, method: str) -> t.Callable[..., t.Awaitable[t.Any]]:
109109
if not hasattr(self, "_method_mapping"):
110110
raise RuntimeError("HttpService.start was never called, aborting...")
111111

112-
return self._method_mapping[method] # type: ignore[return-value]
112+
return self._method_mapping[method]
113113

114114
async def _init_session(self) -> None:
115115
self._session = aiohttp.ClientSession(

0 commit comments

Comments
 (0)