Skip to content

Commit 0a1849b

Browse files
committed
infoflow/dta: Correct typing for NetworkX.
Quote the annotations so NetworkX is optional again. Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
1 parent 0f7a123 commit 0a1849b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

setools/dta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def results(self) -> Iterable[DTAPath] | Iterable[DomainTransition]:
278278
case _:
279279
raise ValueError(f"Unknown analysis mode: {self.mode}")
280280

281-
def graphical_results(self) -> nx.DiGraph:
281+
def graphical_results(self) -> "nx.DiGraph":
282282

283283
"""
284284
Return the results of the analysis as a NetworkX directed graph.
@@ -697,7 +697,7 @@ class Edge(mixins.NetworkXGraphEdge):
697697
The default is False.
698698
"""
699699

700-
G: nx.DiGraph
700+
G: "nx.DiGraph"
701701
source: policyrep.Type
702702
target: policyrep.Type
703703
create: InitVar[bool] = False

setools/infoflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def results(self) -> Iterable[InfoFlowPath] | Iterable["InfoFlowStep"]:
202202
case _:
203203
raise ValueError(f"Unknown analysis mode: {self.mode}")
204204

205-
def graphical_results(self) -> nx.DiGraph:
205+
def graphical_results(self) -> "nx.DiGraph":
206206

207207
"""
208208
Return the results of the analysis as a NetworkX directed graph.
@@ -432,7 +432,7 @@ class InfoFlowStep(mixins.NetworkXGraphEdge):
432432
The default is False.
433433
"""
434434

435-
G: nx.DiGraph
435+
G: "nx.DiGraph"
436436
source: policyrep.Type
437437
target: policyrep.Type
438438
create: InitVar[bool] = False

0 commit comments

Comments
 (0)