§
    DIe  ã                  ó®   — d Z ddlmZ ddlmZ ddlZddlmZmZm	Z	m
Z
mZmZ dZ	  ej        e¦  «        Z	  ej        e¦  «        Z	  G d„ d	¦  «        ZdS )
z²
Pluggy hook specifications ("hookspecs") to register conda plugins.

Each hookspec defined in :class:`~conda.plugins.hookspec.CondaSpecs` contains
an example of how to use it.

é    )Úannotations)ÚIterableNé   )ÚCondaAuthHandlerÚCondaPostCommandÚCondaPreCommandÚCondaSolverÚCondaSubcommandÚCondaVirtualPackageÚcondac                  ó¢   — e Zd ZdZedd„¦   «         Zedd„¦   «         Zedd„¦   «         Zedd
„¦   «         Zedd„¦   «         Z	edd„¦   «         Z
dS )Ú
CondaSpecsz5The conda plugin hookspecs, to be used by developers.ÚreturnúIterable[CondaSolver]c                ó   — dS )aë  
        Register solvers in conda.

        **Example:**

        .. code-block:: python

            import logging

            from conda import plugins
            from conda.core import solve

            log = logging.getLogger(__name__)


            class VerboseSolver(solve.Solver):
                def solve_final_state(self, *args, **kwargs):
                    log.info("My verbose solver!")
                    return super().solve_final_state(*args, **kwargs)


            @plugins.hookimpl
            def conda_solvers():
                yield plugins.CondaSolver(
                    name="verbose-classic",
                    backend=VerboseSolver,
                )

        :return: An iterable of solver entries.
        N© ©Úselfs    ú6lib/python3.11/site-packages/conda/plugins/hookspec.pyÚconda_solverszCondaSpecs.conda_solvers*   ó   € € € ó    úIterable[CondaSubcommand]c                ó   — dS )a.  
        Register external subcommands in conda.

        **Example:**

        .. code-block:: python

            from conda import plugins


            def example_command(args):
                print("This is an example command!")


            @plugins.hookimpl
            def conda_subcommands():
                yield plugins.CondaSubcommand(
                    name="example",
                    summary="example command",
                    action=example_command,
                )

        :return: An iterable of subcommand entries.
        Nr   r   s    r   Úconda_subcommandszCondaSpecs.conda_subcommandsK   r   r   úIterable[CondaVirtualPackage]c                ó   — dS )aÍ  
        Register virtual packages in Conda.

        **Example:**

        .. code-block:: python

            from conda import plugins


            @plugins.hookimpl
            def conda_virtual_packages():
                yield plugins.CondaVirtualPackage(
                    name="my_custom_os",
                    version="1.2.3",
                    build="x86_64",
                )

        :return: An iterable of virtual package entries.
        Nr   r   s    r   Úconda_virtual_packagesz!CondaSpecs.conda_virtual_packagesf   r   r   úIterable[CondaPreCommand]c                ó   — dS )aû  
        Register pre-command functions in conda.

        **Example:**

        .. code-block:: python

           from conda import plugins


           def example_pre_command(command):
               print("pre-command action")


           @plugins.hookimpl
           def conda_pre_commands():
               yield CondaPreCommand(
                   name="example-pre-command",
                   action=example_pre_command,
                   run_for={"install", "create"},
               )
        Nr   r   s    r   Úconda_pre_commandszCondaSpecs.conda_pre_commands}   r   r   úIterable[CondaPostCommand]c                ó   — dS )a  
        Register post-command functions in conda.

        **Example:**

        .. code-block:: python

           from conda import plugins


           def example_post_command(command):
               print("post-command action")


           @plugins.hookimpl
           def conda_post_commands():
               yield CondaPostCommand(
                   name="example-post-command",
                   action=example_post_command,
                   run_for={"install", "create"},
               )
        Nr   r   s    r   Úconda_post_commandszCondaSpecs.conda_post_commands–   r   r   úIterable[CondaAuthHandler]c                ó   — dS )az  
        Register a conda auth handler derived from the requests API.

        This plugin hook allows attaching requests auth handler subclasses,
        e.g. when authenticating requests against individual channels hosted
        at HTTP/HTTPS services.

        **Example:**

        .. code-block:: python

            import os
            from conda import plugins
            from requests.auth import AuthBase


            class EnvironmentHeaderAuth(AuthBase):
                def __init__(self, *args, **kwargs):
                    self.username = os.environ["EXAMPLE_CONDA_AUTH_USERNAME"]
                    self.password = os.environ["EXAMPLE_CONDA_AUTH_PASSWORD"]

                def __call__(self, request):
                    request.headers["X-Username"] = self.username
                    request.headers["X-Password"] = self.password
                    return request


            @plugins.hookimpl
            def conda_auth_handlers():
                yield plugins.CondaAuthHandler(
                    name="environment-header-auth",
                    auth_handler=EnvironmentHeaderAuth,
                )
        Nr   r   s    r   Úconda_auth_handlerszCondaSpecs.conda_auth_handlers¯   r   r   N)r   r   )r   r   )r   r   )r   r   )r   r"   )r   r%   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	_hookspecr   r   r   r!   r$   r'   r   r   r   r   r   '   sÙ   € € € € € Ø?Ð?àðð ð ñ „Yðð@ ðð ð ñ „Yðð4 ðð ð ñ „Yðð, ðð ð ñ „Yðð0 ðð ð ñ „Yðð0 ð"ð "ð "ñ „Yð"ð "ð "r   r   )r+   Ú
__future__r   Úcollections.abcr   ÚpluggyÚtypesr   r   r   r	   r
   r   Ú	spec_nameÚHookspecMarkerr,   ÚHookimplMarkerÚhookimplr   r   r   r   ú<module>r5      s  ððð ð #Ð "Ð "Ð "Ð "Ð "à $Ð $Ð $Ð $Ð $Ð $à €€€ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð €	Ø 8à!ˆFÔ! )Ñ,Ô,€	ðð !ˆ6Ô  Ñ+Ô+€ðð
kð kð kð kð kñ kô kð kð kð kr   