Skip to content

Commit 354bea6

Browse files
authored
Don't consider indirect dependencies when calculating SCCs (#19903)
SCC construction should only need to consider import dependencies, since indirect dependencies are not available during non-incremental runs, and we want SCCs to be identical in incremental and non-incremental runs. This may improve performance slightly and will make mypy more robust in case there are extra indirect dependencies (see #19906).
1 parent d96b9dc commit 354bea6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3488,7 +3488,7 @@ def process_stale_scc(graph: Graph, scc: list[str], manager: BuildManager) -> No
34883488

34893489

34903490
def sorted_components(
3491-
graph: Graph, vertices: AbstractSet[str] | None = None, pri_max: int = PRI_ALL
3491+
graph: Graph, vertices: AbstractSet[str] | None = None, pri_max: int = PRI_INDIRECT
34923492
) -> list[AbstractSet[str]]:
34933493
"""Return the graph's SCCs, topologically sorted by dependencies.
34943494

0 commit comments

Comments
 (0)