(self)
| 560 | return frozenset((*extra_directories, *watched_file_dirs, *sys_paths)) |
| 561 | |
| 562 | def _update_watches(self): |
| 563 | watched_files = list(self.watched_files(include_globs=False)) |
| 564 | found_roots = common_roots(self.watched_roots(watched_files)) |
| 565 | logger.debug("Watching %s files", len(watched_files)) |
| 566 | logger.debug("Found common roots: %s", found_roots) |
| 567 | # Setup initial roots for performance, shortest roots first. |
| 568 | for root in sorted(found_roots): |
| 569 | self._watch_root(root) |
| 570 | for directory, patterns in self.directory_globs.items(): |
| 571 | self._watch_glob(directory, patterns) |
| 572 | # Group sorted watched_files by their parent directory. |
| 573 | sorted_files = sorted(watched_files, key=lambda p: p.parent) |
| 574 | for directory, group in itertools.groupby(sorted_files, key=lambda p: p.parent): |
| 575 | # These paths need to be relative to the parent directory. |
| 576 | self._subscribe_dir( |
| 577 | directory, [str(p.relative_to(directory)) for p in group] |
| 578 | ) |
| 579 | |
| 580 | def update_watches(self): |
| 581 | try: |
no test coverage detected