diff --git a/debian/control b/debian/control index acb33dc..1c17ee6 100644 --- a/debian/control +++ b/debian/control @@ -1,24 +1,25 @@ Source: swh-loader-tar Maintainer: Software Heritage developers Section: python Priority: optional Build-Depends: debhelper (>= 9), dh-python, python3-all, python3-nose, python3-setuptools, python3-swh.core (>= 0.0.14~), + python3-swh.scheduler, python3-swh.storage (>= 0.0.31~), python3-swh.loader.dir (>= 0.0.15~), python3-vcversioner Standards-Version: 3.9.6 Homepage: https://forge.softwareheritage.org/diffusion/DLDTAR/ Package: python3-swh.loader.tar Architecture: all Depends: python3-swh.core (>= 0.0.14~), python3-swh.storage (>= 0.0.31~), python3-swh.loader.dir (>= 0.0.15~), ${misc:Depends}, ${python3:Depends} Description: Software Heritage Tarball Loader diff --git a/requirements.txt b/requirements.txt index c45b6f0..9782908 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,9 @@ # Add here external Python modules dependencies, one per line. Module names # should match https://pypi.python.org/pypi names. For the full spec or # dependency lines, see https://pip.readthedocs.org/en/1.1/requirements.html vcversioner swh.core >= 0.0.14 +swh.scheduler swh.storage >= 0.0.31 swh.loader.dir >= 0.0.15 retrying diff --git a/swh/loader/tar/tasks.py b/swh/loader/tar/tasks.py index 94dc6c2..af48530 100644 --- a/swh/loader/tar/tasks.py +++ b/swh/loader/tar/tasks.py @@ -1,39 +1,39 @@ # Copyright (C) 2015 The Software Heritage developers # 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 -from swh.core.scheduling import Task +from swh.scheduler.task import Task from swh.loader.tar.loader import TarLoader class LoadTarRepository(Task): """Import a tarball to Software Heritage """ task_queue = 'swh_loader_tar' CONFIG_BASE_FILENAME = 'loader/tar.ini' ADDITIONAL_CONFIG = { 'extraction_dir': ('str', '/tmp/swh.loader.tar/'), } def __init__(self): self.config = TarLoader.parse_config_file( base_filename=self.CONFIG_BASE_FILENAME, additional_configs=[self.ADDITIONAL_CONFIG], ) def run(self, tarpath, origin, revision, release, occurrences): """Import a tarball into swh. Args: - tarpath: path to a tarball file - origin, revision, release, occurrences: cf. swh.loader.dir.loader.run docstring """ loader = TarLoader(self.config) loader.log = self.log loader.process(tarpath, origin, revision, release, occurrences)