Skip to content

Commit da69c46

Browse files
Update darkseid to v7
1 parent e52a428 commit da69c46

5 files changed

Lines changed: 631 additions & 112 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.12.2
3+
rev: v0.12.4
44
hooks:
55
- id: ruff-format
66
- id: ruff-check

perdoo/comic.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
from pathlib import Path
66
from typing import Final, TypeVar
77

8-
from darkseid.archivers import Archiver, ArchiverFactory, ZipArchiver
8+
from darkseid.archivers import (
9+
PY7ZR_AVAILABLE,
10+
Archiver,
11+
ArchiverFactory,
12+
SevenZipArchiver,
13+
ZipArchiver,
14+
)
915
from darkseid.comic import (
1016
COMIC_RACK_FILENAME,
1117
METRON_INFO_FILENAME,
@@ -18,9 +24,6 @@
1824
from perdoo.metadata import ComicInfo, MetronInfo
1925
from perdoo.settings import Naming
2026

21-
PY7ZR_AVAILABLE = False
22-
SevenZipArchiver = None
23-
2427
LOGGER = logging.getLogger(__name__)
2528
T = TypeVar("T", bound=ComicInfo | MetronInfo)
2629

@@ -112,7 +115,7 @@ def clean_archive(self) -> None:
112115
filepath.name not in {COMIC_RACK_FILENAME, METRON_INFO_FILENAME}
113116
and filepath.suffix.lower() not in SUPPORTED_IMAGE_EXTENSIONS
114117
):
115-
source.remove_file(archive_file=filename)
118+
source.remove_files(filename_list=[filename])
116119
LOGGER.info("Removed '%s' from '%s'", filename, source.path.name)
117120

118121
def write_metadata(self, metadata: ComicInfo | MetronInfo | None) -> None:
@@ -151,7 +154,7 @@ def _rename_images(self, base_name: str) -> None:
151154
if new_file.stem != img_file.stem:
152155
LOGGER.info("Renaming '%s' to '%s'", img_file.stem, new_file.stem)
153156
file_contents = source.read_file(archive_file=filename)
154-
source.remove_file(archive_file=filename)
157+
source.remove_files(filename_list=[filename])
155158
source.write_file(archive_file=new_file.name, data=file_contents)
156159

157160
def rename(self, naming: Naming, output_folder: Path) -> None:

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dev = [
99
tests = [
1010
"pytest >= 8.4.1",
1111
"pytest-cov >= 6.2.1",
12-
"tox >= 4.27.0",
12+
"tox >= 4.28.0",
1313
"tox-uv >= 1.26.1"
1414
]
1515

@@ -35,16 +35,16 @@ classifiers = [
3535
]
3636
dependencies = [
3737
"comicfn2dict >= 0.2.5",
38-
"darkseid >= 6.0.0",
38+
"darkseid >= 7.0.0",
3939
"esak >= 2.0.0",
4040
"lxml >= 6.0.0",
4141
"mokkari >= 3.13.0",
4242
"natsort >= 8.4.0",
43-
"pillow >= 10.4.0",
43+
"pillow >= 11.3.0",
4444
"pydantic >= 2.11.7",
4545
"pydantic-xml >= 2.17.3",
4646
"rich >= 14.0.0",
47-
"simyan >= 1.5.0",
47+
"simyan >= 1.5.1",
4848
"tomli >= 2.2.1 ; python_version < '3.11'",
4949
"tomli-w >= 1.2.0",
5050
"typer >= 0.16.0",
@@ -59,7 +59,7 @@ requires-python = ">= 3.10"
5959

6060
[project.optional-dependencies]
6161
cb7 = [
62-
"darkseid[7zip] >= 6.0.0"
62+
"darkseid[7zip] >= 7.0.0"
6363
]
6464

6565
[project.scripts]

tests/comic_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ def test_clean_archive(cbz_comic: Comic) -> None:
4242
cbz_comic._archiver.get_filename_list = MagicMock( # noqa: SLF001
4343
return_value=["image1.jpg", "info.txt", "ComicInfo.xml", "cover.png"]
4444
)
45-
cbz_comic._archiver.remove_file = MagicMock() # noqa: SLF001
45+
cbz_comic._archiver.remove_files = MagicMock() # noqa: SLF001
4646

4747
cbz_comic.clean_archive()
48-
cbz_comic._archiver.remove_file.assert_called_once_with(archive_file="info.txt") # noqa: SLF001
48+
cbz_comic._archiver.remove_files.assert_called_once() # noqa: SLF001
49+
cbz_comic._archiver.remove_files.assert_called_once_with(filename_list=["info.txt"]) # noqa: SLF001
4950

5051

5152
def test_write_comicinfo(cbz_comic: Comic, comic_info: ComicInfo) -> None:

0 commit comments

Comments
 (0)