(
self, sources: list[BuildSource], changed_paths: AbstractSet[str]
)
| 883 | return self._find_changed(sources, changed_paths) |
| 884 | |
| 885 | def _find_changed( |
| 886 | self, sources: list[BuildSource], changed_paths: AbstractSet[str] |
| 887 | ) -> ChangesAndRemovals: |
| 888 | # Find anything that has been added or modified |
| 889 | changed = [ |
| 890 | (source.module, source.path) |
| 891 | for source in sources |
| 892 | if source.path and source.path in changed_paths |
| 893 | ] |
| 894 | |
| 895 | # Now find anything that has been removed from the build |
| 896 | modules = {source.module for source in sources} |
| 897 | omitted = [source for source in self.previous_sources if source.module not in modules] |
| 898 | removed = [] |
| 899 | for source in omitted: |
| 900 | path = source.path |
| 901 | assert path |
| 902 | removed.append((source.module, path)) |
| 903 | |
| 904 | self.add_explicitly_new(sources, changed) |
| 905 | |
| 906 | # Find anything that has had its module path change because of added or removed __init__s |
| 907 | last = {s.path: s.module for s in self.previous_sources} |
| 908 | for s in sources: |
| 909 | assert s.path |
| 910 | if s.path in last and last[s.path] != s.module: |
| 911 | # Mark it as removed from its old name and changed at its new name |
| 912 | removed.append((last[s.path], s.path)) |
| 913 | changed.append((s.module, s.path)) |
| 914 | |
| 915 | return changed, removed |
| 916 | |
| 917 | def add_explicitly_new( |
| 918 | self, sources: list[BuildSource], changed: list[tuple[str, str]] |
no test coverage detected