Add dependency from trigger to a target. If the target is not given explicitly, use the current target.
(self, trigger: str, target: str | None = None)
| 869 | self.add_dependency(make_trigger(alias)) |
| 870 | |
| 871 | def add_dependency(self, trigger: str, target: str | None = None) -> None: |
| 872 | """Add dependency from trigger to a target. |
| 873 | |
| 874 | If the target is not given explicitly, use the current target. |
| 875 | """ |
| 876 | if trigger.startswith( |
| 877 | ("<builtins.", "<typing.", "<mypy_extensions.", "<typing_extensions.") |
| 878 | ): |
| 879 | # Don't track dependencies to certain library modules to keep the size of |
| 880 | # the dependencies manageable. These dependencies should only |
| 881 | # change on mypy version updates, which will require a full rebuild |
| 882 | # anyway. |
| 883 | return |
| 884 | if target is None: |
| 885 | target = self.scope.current_target() |
| 886 | self.map.setdefault(trigger, set()).add(target) |
| 887 | |
| 888 | def add_type_dependencies(self, typ: Type, target: str | None = None) -> None: |
| 889 | """Add dependencies to all components of a type. |
no test coverage detected