diff --git a/swh/vault/cookers/git_bare.py b/swh/vault/cookers/git_bare.py --- a/swh/vault/cookers/git_bare.py +++ b/swh/vault/cookers/git_bare.py @@ -27,7 +27,6 @@ import zlib from swh.core.api.classes import stream_results -from swh.graph.client import GraphArgumentException from swh.model import identifiers from swh.model.hashutil import hash_to_bytehex, hash_to_hex from swh.model.model import ( @@ -235,6 +234,8 @@ loaded_from_graph = False if self.graph: + from swh.graph.client import GraphArgumentException + # First, try to cook using swh-graph, as it is more efficient than # swh-storage for querying the history obj_swhid = identifiers.CoreSWHID( diff --git a/swh/vault/tests/test_git_bare_cooker.py b/swh/vault/tests/test_git_bare_cooker.py --- a/swh/vault/tests/test_git_bare_cooker.py +++ b/swh/vault/tests/test_git_bare_cooker.py @@ -18,7 +18,6 @@ import pytest -from swh.graph.naive_client import NaiveClient as GraphClient from swh.model.from_disk import DentryPerms from swh.model.model import ( Content, @@ -122,8 +121,11 @@ return (cnt1, cnt2, dir1, dir2, rev1, rev2, nodes, edges) +@pytest.mark.graph @pytest.mark.parametrize("last_revision_in_graph", [True, False]) def test_graph_revisions(swh_storage, last_revision_in_graph): + from swh.graph.naive_client import NaiveClient as GraphClient + (cnt1, cnt2, dir1, dir2, rev1, rev2, nodes, edges) = get_objects( last_revision_in_graph )