MCPcopy Create free account
hub / github.com/python/mypy / verify_transitive_deps

Function verify_transitive_deps

mypy/build.py:4452–4470  ·  view source on GitHub ↗

Verify all indirect dependencies of this SCC are still reachable via direct ones. Return first unreachable dependency id, or None.

(ascc: SCC, graph: Graph, manager: BuildManager)

Source from the content-addressed store, hash-verified

4450
4451
4452def verify_transitive_deps(ascc: SCC, graph: Graph, manager: BuildManager) -> str | None:
4453 """Verify all indirect dependencies of this SCC are still reachable via direct ones.
4454
4455 Return first unreachable dependency id, or None.
4456 """
4457 for id in ascc.mod_ids:
4458 st = graph[id]
4459 assert st.meta is not None, "Must be called on fresh SCCs only"
4460 if st.trans_dep_hash == st.meta.trans_dep_hash:
4461 # Import graph unchanged, skip this module.
4462 continue
4463 for dep in st.dependencies:
4464 if st.priorities.get(dep) == PRI_INDIRECT:
4465 dep_scc_id = manager.scc_by_mod_id[dep].id
4466 if dep_scc_id == ascc.id:
4467 continue
4468 if not manager.is_transitive_scc_dep(ascc.id, dep_scc_id):
4469 return dep
4470 return None
4471
4472
4473def find_stale_sccs(

Callers 1

find_stale_sccsFunction · 0.85

Calls 2

is_transitive_scc_depMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…