diff --git a/.github/workflows/run-unittest.yml b/.github/workflows/run-unittest.yml index 46179fa..7a172c0 100644 --- a/.github/workflows/run-unittest.yml +++ b/.github/workflows/run-unittest.yml @@ -5,7 +5,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", 3.11, 3.12] + # python-version: [3.11, 3.12] TODO + python-version: [3.12] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/deduplidog/__init__.py b/deduplidog/__init__.py new file mode 100644 index 0000000..80f936a --- /dev/null +++ b/deduplidog/__init__.py @@ -0,0 +1,3 @@ +from .deduplidog import Deduplidog + +__all__ = ["Deduplidog"] diff --git a/deduplidog/deduplidog.py b/deduplidog/deduplidog.py index 34bf4d2..6744895 100644 --- a/deduplidog/deduplidog.py +++ b/deduplidog/deduplidog.py @@ -123,7 +123,7 @@ class Deduplidog: debug: bool = None fail_on_error: bool = False shorter_log: bool = True - "If True, common prefix of the file names are not output to the log to save space." + "TODO deprecated If True, common prefix of the file names are not output to the log to save space." logging_level: int = logging.WARNING ending_counter = re.compile(r"\(\d+\)$") @@ -160,6 +160,7 @@ def __post_init__(self): "Original files, grouped by stem" self._common_prefix_length = 0 + " TODO deprecated" # Distinguish paths for a, b in zip(Path(self.work_dir).parts, Path(self.original_dir).parts): diff --git a/pyproject.toml b/pyproject.toml index 4717927..b17ef87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.poetry] +name = "deduplidog" version = "0.5.0" description = "Deduplicate folders" authors = ["Edvard Rejthar "] @@ -12,7 +13,9 @@ license = "GPL-3.0-or-later" python = ">=3.11" humanize = "*" imagehash = "*" +IPython = "*" +ipywidgets = "*" opencv-python = "*" -PIL = "*" +Pillow = "*" sh = "*" tqdm = "*" \ No newline at end of file diff --git a/tests.py b/tests.py index c695de7..61d7e05 100644 --- a/tests.py +++ b/tests.py @@ -1,17 +1,15 @@ from dataclasses import dataclass -from datetime import datetime from itertools import chain -import logging import os from pathlib import Path -from tempfile import TemporaryDirectory, mkdtemp +from tempfile import TemporaryDirectory from typing import Self from unittest import TestCase, main import random import string -from deduplidog.deduplidog import Deduplidog # TODO: change to from deduplidog import Deduplidog +from deduplidog import Deduplidog @dataclass @@ -22,7 +20,7 @@ class FileRepresentation: text_seed: int = 1 def __post_init__(self): - self._mtime = self.path.parent.stat().st_mtime + self.mtime + self._mtime = round(self.path.parent.parent.stat().st_mtime + self.mtime) def write(self): "Writes the representation to the disk." @@ -76,7 +74,7 @@ def check(self, prefixed: tuple[int] = None, suck: tuple[int] = None): class TestDeduplidog(TestCase): def prepare(self, testing_dir: str = None): - temp = Path(testing_dir) if testing_dir else Path(mkdtemp()) # TODO: TemporaryDirectory() + temp = Path(testing_dir) if testing_dir else TemporaryDirectory().name originals = Path(temp, "originals") work_dir = Path(temp, "work_dir") if not testing_dir: