test-data/unit/plugins/depshook.py
raw| 1 | from __future__ import annotations |
| 2 | |
| 3 | from mypy.nodes import MypyFile |
| 4 | from mypy.plugin import Plugin |
| 5 | |
| 6 | |
| 7 | class DepsPlugin(Plugin): |
| 8 | def get_additional_deps(self, file: MypyFile) -> list[tuple[int, str, int]]: |
| 9 | if file.fullname == "__main__": |
| 10 | return [(10, "err", -1)] |
| 11 | return [] |
| 12 | |
| 13 | |
| 14 | def plugin(version: str) -> type[DepsPlugin]: |
| 15 | return DepsPlugin |