Apply extra heuristics on top of order_ascc(). This should be used only for actual SCCs, not for "inner" SCCs we create recursively during ordering of the SCC. Currently, this has only some special handling for builtin SCC.
(graph: Graph, ascc: SCC)
| 4427 | |
| 4428 | |
| 4429 | def order_ascc_ex(graph: Graph, ascc: SCC) -> list[str]: |
| 4430 | """Apply extra heuristics on top of order_ascc(). |
| 4431 | |
| 4432 | This should be used only for actual SCCs, not for "inner" SCCs |
| 4433 | we create recursively during ordering of the SCC. Currently, this |
| 4434 | has only some special handling for builtin SCC. |
| 4435 | """ |
| 4436 | scc = order_ascc(graph, ascc.mod_ids) |
| 4437 | # Make the order of the SCC that includes 'builtins' and 'typing', |
| 4438 | # among other things, predictable. Various things may break if |
| 4439 | # the order changes. |
| 4440 | if "builtins" in ascc.mod_ids: |
| 4441 | scc = sorted(scc, reverse=True) |
| 4442 | # If builtins is in the list, move it last. (This is a bit of |
| 4443 | # a hack, but it's necessary because the builtins module is |
| 4444 | # part of a small cycle involving at least {builtins, abc, |
| 4445 | # typing}. Of these, builtins must be processed last or else |
| 4446 | # some builtin objects will be incompletely processed.) |
| 4447 | scc.remove("builtins") |
| 4448 | scc.append("builtins") |
| 4449 | return scc |
| 4450 | |
| 4451 | |
| 4452 | def verify_transitive_deps(ascc: SCC, graph: Graph, manager: BuildManager) -> str | None: |
no test coverage detected
searching dependent graphs…