diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,5 +1,5 @@ swh.core >= 0.0.7 -swh.loader.core >= 0.3.2 +swh.loader.core >= 0.3.9 swh.model >= 0.3.0 swh.scheduler >= 0.0.39 swh.storage >= 0.7.0 diff --git a/swh/loader/git/tests/__init__.py b/swh/loader/git/tests/__init__.py --- a/swh/loader/git/tests/__init__.py +++ b/swh/loader/git/tests/__init__.py @@ -2,22 +2,3 @@ # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information - -import os -import subprocess - -from typing import Optional - - -def prepare_repository_from_archive( - archive_path: str, - filename: Optional[str] = None, - tmp_path: str = "/tmp", - uncompress_archive: bool = True, -) -> str: - if uncompress_archive: - # uncompress folder/repositories/dump for the loader to ingest - subprocess.check_output(["tar", "xf", archive_path, "-C", tmp_path]) - # build the origin url (or some derivative form) - _fname = filename if filename else os.path.basename(archive_path) - return f"file://{tmp_path}/{_fname}" diff --git a/swh/loader/git/tests/test_from_disk.py b/swh/loader/git/tests/test_from_disk.py --- a/swh/loader/git/tests/test_from_disk.py +++ b/swh/loader/git/tests/test_from_disk.py @@ -14,12 +14,14 @@ from swh.model.model import Snapshot, SnapshotBranch, TargetType from swh.model.hashutil import hash_to_bytes -from swh.loader.tests.common import assert_last_visit_matches -from swh.loader.git.from_disk import GitLoaderFromDisk -from swh.loader.git.from_disk import GitLoaderFromArchive -from swh.loader.package.tests.common import check_snapshot, get_stats - -from swh.loader.git.tests import prepare_repository_from_archive +from swh.loader.git.from_disk import GitLoaderFromDisk, GitLoaderFromArchive + +from swh.loader.tests import ( + assert_last_visit_matches, + check_snapshot, + get_stats, + prepare_repository_from_archive, +) SNAPSHOT_ID = "a23699280a82a043f8c0994cf1631b568f716f95" diff --git a/swh/loader/git/tests/test_loader.py b/swh/loader/git/tests/test_loader.py --- a/swh/loader/git/tests/test_loader.py +++ b/swh/loader/git/tests/test_loader.py @@ -13,7 +13,7 @@ from swh.loader.git.loader import GitLoader from swh.loader.git.tests.test_from_disk import FullGitLoaderTests -from swh.loader.git.tests import prepare_repository_from_archive +from swh.loader.tests import prepare_repository_from_archive class GitLoaderTest(TestCase, FullGitLoaderTests):