Find paths for the stat reloader to watch. Looks at the same sources as the stat reloader, but watches everything under directories instead of individual files.
(
extra_files: set[str], exclude_patterns: set[str]
)
| 117 | |
| 118 | |
| 119 | def _find_watchdog_paths( |
| 120 | extra_files: set[str], exclude_patterns: set[str] |
| 121 | ) -> t.Iterable[str]: |
| 122 | """Find paths for the stat reloader to watch. Looks at the same |
| 123 | sources as the stat reloader, but watches everything under |
| 124 | directories instead of individual files. |
| 125 | """ |
| 126 | dirs = set() |
| 127 | |
| 128 | for name in chain(list(sys.path), extra_files): |
| 129 | name = os.path.abspath(name) |
| 130 | |
| 131 | if os.path.isfile(name): |
| 132 | name = os.path.dirname(name) |
| 133 | |
| 134 | dirs.add(name) |
| 135 | |
| 136 | for name in _iter_module_paths(): |
| 137 | dirs.add(os.path.dirname(name)) |
| 138 | |
| 139 | _remove_by_pattern(dirs, exclude_patterns) |
| 140 | return _find_common_roots(dirs) |
| 141 | |
| 142 | |
| 143 | def _find_common_roots(paths: t.Iterable[str]) -> t.Iterable[str]: |
no test coverage detected
searching dependent graphs…