(module_id: str, path: str, graph: Graph, manager: BuildManager)
| 711 | |
| 712 | |
| 713 | def delete_module(module_id: str, path: str, graph: Graph, manager: BuildManager) -> None: |
| 714 | manager.log_fine_grained(f"delete module {module_id!r}") |
| 715 | # TODO: Remove deps for the module (this only affects memory use, not correctness) |
| 716 | if module_id in graph: |
| 717 | del graph[module_id] |
| 718 | if module_id in manager.modules: |
| 719 | del manager.modules[module_id] |
| 720 | components = module_id.split(".") |
| 721 | if len(components) > 1: |
| 722 | # Delete reference to module in parent module. |
| 723 | parent_id = ".".join(components[:-1]) |
| 724 | # If parent module is ignored, it won't be included in the modules dictionary. |
| 725 | if parent_id in manager.modules: |
| 726 | parent = manager.modules[parent_id] |
| 727 | if components[-1] in parent.names: |
| 728 | del parent.names[components[-1]] |
| 729 | # If the module is removed from the build but still exists, then |
| 730 | # we mark it as missing so that it will get picked up by import from still. |
| 731 | if manager.fscache.isfile(path): |
| 732 | # TODO: check if there is an equivalent of #20800 for the daemon. |
| 733 | manager.missing_modules[module_id] = SuppressionReason.NOT_FOUND |
| 734 | |
| 735 | |
| 736 | def dedupe_modules(modules: list[tuple[str, str]]) -> list[tuple[str, str]]: |
no test coverage detected
searching dependent graphs…