Skip to content

Commit 99b1358

Browse files
committed
Don't consider indirect dependencies when calculating SCCs
SCC construction should only consider import dependencies, since indirect dependencies are not available during non-incremental runs. I think otherwise SCCs can be different in non-incremental vs incremtal runs. Attempt to fix an issue with excessively large SCCs computed (sometimes) after #19798 when doing incremental runs. I haven't been able to create a self-contained test case that reproduces the issue, but this appears to fix this issue with an internal codebase.
1 parent feeb3f0 commit 99b1358

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)