Skip to content

Commit c6682d3

Browse files
Fix tests (#197)
- Update dependencies - Update metron service as part of Seagrin update - Add pylock.toml
1 parent f4f0eab commit c6682d3

7 files changed

Lines changed: 3144 additions & 666 deletions

File tree

.github/workflows/testing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Install project
4545
run: uv sync --locked --no-dev --all-extras --group tests --managed-python
4646
- name: Run tests
47-
run: uv run pytest
47+
run: uv run --no-dev pytest
4848

4949
check:
5050
if: always()

perdoo/comic/metadata/comic_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def get_filename(self) -> str:
303303

304304

305305
PATTERN_MAP: dict[str, Callable[[ComicInfo], str | int | None]] = {
306-
"cover-date": lambda x: x.cover_date,
306+
"cover-date": lambda x: str(x.cover_date) if x.cover_date else None,
307307
"cover-day": lambda x: x.day,
308308
"cover-month": lambda x: x.month,
309309
"cover-year": lambda x: x.year,

perdoo/comic/metadata/metron_info.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def ensure_timezone(cls, v: str | datetime | None) -> str | datetime | None:
397397

398398

399399
PATTERN_MAP: dict[str, Callable[[MetronInfo], str | int | None]] = {
400-
"cover-date": lambda x: x.cover_date,
400+
"cover-date": lambda x: str(x.cover_date) if x.cover_date else None,
401401
"cover-day": lambda x: x.cover_date.day if x.cover_date else None,
402402
"cover-month": lambda x: x.cover_date.month if x.cover_date else None,
403403
"cover-year": lambda x: x.cover_date.year if x.cover_date else None,
@@ -414,10 +414,10 @@ def ensure_timezone(cls, v: str | datetime | None) -> str | datetime | None:
414414
"series-name": lambda x: x.series.name,
415415
"series-sort-name": lambda x: x.series.sort_name,
416416
"series-year": lambda x: x.series.start_year,
417-
"store-date": lambda x: x.store_date or "",
418-
"store-year": lambda x: x.store_date.year if x.store_date else "",
419-
"store-month": lambda x: x.store_date.month if x.store_date else "",
420-
"store-day": lambda x: x.store_date.day if x.store_date else "",
417+
"store-date": lambda x: str(x.store_date) if x.store_date else None,
418+
"store-year": lambda x: x.store_date.year if x.store_date else None,
419+
"store-month": lambda x: x.store_date.month if x.store_date else None,
420+
"store-day": lambda x: x.store_date.day if x.store_date else None,
421421
"title": lambda x: x.collection_title,
422422
"upc": lambda x: x.gtin.upc if x.gtin else None,
423423
"volume": lambda x: x.series.volume or 1,

perdoo/services/metron.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from natsort import humansorted, ns
77
from prompt_toolkit.styles import Style
88
from questionary import Choice, confirm, select, text
9-
from seagrin.cache import SQLiteCache
109
from seagrin.errors import ServiceError
1110
from seagrin.metron import Metron as Seagrin
1211
from seagrin.schemas import Issue, Series
@@ -23,8 +22,9 @@
2322

2423
class Metron(BaseService[Series, Issue]):
2524
def __init__(self, username: str, password: str):
26-
cache = SQLiteCache(path=get_cache_root() / "seagrin.sqlite")
27-
self.session = Seagrin(username=username, password=password, cache=cache)
25+
self.session = Seagrin(
26+
username=username, password=password, cache=get_cache_root() / "seagrin.sqlite"
27+
)
2828

2929
def _search_series_by_comicvine(self, comicvine_id: int | None) -> int | None:
3030
if not comicvine_id:

pylock.toml

Lines changed: 2292 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ dev = [
77
"mdformat >= 1.0.0",
88
"mdformat-gfm >= 1.0.0",
99
"mdformat-ruff >= 0.1.0",
10-
"prek >= 0.3.0",
10+
"prek >= 0.4.0",
1111
"ruff >= 0.15.0",
1212
"toml-sort >= 0.24.0",
13-
"ty >= 0.0.20",
13+
"ty >= 0.0.30",
1414
]
1515
tests = [
1616
"pytest >= 9.0.0",
17-
"pytest-cov >= 7.0.0",
18-
"tox >= 4.49.0",
19-
"tox-uv >= 1.33.0",
17+
"pytest-cov >= 7.1.0",
18+
"tox >= 4.54.0",
19+
"tox-uv >= 1.35.0",
2020
]
2121

2222
[project]
2323
authors = [
24-
{email = "BuriedInCode@tuta.io", name = "BuriedInCode"},
24+
{email = "buriedincode@duckpond.nz", name = "BuriedInCode"},
2525
]
2626
classifiers = [
2727
"Development Status :: 4 - Beta",
@@ -35,30 +35,35 @@ classifiers = [
3535
"Programming Language :: Python :: 3.12",
3636
"Programming Language :: Python :: 3.13",
3737
"Programming Language :: Python :: 3.14",
38+
"Programming Language :: Python",
39+
"Topic :: Internet",
3840
"Typing :: Typed",
3941
]
4042
dependencies = [
41-
"comicfn2dict >= 0.2.0",
43+
"comicfn2dict >= 0.3.0",
4244
"grayven >= 0.5.0",
4345
"natsort >= 8.4.0",
44-
"pillow >= 12.1.0",
45-
"pydantic >= 2.12.0",
46-
"pydantic-xml[lxml] >= 2.19.0",
46+
"pillow >= 12.2.0",
47+
"pydantic >= 2.13.0",
48+
"pydantic-xml[lxml] >= 2.21.0",
4749
"questionary >= 2.1.0",
4850
"rarfile >= 4.2",
49-
"rich >= 14.3.0",
50-
"seagrin >= 0.4.0",
51+
"rich >= 15.0.0",
52+
"seagrin >= 2026.1.0",
5153
"simyan >= 2.0.0",
5254
"tomli >= 2.4.0 ; python_version < '3.11'",
5355
"tomli-w >= 1.2.0",
54-
"typer >= 0.24.0",
56+
"typer >= 0.25.0",
5557
"zipremove >= 0.8.0",
5658
]
5759
description = "Unify and organize your comic collection."
5860
dynamic = ["version"]
5961
keywords = ["comic", "comics", "metadata", "tagger", "tagging"]
6062
license = "MIT"
6163
license-files = ["LICENSE"]
64+
maintainers = [
65+
{email = "buriedincode@duckpond.nz", name = "BuriedInCode"},
66+
]
6267
name = "perdoo"
6368
readme = "README.md"
6469
requires-python = ">= 3.10"
@@ -84,7 +89,7 @@ show_missing = true
8489
source = ["perdoo"]
8590

8691
[tool.hatch.build.targets.sdist]
87-
exclude = [".github/"]
92+
exclude = [".crow/", ".github/", ".woodpecker/"]
8893

8994
[tool.hatch.version]
9095
path = "perdoo/__init__.py"

0 commit comments

Comments
 (0)