plugins#

Implementation for conda plugins subcommand.

Classes#

CondaSubcommand

Return type to use when defining a conda subcommand plugin hook.

Functions#

configure_parser(→ None)

execute(→ int)

conda_subcommands()

Attributes#

hookimpl

Decorator to mark plugin hook implementations, used to register plugins.

SUMMARY

hookimpl#

Decorator to mark plugin hook implementations, used to register plugins.

class CondaSubcommand(*, name: str, summary: str, action: collections.abc.Callable[[argparse.Namespace], int | None], configure_parser: collections.abc.Callable[[argparse.ArgumentParser], None], aliases: str | collections.abc.Iterable[str] = ())#
class CondaSubcommand(*, name: str, summary: str, action: collections.abc.Callable[[tuple[str, ...]], int | None], configure_parser: None = None, aliases: str | collections.abc.Iterable[str] = ())

Bases: CondaPlugin

Return type to use when defining a conda subcommand plugin hook.

For details on how this is used, see conda_subcommands().

Subcommands support two shapes, distinguished by configure_parser:

  • If configure_parser is set, action receives the parsed argparse.Namespace.

  • If configure_parser is omitted, action receives the remaining argv as tuple[str, ...].

Parameters:
  • name -- Subcommand name (e.g., conda my-subcommand-name).

  • summary -- Subcommand summary, will be shown in conda --help.

  • action -- Callable that will be run when the subcommand is invoked.

  • aliases -- Alternative name or names for the subcommand.

  • configure_parser -- Callable that will be run when the subcommand parser is initialized.

summary: str#
action: collections.abc.Callable[[argparse.Namespace], int | None] | collections.abc.Callable[[tuple[str, ...]], int | None]#
aliases: tuple[str, ...] = ()#
configure_parser: collections.abc.Callable[[argparse.ArgumentParser], None] | None = None#
SUMMARY = 'Manage conda plugins.'#
configure_parser(parser: argparse.ArgumentParser) None#
execute(args: argparse.Namespace) int#
conda_subcommands()#