types#

Definition of specific return types for use when defining a conda plugin hook.

Each type corresponds to the plugin hook for which it is used.

Classes#

CondaSubcommand

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

CondaVirtualPackage

Return type to use when defining a conda virtual package plugin hook.

CondaSolver

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

CondaPreCommand

Return type to use when defining a conda pre-command plugin hook.

CondaPostCommand

Return type to use when defining a conda post-command plugin hook.

ChannelNameMixin

Class mixin to make all plugin implementations compatible, e.g. when they

ChannelAuthBase

Base class that we require all plugin implementations to use to be compatible.

CondaAuthHandler

Return type to use when the defining the conda auth handlers hook.

CondaHealthCheck

Return type to use when defining conda health checks plugin hook.

CondaPreSolve

Return type to use when defining a conda pre-solve plugin hook.

CondaPostSolve

Return type to use when defining a conda post-solve plugin hook.

CondaSetting

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

ProgressBarBase

Helper class that provides a standard way to create an ABC using

SpinnerBase

Helper class that provides a standard way to create an ABC using

ReporterRendererBase

Base class for all reporter renderers.

CondaReporterBackend

Return type to use when defining a conda reporter backend plugin hook.

CondaRequestHeader

Define vendor specific headers to include HTTP requests

class CondaSubcommand#

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

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

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.

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

name: str#
summary: str#
action: Callable[[argparse.Namespace | tuple[str]], int | None]#
configure_parser: Callable[[argparse.ArgumentParser], None] | None#
class CondaVirtualPackage#

Bases: NamedTuple

Return type to use when defining a conda virtual package plugin hook.

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

Parameters:
  • name -- Virtual package name (e.g., my_custom_os).

  • version -- Virtual package version (e.g., 1.2.3).

  • build -- Virtual package build string (e.g., x86_64).

name: str#
version: str | None#
build: str | None#
to_virtual_package() conda.models.records.PackageRecord#
class CondaSolver#

Bases: NamedTuple

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

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

Parameters:
  • name -- Solver name (e.g., custom-solver).

  • backend -- Type that will be instantiated as the solver backend.

name: str#
backend: type[conda.core.solve.Solver]#
class CondaPreCommand#

Bases: NamedTuple

Return type to use when defining a conda pre-command plugin hook.

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

Parameters:
  • name -- Pre-command name (e.g., custom_plugin_pre_commands).

  • action -- Callable which contains the code to be run.

  • run_for -- Represents the command(s) this will be run on (e.g. install or create).

name: str#
action: Callable[[str], None]#
run_for: set[str]#
class CondaPostCommand#

Bases: NamedTuple

Return type to use when defining a conda post-command plugin hook.

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

Parameters:
  • name -- Post-command name (e.g., custom_plugin_post_commands).

  • action -- Callable which contains the code to be run.

  • run_for -- Represents the command(s) this will be run on (e.g. install or create).

name: str#
action: Callable[[str], None]#
run_for: set[str]#
class ChannelNameMixin(channel_name: str, *args, **kwargs)#

Class mixin to make all plugin implementations compatible, e.g. when they use an existing (e.g. 3rd party) requests authentication handler.

Please use the concrete ChannelAuthBase in case you're creating an own implementation.

class ChannelAuthBase(channel_name: str, *args, **kwargs)#

Bases: ChannelNameMixin, requests.auth.AuthBase

Base class that we require all plugin implementations to use to be compatible.

Authentication is tightly coupled with individual channels. Therefore, an additional channel_name property must be set on the requests.auth.AuthBase based class.

class CondaAuthHandler#

Bases: NamedTuple

Return type to use when the defining the conda auth handlers hook.

Parameters:
  • name -- Name (e.g., basic-auth). This name should be unique and only one may be registered at a time.

  • handler -- Type that will be used as the authentication handler during network requests.

name: str#
handler: type[ChannelAuthBase]#
class CondaHealthCheck#

Bases: NamedTuple

Return type to use when defining conda health checks plugin hook.

name: str#
action: Callable[[str, bool], None]#
class CondaPreSolve#

Return type to use when defining a conda pre-solve plugin hook.

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

Parameters:
  • name -- Pre-solve name (e.g., custom_plugin_pre_solve).

  • action -- Callable which contains the code to be run.

name: str#
action: Callable[[frozenset[conda.models.match_spec.MatchSpec], frozenset[conda.models.match_spec.MatchSpec]], None]#
class CondaPostSolve#

Return type to use when defining a conda post-solve plugin hook.

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

Parameters:
  • name -- Post-solve name (e.g., custom_plugin_post_solve).

  • action -- Callable which contains the code to be run.

name: str#
action: Callable[[str, tuple[conda.models.records.PackageRecord, Ellipsis], tuple[conda.models.records.PackageRecord, Ellipsis]], None]#
class CondaSetting#

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

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

Parameters:
  • name -- name of the setting (e.g., config_param)

  • description -- description of the setting that should be targeted towards users of the plugin

  • parameter -- Parameter instance containing the setting definition

  • aliases -- alternative names of the setting

name: str#
description: str#
parameter: conda.common.configuration.Parameter#
aliases: tuple[str, Ellipsis]#
class ProgressBarBase(description: str, **kwargs)#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract update_to(fraction) None#
abstract refresh() None#
abstract close() None#
finish()#
classmethod get_lock()#
class SpinnerBase(message: str, fail_message: str = 'failed\n')#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract __enter__()#
abstract __exit__(exc_type, exc_val, exc_tb)#
class ReporterRendererBase#

Bases: abc.ABC

Base class for all reporter renderers.

render(data: Any, **kwargs) str#
abstract detail_view(data: dict[str, str | int | bool], **kwargs) str#

Render the output in a "tabular" format.

abstract envs_list(data, **kwargs) str#

Render a list of environments

abstract progress_bar(description: str, **kwargs) ProgressBarBase#

Return a ProgressBarBase~ object to use as a progress bar

classmethod progress_bar_context_manager() contextlib.AbstractContextManager#

Returns a null context by default but allows plugins to define their own if necessary

abstract spinner(message, failed_message) SpinnerBase#

Return a SpinnerBase~ object to use as a spinner (i.e. loading dialog)

abstract prompt(message: str = 'Proceed', choices=('yes', 'no'), default: str = 'yes') str#

Allows for defining an implementation of a "yes/no" confirmation function

class CondaReporterBackend#

Return type to use when defining a conda reporter backend plugin hook.

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

Parameters:
  • name -- name of the reporter backend (e.g., email_reporter) This is how the reporter backend with be references in configuration files.

  • description -- short description of what the reporter handler does

  • renderer -- implementation of ReporterRendererBase that will be used as the reporter renderer

name: str#
description: str#
renderer: type[ReporterRendererBase]#
class CondaRequestHeader#

Define vendor specific headers to include HTTP requests

For details on how this is used, see conda_request_headers() and conda_session_headers().

Parameters:
  • name -- name of the header used in the HTTP request

  • value -- value of the header used in the HTTP request

name: str#
value: str#