diff --git a/debian/control b/debian/control index f08a3b0..22c71ac 100644 --- a/debian/control +++ b/debian/control @@ -1,28 +1,29 @@ Source: swh-loader-git Maintainer: Software Heritage developers Section: python Priority: optional Build-Depends: debhelper (>= 9), dh-python, python3-all, - python3-nose, + python3-click, python3-dulwich, + python3-nose, python3-retrying, python3-setuptools, - python3-click, python3-swh.core (>= 0.0.7~), python3-swh.model (>= 0.0.15~), - python3-swh.scheduler, + python3-swh.scheduler (>= 0.0.14~), python3-swh.storage (>= 0.0.83~), python3-vcversioner Standards-Version: 3.9.6 Homepage: https://forge.softwareheritage.org/diffusion/DLDG/ Package: python3-swh.loader.git Architecture: all Depends: python3-swh.core (>= 0.0.7~), - python3-swh.storage (>= 0.0.83~), python3-swh.model (>= 0.0.15~), + python3-swh.scheduler (>= 0.0.14~), + python3-swh.storage (>= 0.0.83~), ${misc:Depends}, ${python3:Depends} Description: Software Heritage Git loader diff --git a/requirements-swh.txt b/requirements-swh.txt index 2367d10..f0dd184 100644 --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,4 +1,4 @@ swh.core >= 0.0.7 swh.model >= 0.0.15 -swh.scheduler +swh.scheduler >= 0.0.14 swh.storage >= 0.0.83 diff --git a/swh/loader/git/tasks.py b/swh/loader/git/tasks.py index f941e08..5f449af 100644 --- a/swh/loader/git/tasks.py +++ b/swh/loader/git/tasks.py @@ -1,70 +1,70 @@ # Copyright (C) 2015-2017 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 import dateutil.parser from swh.scheduler.task import Task from .loader import GitLoader, GitLoaderFromArchive from .updater import BulkUpdater from .reader import GitSha1RemoteReaderAndSendToQueue # TODO: rename to LoadRemoteGitRepository class UpdateGitRepository(Task): """Import a git repository from a remote location""" task_queue = 'swh_loader_git' - def run(self, repo_url, base_url=None): + def run_task(self, repo_url, base_url=None): """Import a git repository""" loader = BulkUpdater() loader.log = self.log return loader.load(repo_url, base_url) class LoadDiskGitRepository(Task): """Import a git repository from disk""" task_queue = 'swh_loader_git_express' - def run(self, origin_url, directory, date): + def run_task(self, origin_url, directory, date): """Import a git repository, cloned in `directory` from `origin_url` at `date`.""" loader = GitLoader() loader.log = self.log return loader.load(origin_url, directory, dateutil.parser.parse(date)) class UncompressAndLoadDiskGitRepository(Task): """Import a git repository from a zip archive""" task_queue = 'swh_loader_git_archive' - def run(self, origin_url, archive_path, date): + def run_task(self, origin_url, archive_path, date): """1. Uncompress an archive repository in a local and temporary folder 2. Load it through the git disk loader 3. Clean up the temporary folder """ loader = GitLoaderFromArchive() loader.log = self.log return loader.load( origin_url, archive_path, dateutil.parser.parse(date)) class ReaderGitRepository(Task): task_queue = 'swh_reader_git' - def run(self, repo_url, base_url=None): + def run_task(self, repo_url, base_url=None): """Read a git repository from a remote location and send sha1 to archival. """ loader = GitSha1RemoteReaderAndSendToQueue() loader.log = self.log return loader.load(repo_url)