Skip to content

Commit 4d06613

Browse files
authored
Merge pull request #7 from FalkorDB/delay-git-import
lazy load git module
2 parents 0c12474 + 922cfea commit 4d06613

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

code_graph/project.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import logging
44
import validators
55
import subprocess
6-
from git import Repo
76
from .info import *
87
from pathlib import Path
98
from .graph import Graph
@@ -61,6 +60,7 @@ def from_git_repository(cls, url: str):
6160

6261
@classmethod
6362
def from_local_repository(cls, path: Path|str):
63+
from git import Repo
6464
path = Path(path) if isinstance(path, str) else path
6565

6666
# Validate path exists
@@ -77,6 +77,7 @@ def from_local_repository(cls, path: Path|str):
7777
return cls(name, path, url)
7878

7979
def analyze_sources(self, ignore: Optional[List[str]] = []) -> Graph:
80+
from git import Repo
8081
analyzer = SourceAnalyzer()
8182
analyzer.analyze(self.path, self.graph, ignore)
8283

0 commit comments

Comments
 (0)