Generate fine-grained dependencies into a form suitable for serializing. This does a couple things: 1. Splits fine-grained deps based on the module of the trigger 2. For each module we generated fine-grained deps for, load any previous deps and merge them in. Returns a dicti
(manager: BuildManager, graph: Graph)
| 1693 | |
| 1694 | |
| 1695 | def generate_deps_for_cache(manager: BuildManager, graph: Graph) -> dict[str, dict[str, set[str]]]: |
| 1696 | """Generate fine-grained dependencies into a form suitable for serializing. |
| 1697 | |
| 1698 | This does a couple things: |
| 1699 | 1. Splits fine-grained deps based on the module of the trigger |
| 1700 | 2. For each module we generated fine-grained deps for, load any previous |
| 1701 | deps and merge them in. |
| 1702 | |
| 1703 | Returns a dictionary from module ids to all dependencies on that |
| 1704 | module. Dependencies not associated with a module in the build will be |
| 1705 | associated with the nearest parent module that is in the build, or the |
| 1706 | fake module FAKE_ROOT_MODULE if none are. |
| 1707 | """ |
| 1708 | from mypy.server.deps import merge_dependencies # Lazy import to speed up startup |
| 1709 | |
| 1710 | # Split the dependencies out into based on the module that is depended on. |
| 1711 | rdeps = invert_deps(manager.fg_deps, graph) |
| 1712 | |
| 1713 | # We can't just clobber existing dependency information, so we |
| 1714 | # load the deps for every module we've generated new dependencies |
| 1715 | # to and merge the new deps into them. |
| 1716 | for module, mdeps in rdeps.items(): |
| 1717 | old_deps = manager.load_fine_grained_deps(module) |
| 1718 | merge_dependencies(old_deps, mdeps) |
| 1719 | |
| 1720 | return rdeps |
| 1721 | |
| 1722 | |
| 1723 | PLUGIN_SNAPSHOT_FILE: Final = "@plugins_snapshot.json" |
no test coverage detected
searching dependent graphs…