Compute stable snapshot of transitive import structure for given SCC.
(scc: SCC, graph: Graph)
| 5090 | |
| 5091 | |
| 5092 | def transitive_dep_hash(scc: SCC, graph: Graph) -> bytes: |
| 5093 | """Compute stable snapshot of transitive import structure for given SCC.""" |
| 5094 | all_direct_deps = sorted( |
| 5095 | { |
| 5096 | dep |
| 5097 | for id in scc.mod_ids |
| 5098 | for dep in graph[id].dependencies |
| 5099 | if graph[id].priorities.get(dep) != PRI_INDIRECT |
| 5100 | } |
| 5101 | ) |
| 5102 | buf = WriteBuffer() |
| 5103 | for dep_id in all_direct_deps: |
| 5104 | write_str_bare(buf, dep_id) |
| 5105 | if dep_id not in scc.mod_ids: |
| 5106 | write_bytes_bare(buf, graph[dep_id].trans_dep_hash) |
| 5107 | return hash_digest_bytes(buf.getvalue()) |
| 5108 | |
| 5109 | |
| 5110 | def missing_stubs_file(cache_dir: str) -> str: |
no test coverage detected
searching dependent graphs…