Skip to content

Commit 83018f0

Browse files
authored
v7.0.0 (#185)
* Remove old unused code * Update README.md
1 parent 1448280 commit 83018f0

File tree

6 files changed

+109
-139
lines changed

6 files changed

+109
-139
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ A [Python](https://www.python.org/) library to interact with comic archives.
1313
pip install darkseid
1414
```
1515

16+
There are optional dependencies which can be installed by specifying one or more
17+
of them in braces e.g. darkseid[7zip]
18+
19+
The optional dependencies are:
20+
21+
- **7zip**: Provides support for reading/writing to CB7 files.
22+
- **pillow**: Provides support for getting page information that is used with
23+
ComicInfo.xml metadata.
24+
1625
## Example
1726

1827
```python

darkseid/archivers/zip.py

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ class ZipArchiver(Archiver):
4848
- Writing new files or updating existing ones
4949
- Removing single files or multiple files in batch
5050
- Copying entire archive contents to a new ZIP file
51-
- Automatic cleanup of temporary files and partial operations
51+
- Automatic cleanup of partial operations
5252
5353
Attributes:
5454
path (Path): Path to the ZIP archive file
55-
_temp_files (list[Path]): List of temporary files created during operations
5655
5756
Examples:
5857
>>> archiver = ZipArchiver(Path("my_archive.zip"))
@@ -69,13 +68,9 @@ def __init__(self, path: Path) -> None:
6968
path: Path to the ZIP archive file. The file doesn't need to exist
7069
yet - it will be created when first written to.
7170
72-
Note:
73-
The archiver maintains a list of temporary files that will be
74-
automatically cleaned up when the object is destroyed.
7571
7672
"""
7773
super().__init__(path)
78-
self._temp_files: list[Path] = []
7974

8075
def read_file(self, archive_file: str) -> bytes:
8176
"""Read the contents of a file from the ZIP archive.
@@ -355,39 +350,3 @@ def _cleanup_partial_file(self) -> None:
355350
self.path.unlink()
356351
except OSError as e:
357352
logger.warning("Could not remove partial file %s: %s", self.path, e)
358-
359-
def _cleanup_temp_files(self) -> None:
360-
"""Clean up any temporary files created during operations.
361-
362-
Removes all temporary files tracked in _temp_files and clears the list.
363-
This is automatically called when the archiver is destroyed, but can
364-
also be called manually for immediate cleanup.
365-
366-
Note:
367-
- Silently continues if temp files don't exist
368-
- Logs warnings for removal failures
369-
- Clears the temp files list after cleanup attempt
370-
371-
"""
372-
for temp_file in self._temp_files:
373-
if temp_file.exists():
374-
try:
375-
temp_file.unlink()
376-
except OSError as e:
377-
logger.warning("Could not remove temp file %s: %s", temp_file, e)
378-
self._temp_files.clear()
379-
380-
def __del__(self) -> None:
381-
"""Clean up resources when archiver is destroyed.
382-
383-
Ensures all temporary files are cleaned up when the archiver object
384-
is garbage collected. This provides a safety net for resource cleanup
385-
even if explicit cleanup is not performed.
386-
387-
Note:
388-
- Automatically called by Python's garbage collector
389-
- Provides fail-safe cleanup of temporary resources
390-
- Should not be called directly - use _cleanup_temp_files() instead
391-
392-
"""
393-
self._cleanup_temp_files()

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "7.0.0rc1",
2+
"version": "7.0.0",
33
"description": "darkseid linting",
44
"type": "module",
55
"scripts": {

pyproject.toml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
[project]
22
name = "darkseid"
3-
version = "7.0.0rc1"
3+
version = "7.0.0"
44
description = "A library to interact with comic archives"
55
authors = [{ name = "Brian Pepple", email = "[email protected]" }]
66
requires-python = ">=3.10"
77
readme = "README.md"
88
license = "GPL-3.0-or-later"
99
maintainers = [{ name = "Brian Pepple", email = "[email protected]" }]
10-
keywords = ["comic", "cbz", "cbr", "metadata", "comicinfo", "metroninfo"]
10+
keywords = [
11+
"comic",
12+
"cbz",
13+
"cbr",
14+
"cb7",
15+
"cbt",
16+
"metadata",
17+
"comicinfo",
18+
"metroninfo",
19+
]
1120
classifiers = [
1221
"Development Status :: 5 - Production/Stable",
1322
"Intended Audience :: Developers",
@@ -50,16 +59,16 @@ dev = [
5059
"radon[toml]>=6.0.1,<7",
5160
"ruff>=0.11.0",
5261
"types-python-dateutil>=2.8.19,<3",
53-
"vulture~=2.3",
5462
"hatchling>=1.27.0",
63+
"vulture>=2.14",
5564
]
5665
test = [
57-
"coverage[toml]~=7.0",
58-
"pytest-cov>=5.0.0,<6",
59-
"pytest-mock>=3.14.0,<4",
66+
"coverage[toml]>=7.9.2",
67+
"lxml>=6.0.0",
68+
"pytest-cov>=6.2.1",
69+
"pytest-mock>=3.14.1",
6070
"tox>=4.14.2,<5",
6171
"tox-uv>=1.25.0",
62-
"lxml>=5.1.0,<6",
6372
]
6473
docs = [
6574
"mkdocs>=1.6.0,<2",

0 commit comments

Comments
 (0)