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

Function load_plugins

mypy/build.py:727–746  ·  view source on GitHub ↗

Load all configured plugins. Return a plugin that encapsulates all plugins chained together. Always at least include the default plugin (it's last in the chain). The second return value is a snapshot of versions/hashes of loaded user plugins (for cache validation).

(
    options: Options, errors: Errors, stdout: TextIO, extra_plugins: Sequence[Plugin]
)

Source from the content-addressed store, hash-verified

725
726
727def load_plugins(
728 options: Options, errors: Errors, stdout: TextIO, extra_plugins: Sequence[Plugin]
729) -> tuple[Plugin, dict[str, str]]:
730 """Load all configured plugins.
731
732 Return a plugin that encapsulates all plugins chained together. Always
733 at least include the default plugin (it's last in the chain).
734 The second return value is a snapshot of versions/hashes of loaded user
735 plugins (for cache validation).
736 """
737 custom_plugins, snapshot = load_plugins_from_config(options, errors, stdout)
738
739 custom_plugins += extra_plugins
740
741 default_plugin: Plugin = DefaultPlugin(options)
742 if not custom_plugins:
743 return default_plugin, snapshot
744
745 # Custom plugins take precedence over the default plugin.
746 return ChainedPlugin(options, custom_plugins + [default_plugin]), snapshot
747
748
749def take_module_snapshot(module: types.ModuleType) -> str:

Callers 2

setup_worker_managerFunction · 0.90
build_innerFunction · 0.85

Calls 3

DefaultPluginClass · 0.90
ChainedPluginClass · 0.90
load_plugins_from_configFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…