Report errors for import targets in modules that don't exist. If suppressed_only is set, only check suppressed dependencies.
(self, suppressed_only: bool = False)
| 3631 | return meta_tuple |
| 3632 | |
| 3633 | def verify_dependencies(self, suppressed_only: bool = False) -> None: |
| 3634 | """Report errors for import targets in modules that don't exist. |
| 3635 | |
| 3636 | If suppressed_only is set, only check suppressed dependencies. |
| 3637 | """ |
| 3638 | manager = self.manager |
| 3639 | assert self.ancestors is not None |
| 3640 | # Strip out indirect dependencies. See comment in build.load_graph(). |
| 3641 | if suppressed_only: |
| 3642 | all_deps = [dep for dep in self.suppressed if self.priorities.get(dep) != PRI_INDIRECT] |
| 3643 | else: |
| 3644 | dependencies = [ |
| 3645 | dep |
| 3646 | for dep in self.dependencies + self.suppressed |
| 3647 | if self.priorities.get(dep) != PRI_INDIRECT |
| 3648 | ] |
| 3649 | all_deps = dependencies + self.ancestors |
| 3650 | for dep in all_deps: |
| 3651 | if dep in manager.modules: |
| 3652 | continue |
| 3653 | options = manager.options.clone_for_module(dep) |
| 3654 | if options.ignore_missing_imports: |
| 3655 | continue |
| 3656 | line = self.dep_line_map.get(dep, 1) |
| 3657 | try: |
| 3658 | if dep in self.ancestors: |
| 3659 | state: State | None = None |
| 3660 | ancestor: State | None = self |
| 3661 | else: |
| 3662 | state, ancestor = self, None |
| 3663 | # Called just for its side effects of producing diagnostics. |
| 3664 | find_module_and_diagnose( |
| 3665 | manager, |
| 3666 | dep, |
| 3667 | options, |
| 3668 | caller_state=state, |
| 3669 | caller_line=line, |
| 3670 | ancestor_for=ancestor, |
| 3671 | ) |
| 3672 | except (ModuleNotFound, CompileError): |
| 3673 | # Swallow up any ModuleNotFounds or CompilerErrors while generating |
| 3674 | # a diagnostic. CompileErrors may get generated in |
| 3675 | # fine-grained mode when an __init__.py is deleted, if a module |
| 3676 | # that was in that package has targets reprocessed before |
| 3677 | # it is renamed. |
| 3678 | pass |
| 3679 | |
| 3680 | def dependency_priorities(self) -> list[int]: |
| 3681 | return [ |
no test coverage detected