Find if there are any submodules of packages that are now missing. This is conceptually an inverse of exist_added_packages().
(dependencies: list[str], manager: BuildManager)
| 3839 | |
| 3840 | |
| 3841 | def exist_removed_submodules(dependencies: list[str], manager: BuildManager) -> bool: |
| 3842 | """Find if there are any submodules of packages that are now missing. |
| 3843 | |
| 3844 | This is conceptually an inverse of exist_added_packages(). |
| 3845 | """ |
| 3846 | dependencies_set = set(dependencies) |
| 3847 | for dep in dependencies: |
| 3848 | if "." not in dep: |
| 3849 | continue |
| 3850 | if dep in manager.source_set.source_modules: |
| 3851 | # We still know it is definitely a module. |
| 3852 | continue |
| 3853 | direct_ancestor, _ = dep.rsplit(".", maxsplit=1) |
| 3854 | if direct_ancestor not in dependencies_set: |
| 3855 | continue |
| 3856 | if find_module_simple(dep, manager) is None: |
| 3857 | return True |
| 3858 | return False |
| 3859 | |
| 3860 | |
| 3861 | def find_module_simple(id: str, manager: BuildManager) -> str | None: |
no test coverage detected
searching dependent graphs…