diff --git a/java/src/main/java/org/softwareheritage/graph/experiments/topology/ConnectedComponents.java b/java/src/main/java/org/softwareheritage/graph/experiments/topology/ConnectedComponents.java --- a/java/src/main/java/org/softwareheritage/graph/experiments/topology/ConnectedComponents.java +++ b/java/src/main/java/org/softwareheritage/graph/experiments/topology/ConnectedComponents.java @@ -53,7 +53,8 @@ return config; } - private HashMap /* ArrayList> */ compute(ProgressLogger pl, boolean byOrigin) throws IOException { + private HashMap /* ArrayList> */ compute(ProgressLogger pl, boolean byOrigin) + throws IOException { final long n = graph.numNodes(); final long maxN = graph.maxNodeNumber(); diff --git a/java/src/main/java/org/softwareheritage/graph/maps/LabelMapBuilder.java b/java/src/main/java/org/softwareheritage/graph/maps/LabelMapBuilder.java --- a/java/src/main/java/org/softwareheritage/graph/maps/LabelMapBuilder.java +++ b/java/src/main/java/org/softwareheritage/graph/maps/LabelMapBuilder.java @@ -4,12 +4,9 @@ import it.unimi.dsi.big.webgraph.LazyLongIterator; import it.unimi.dsi.big.webgraph.labelling.ArcLabelledImmutableGraph; import it.unimi.dsi.big.webgraph.labelling.BitStreamArcLabelledImmutableGraph; -import it.unimi.dsi.fastutil.BigArrays; import it.unimi.dsi.fastutil.Size64; import it.unimi.dsi.fastutil.bytes.ByteArrays; -import it.unimi.dsi.fastutil.io.BinIO; import it.unimi.dsi.fastutil.io.FastBufferedInputStream; -import it.unimi.dsi.fastutil.longs.LongBigArrays; import it.unimi.dsi.fastutil.objects.Object2LongFunction; import it.unimi.dsi.io.OutputBitStream; import it.unimi.dsi.logging.ProgressLogger; @@ -45,7 +42,8 @@ long numFilenames; int totalLabelWidth; - public LabelMapBuilder(String graphPath, String debugPath, String outputGraphPath, String tmpDir) throws IOException { + public LabelMapBuilder(String graphPath, String debugPath, String outputGraphPath, String tmpDir) + throws IOException { this.graphPath = graphPath; if (outputGraphPath == null) { this.outputGraphPath = graphPath; diff --git a/java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java b/java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java --- a/java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java +++ b/java/src/main/java/org/softwareheritage/graph/maps/NodeIdMap.java @@ -119,8 +119,8 @@ } /** - * Converts byte-form SWHID to corresponding long node id. - * Low-level function, does not check if the SWHID is valid. + * Converts byte-form SWHID to corresponding long node id. Low-level function, does not check if the + * SWHID is valid. * * @param swhid node represented as bytes * @return corresponding node as a long id diff --git a/swh/graph/tests/conftest.py b/swh/graph/tests/conftest.py --- a/swh/graph/tests/conftest.py +++ b/swh/graph/tests/conftest.py @@ -10,11 +10,8 @@ from aiohttp.test_utils import TestClient, TestServer, loop_context import pytest -from swh.graph.backend import Backend from swh.graph.client import RemoteGraphClient -from swh.graph.graph import load as graph_load from swh.graph.naive_client import NaiveClient -from swh.graph.server.app import make_app SWH_GRAPH_TESTS_ROOT = Path(__file__).parents[0] TEST_GRAPH_PATH = SWH_GRAPH_TESTS_ROOT / "dataset/output/example" @@ -26,6 +23,10 @@ super().__init__(*args, **kwargs) def run(self): + # Lazy import to allow debian packaging + from swh.graph.backend import Backend + from swh.graph.server.app import make_app + try: backend = Backend(graph_path=str(TEST_GRAPH_PATH)) with loop_context() as loop: @@ -60,5 +61,8 @@ @pytest.fixture(scope="module") def graph(): + # Lazy import to allow debian packaging + from swh.graph.graph import load as graph_load + with graph_load(str(TEST_GRAPH_PATH)) as g: yield g