MCPcopy Index your code
hub / github.com/python/mypy / get_additional_deps

Method get_additional_deps

mypy/plugin.py:573–588  ·  view source on GitHub ↗

Customize dependencies for a module. This hook allows adding in new dependencies for a module. It is called after parsing a file but before analysis. This can be useful if a library has dependencies that are dynamic based on configuration information, for example.

(self, file: MypyFile)

Source from the content-addressed store, hash-verified

571 return None
572
573 def get_additional_deps(self, file: MypyFile) -> list[tuple[int, str, int]]:
574 """Customize dependencies for a module.
575
576 This hook allows adding in new dependencies for a module. It
577 is called after parsing a file but before analysis. This can
578 be useful if a library has dependencies that are dynamic based
579 on configuration information, for example.
580
581 Returns a list of (priority, module name, line number) tuples.
582
583 The line number can be -1 when there is not a known real line number.
584
585 Priorities are defined in mypy.build (but maybe shouldn't be).
586 10 is a good choice for priority.
587 """
588 return []
589
590 def get_type_analyze_hook(self, fullname: str) -> Callable[[AnalyzeTypeContext], Type] | None:
591 """Customize behaviour of the type analyzer for given full names.

Callers 2

compute_dependenciesMethod · 0.45
get_additional_depsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected