manager
This module contains a subclass implementation of pluggy's PluginManager.
Additionally, it contains a function we use to construct the PluginManager
object and
register all plugins during conda's startup process.
Classes
The conda plugin manager to implement behavior additional to pluggy's default plugin manager. |
Functions
|
Get a cached version of the |
- class CondaPluginManager(project_name: str | None = None, *args, **kwargs)
Bases:
pluggy.PluginManager
The conda plugin manager to implement behavior additional to pluggy's default plugin manager.
- get_cached_solver_backend
- get_canonical_name(plugin: object) str
Return a canonical name for a plugin object.
Note that a plugin may be registered under a different name specified by the caller of
register(plugin, name)
. To obtain the name of a registered plugin useget_name(plugin)
instead.
- register(plugin, name: str | None = None) str | None
Call
pluggy.PluginManager.register()
and return the result or ignore errors raised, exceptValueError
, which means the plugin had already been registered.
- load_plugins(*plugins) int
Load the provided list of plugins and fail gracefully on error. The provided list of plugins can either be classes or modules with
hookimpl
.
- load_entrypoints(group: str, name: str | None = None) int
Load modules from querying the specified setuptools
group
.- Parameters
group (str) -- Entry point group to load plugins.
name (str) -- If given, loads only plugins with the given
name
.
- Return type
int
- Returns
The number of plugins loaded by this call.
- get_hook_results(name: Literal[conda.plugins.subcommands]) list[conda.plugins.types.CondaSubcommand]
- get_hook_results(name: Literal[conda.plugins.virtual_packages]) list[conda.plugins.types.CondaVirtualPackage]
- get_hook_results(name: Literal[conda.plugins.solvers]) list[conda.plugins.types.CondaSolver]
- get_hook_results(name: Literal[pre_commands]) list[conda.plugins.types.CondaPreCommand]
- get_hook_results(name: Literal[post_commands]) list[conda.plugins.types.CondaPostCommand]
- get_hook_results(name: Literal[auth_handlers]) list[conda.plugins.types.CondaAuthHandler]
Return results of the plugin hooks with the given name and raise an error if there is a conflict.
- get_solvers() dict[str, conda.plugins.types.CondaSolver]
Return a mapping from solver name to solver class.
- get_solver_backend(name: str | None = None) type[conda.core.solve.Solver]
Get the solver backend with the given name (or fall back to the name provided in the context).
See
context.solver
for more details.Please use the cached version of this method called
get_cached_solver_backend()
for high-throughput code paths which is set up as a instance-specific LRU cache.
- get_auth_handler(name: str) type[AuthBase] | None
Get the auth handler with the given name or None
- invoke_pre_commands(command: str) None
Invokes
CondaPreCommand.action
functions registered withconda_pre_commands
.- Parameters
command -- name of the command that is currently being invoked
- invoke_post_commands(command: str) None
Invokes
CondaPostCommand.action
functions registered withconda_post_commands
.- Parameters
command -- name of the command that is currently being invoked
- disable_external_plugins() None
Disables all currently registered plugins except built-in conda plugins
- get_subcommands() dict[str, conda.plugins.types.CondaSubcommand]
- get_virtual_packages() tuple[conda.plugins.types.CondaVirtualPackage, Ellipsis]
- get_plugin_manager() CondaPluginManager
Get a cached version of the
CondaPluginManager
instance, with the built-in and entrypoints provided by the plugins loaded.