
    sï                    D   S r SSKJr  SSKrSSKrSSKrSSKJr  SSKJ	r	J
r
  SSKJrJr  SSKrSSKJr  SS	KJr  SS
KJrJr  SSKJr  SSKJr  SSKJrJrJrJr  SSKJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(  SSK)J*r*  SSK+J,r,  SSK-J.r.  \(       a\  SSK/J0r0J1r1  SSKJ2r2  SSK3J4r4  SSK5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  SSK?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrNJOrOJPrPJQrQJRrR  \R                  " \T5      rU " S S\R                  5      rW\R                  SS j5       rYg) a0  
This module contains a subclass implementation of pluggy's
`PluginManager <https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluginManager>`_.

Additionally, it contains a function we use to construct the ``PluginManager`` object and
register all plugins during conda's startup process.
    )annotationsN)distributions)	getmoduleisclass)TYPE_CHECKINGoverload   )NULL)dals)APP_NAME DEFAULT_CONSOLE_REPORTER_BACKEND)context)dashlist)CondaValueErrorEnvironmentExporterNotDetected EnvironmentSpecPluginNotDetectedPluginError   )	environment_exportersenvironment_specifierspackage_extractorspost_solvesprefix_data_loadersreporter_backendssolverssubcommandsvirtual_packagesPluginConfig)
CondaSpecs)health_checks)CallableIterable)Literal)AuthBase)PathType)Action)Solver)	MatchSpec)PackageRecord)CondaAuthHandlerCondaEnvironmentExporterCondaEnvironmentSpecifierCondaHealthCheckCondaPackageExtractorCondaPostCommandCondaPostSolveCondaPostTransactionActionCondaPreCommandCondaPrefixDataLoaderCondaPrefixDataLoaderCallableCondaPreSolveCondaPreTransactionActionCondaReporterBackendCondaRequestHeaderCondaSettingCondaSolverCondaSubcommandCondaVirtualPackagec                    ^  \ rS rSr% SrS\S'    S\S'    S\S'    U 4S	 jrSDS
 jrSESFU 4S jjjrSGS jr	SESHS jjr
\    SIS j5       r\    SJS j5       r\SKS j5       r\    SLS j5       r\    SMS j5       r\    SNS j5       r\    SOS j5       r\SPS j5       r\    SQS j5       r\      SRS j5       r\        SSS j5       r\STS j5       r\    SUS j5       r\    SVS j5       r\    SWS j5       r\    SXS j5       r\    SYS j5       r\    SZS j5       r\    S[S  j5       rS! rS\S" jrSES]S# jjrS^S$ jrS_S% jrS`S& jrS`S' jrSaS( jrSbS) jrScS* jrSdS+ jrSeS, jrSfS- jrSgS. jrShS/ jrSiS0 jr      SjS1 jr        SkS2 jrSaS3 jrSlS4 jrSmS5 jr       SnS6 jr!SoS7 jr" SE     SpS8 jjr#SqS9 jr$SrS: jr%SsS; jr&    StS< jr'       Su               SvS= jjr(       Su               SvS> jjr)SwS? jr*    SxS@ jr+      SySA jr,SzSB jr-SCr.U =r/$ ){CondaPluginManagerT   z_
The conda plugin manager to implement behavior additional to pluggy's default plugin manager.
z$Callable[[str | None], type[Solver]]get_cached_solver_backendzCallable[[str], dict[str, str]]get_cached_session_headersz$Callable[[str, str], dict[str, str]]get_cached_request_headersc                  > [         TU ]  " [        /UQ70 UD6  [        R                  " U R
                  5      U l        [        R                  " U R                  5      U l        [        R                  " U R                  5      U l
        g N)super__init__r   	functoolscacheget_solver_backendrA   get_session_headersrB   get_request_headersrC   )selfargskwargs	__class__s      5lib/python3.13/site-packages/conda/plugins/manager.pyrG   CondaPluginManager.__init__b   sa    3D3F3 *39P9P)Q&*3//$:R:R*S'*3//$:R:R*S'    c                   Sn[        U5      =n(       a'  UR                  (       a  UR                  R                  nX1L a  U$ [        U5      (       a  U SUR                   3$ U SUR
                  R                   S[        U5       S3$ )Nz<unknown_module>.[])r   __spec__namer   __qualname__rP   id)rM   pluginprefixmodules       rQ   get_canonical_name%CondaPluginManager.get_canonical_namej   s    #''F'V____))F M V__XQv22344 XQv//<<=Qr&zl!LLrS   c                   >  [         TU ]  XS9$ ! [         a     g[         a0  n[	        SU=(       d    U R                  U5       SU S35      UeSnAff = f)z
Call :meth:`pluggy.PluginManager.register` and return the result or
ignore errors raised, except ``ValueError``, which means the plugin
had already been registered.
rY   Nz"Error while loading conda plugin:  ())rF   register
ValueError	Exceptionr   r_   )rM   r\   rY   errrP   s       rQ   re   CondaPluginManager.register|   sq    
	 7#F#66 	 	4:4226:;2cU!E 	s    
A	A+AAc                V    SnU H   nU R                  U5      (       d  M  US-  nM"     U$ )z
Load the provided list of plugins and fail gracefully on error.
The provided list of plugins can either be classes or modules with
:attr:`~conda.plugins.hookimpl`.
r   r   )re   )rM   pluginscountr\   s       rQ   load_pluginsCondaPluginManager.load_plugins   s2     F}}V$$
  rS   c           
        Sn[        5        Hi  nUR                   HV  nUR                  U:w  d  Ub  UR                  U:w  a  M(   UR	                  5       nU R                  U5      (       d  MQ  US-  nMX     Mk     U$ ! [
         aG  n[        R                  SUR                   SU S3[        R                  (       a  UOSS9   SnAM  SnAff = f)zLoad modules from querying the specified setuptools ``group``.

:param str group: Entry point group to load plugins.
:param str name: If given, loads only plugins with the given ``name``.
:rtype: int
:return: The number of plugins loaded by this call.
r   Nz'Error while loading conda entry point: rc   rd   exc_infor   )r   entry_pointsgrouprY   loadrg   logwarningr   infore   )rM   rs   rY   rl   distentry_pointr\   rh   s           rQ   load_entrypoints#CondaPluginManager.load_entrypoints   s     !OD#00$$-$)9)9T)A(--/F ==((QJE/  1 $2  ! 
 KKA+BRBRASSUVYUZZ[\(/$    
s   A<<
C<CCc                    g rE    rM   rY   s     rQ   get_hook_results#CondaPluginManager.get_hook_results        !$rS   c                    g rE   r}   r~   s     rQ   r   r      s     %(rS   c                    g rE   r}   r~   s     rQ   r   r      s    ORrS   c                    g rE   r}   r~   s     rQ   r   r      r   rS   c                    g rE   r}   r~   s     rQ   r   r           "%rS   c                    g rE   r}   r~   s     rQ   r   r      r   rS   c                    g rE   r}   r~   s     rQ   r   r      r   rS   c                    g rE   r}   r~   s     rQ   r   r      s    TWrS   c                    g rE   r}   r~   s     rQ   r   r      s      #rS   c                   g rE   r}   )rM   rY   hosts      rQ   r   r           $'rS   c                   g rE   r}   )rM   rY   r   paths       rQ   r   r      r   rS   c                    g rE   r}   r~   s     rQ   r   r      s    QTrS   c                    g rE   r}   r~   s     rQ   r   r      s     &)rS   c                    g rE   r}   r~   s     rQ   r   r           +.rS   c                    g rE   r}   r~   s     rQ   r   r      s     ,/rS   c                    g rE   r}   r~   s     rQ   r   r          '*rS   c                    g rE   r}   r~   s     rQ   r   r     r   rS   c                    g rE   r}   r~   s     rQ   r   r     r   rS   c                    g rE   r}   r~   s     rQ   r   r     s     *-rS   c                F   U R                    SU 3n[        U R                  US5      nUc  [        SU S35      eU" S0 UD6 VVs/ s H  oU  H  ofPM     M     snnnU Vs/ s Hm  n[	        US5      (       aW  [        UR                  [        5      (       a8  UR                  UR                  R                  5       R                  5       :w  d  Mk  UPMo     nnU(       a)  [        SU S[        [        [        U5      5       S35      e[        5       nU Vs/ s H6  ofR                  U;   d"  UR                  UR                  5      (       d  M4  UPM8     n	nU	(       a,  [        S	U S[        [        [        U	5      5       S
U S35      e[        US S9$ s  snnf s  snf s  snf )zc
Return results of the plugin hooks with the given name and
raise an error if there is a conflict.
_NzCould not find requested `z	` pluginsrY   z Invalid plugin names found for `z`:
z3

Please report this issue to the plugin author(s).zConflicting plugins found for `z1

Multiple conda plugins are registered via the `zP` hook. Please make sure that you don't have any incompatible plugins installed.c                    U R                   $ rE   rb   )r\   s    rQ   <lambda>5CondaPluginManager.get_hook_results.<locals>.<lambda>E  s    &++rS   )keyr}   )project_namegetattrhookr   hasattr
isinstancerY   strlowerstripr   mapreprsetaddsorted)
rM   rY   rO   specnamer   rk   r\   invalidseen	conflictss
             rQ   r   r     s   
 ''($0tyy(D1< :4&	JKK *.NggF6g6N
 "
!66**fkk3//{{fkk//17799	 ! 	 
 24&Cg./0 1DE  u!(
!(vKK4,?488FKKCXF 	 
 1$tCi012 3BBJ L[\  g#=>>A O
"
s   F"A*FF3FFc                f    U R                  S5       Vs0 s H  nUR                  U_M     sn$ s  snf )z2Return a mapping from solver name to solver class.r   r   rY   )rM   solver_plugins     rQ   get_solversCondaPluginManager.get_solversG  s?     "&!6!6y!A
!A -!A
 	
 
   .c                   U=(       d    [         R                  R                  5       R                  5       nU R	                  5       nUR                  US5      nUc   [        SU SSR                  U5       35      eUR                  $ )a2  
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
:meth:`get_cached_solver_backend` for high-throughput code paths
which is set up as a instance-specific LRU cache.
Nz.You have chosen a non-default solver backend (z,) but it was not recognized. Choose one of: , )	r   solverr   r   r   getr   joinbackend)rM   rY   solvers_mappingr   s       rQ   rJ   %CondaPluginManager.get_solver_backendN  s     &--/557**, (++D$7 !@ G=99_-.0  $$$rS   c                    UR                  5       R                  5       nU R                  S5      nU Vs/ s H  o3R                  U:X  d  M  UPM     nn[	        U5      S:  a  US   R
                  $ gs  snf )z2
Get the auth handler with the given name or None
auth_handlersr   N)r   r   r   rY   lenhandler)rM   rY   r   itemmatchess        rQ   get_auth_handler#CondaPluginManager.get_auth_handlerj  sj     zz|!!#--o>$1GMDYY$5F4MGw<!1:%%%	 Hs   A2A2c                f    U R                  S5       Vs0 s H  nUR                  U_M     sn$ s  snf )z
Return a mapping of plugin setting name to CondaSetting objects.

This method intentionally overwrites any duplicates that may be present
settingsr   )rM   config_params     rQ   get_settingsCondaPluginManager.get_settingsv  s?     !% 5 5j A
 A |+ A
 	
 
r   c                x    U R                  S5       H%  nXR                  ;   d  M  UR                  U5        M'     g)z
Invokes ``CondaPreCommand.action`` functions registered with ``conda_pre_commands``.

:param command: name of the command that is currently being invoked
pre_commandsNr   run_foractionrM   commandr   s      rQ   invoke_pre_commands&CondaPluginManager.invoke_pre_commands  s/     )).9D,,&G$ :rS   c                x    U R                  S5       H%  nXR                  ;   d  M  UR                  U5        M'     g)z
Invokes ``CondaPostCommand.action`` functions registered with ``conda_post_commands``.

:param command: name of the command that is currently being invoked
post_commandsNr   r   s      rQ   invoke_post_commands'CondaPluginManager.invoke_post_commands  s/     ))/:D,,&G$ ;rS   c                    U R                  5        HF  u  pUR                  S5      (       a  M  U R                  U5      (       a  M5  U R                  U5        MH     g)zI
Disables all currently registered plugins except built-in conda plugins
zconda.plugins.N)list_name_plugin
startswith
is_blockedset_blocked)rM   rY   r\   s      rQ   disable_external_plugins+CondaPluginManager.disable_external_plugins  sE     !113LD??#344T__T=R=R  & 4rS   c                f    U R                  S5       Vs0 s H  nUR                  U_M     sn$ s  snf )Nr   r   )rM   
subcommands     rQ   get_subcommands"CondaPluginManager.get_subcommands  s=     #33MB
B
 OOZ'B
 	
 
r   c                d    U R                  S5       Vs0 s H  oR                  U_M     sn$ s  snf )z6Return a mapping of health check name to health check.r!   r   )rM   checks     rQ   get_health_checks$CondaPluginManager.get_health_checks  s.    /3/D/D_/UV/Ue

E!/UVVV   -c                6    [        U R                  S5      5      $ )Nr   tupler   rM   s    rQ   get_reporter_backends(CondaPluginManager.get_reporter_backends  s    T**+>?@@rS   c                    U R                  5        Vs0 s H  nUR                  U_M     nnUR                  US5      nUc5  [        R	                  SU S[
         S35        UR                  [
        5      $ U$ s  snf )z
Attempts to find a reporter backend while providing a fallback option if it is
not found.

This method must return a valid ``CondaReporterBackend`` object or else it will
raise an exception.
Nz"Unable to find reporter backend: "z"; falling back to using "")r   rY   r   ru   rv   r   )rM   rY   reporter_backendreporter_backends_maps       rQ   get_reporter_backend'CondaPluginManager.get_reporter_backend  s     %)$>$>$@!
$@  !!#33$@ 	 !
 144T4@#KK4TF ;**J)K1N ),,-MNN##!
s   A8c                L   ^ [        U4S jU R                  S5       5       5      $ )Nc              3  ^   >#    U  H"  nUR                  5       =m[        Ld  M  Tv   M$     g 7frE   )to_virtual_packager
   ).0r   virtual_packages     rQ   	<genexpr>ACondaPluginManager.get_virtual_package_records.<locals>.<genexpr>  s0      
A#'#:#:#<<TI OAs   -	-r   r   )rM   r   s    @rQ   get_virtual_package_records.CondaPluginManager.get_virtual_package_records  s)     
--.@A
 
 	
rS   c                x    U R                  SUS9 Vs0 s H  nUR                  UR                  _M     sn$ s  snf )Nsession_headers)r   r   rY   value)rM   r   r   s      rQ   rK   &CondaPluginManager.get_session_headers  sG     --.?d-K
K IItzz!K
 	
 
   !7c                x    U R                  SXS9 Vs0 s H  nUR                  UR                  _M     sn$ s  snf )Nrequest_headers)r   r   r   )rM   r   r   r   s       rQ   rL   &CondaPluginManager.get_request_headers  sG     --.?d-V
V IItzz!V
 	
 
r  c              #  X   #    U R                  S5       H  nUR                  v   M     g 7f)Nr   )r   loaderrM   r   s     rQ   get_prefix_data_loaders*CondaPluginManager.get_prefix_data_loaders  s&     ))*?@D++ As   (*c                V    U R                  S5       H  nUR                  X5        M     g)z
Invokes ``CondaPreSolve.action`` functions registered with ``conda_pre_solves``.

:param specs_to_add:
:param specs_to_remove:

pre_solvesNr   r   )rM   specs_to_addspecs_to_remover   s       rQ   invoke_pre_solves$CondaPluginManager.invoke_pre_solves  s%     )),7DKK6 8rS   c                X    U R                  S5       H  nUR                  XU5        M     g)z
Invokes ``CondaPostSolve.action`` functions registered with ``conda_post_solves``.

:param repodata_fn:
:param unlink_precs:
:param link_precs:
r   Nr  )rM   repodata_fnunlink_precs
link_precsr   s        rQ   invoke_post_solves%CondaPluginManager.invoke_post_solves  s'     ))-8DKK:> 9rS   c                    U R                  5       R                  5        H0  u  p[        R                  " XR                  UR
                  5        M2     g)zw
Iterates through all registered settings and adds them to the
:class:`conda.common.configuration.PluginConfig` class.
N)r   itemsr   add_plugin_setting	parameteraliases)rM   rY   settings      rQ   load_settings CondaPluginManager.load_settings  s<    
 "..0668MD++D2C2CW__U 9rS   c                    [        U5      $ )z
Retrieve the configuration for the plugin.
Returns:
    PluginConfig: The configuration object for the plugin, initialized with raw data from the context.
r   )rM   datas     rQ   
get_configCondaPluginManager.get_config  s     D!!rS   c                d    U R                  S5       Vs0 s H  oR                  U_M     sn$ s  snf )zM
Returns a mapping from environment specifier name to environment specifier.
r   r   r	  s     rQ   get_environment_specifiers-CondaPluginManager.get_environment_specifiers  s8    
 )-(=(=>V(W
(WIItO(W
 	
 
r   c                   UR                  5       R                  5       nU R                  5       n X2   n UR                  U5      R	                  5       (       a  U$  [        SU SU S35      e! [         a9  n[        [        SU SU S[        U5      R                   SU S3	5      5      eS	nAff = f! [         a    [        S
U S[        U5       35      ef = f)a  Get an environment specifier plugin by name

:param source: full path to the environment spec file/source
:param name: name of the environment plugin to load
:raises CondaValueError: if the requested plugin is not available.
:raises PluginError: if the requested plugin is unable to handle the provided file.
:returns: an environment specifier plugin that matches the provided plugin name, or can handle the provided file
zRequested plugin 'z(' is unable to handle environment spec ''z9
                        An error occured when handling 'z' with plugin 'z'.

                        z: z
                        Nz<You have chosen an unrecognized environment specifier type (z). Choose one of: )r   r   r&  environment_spec
can_handler   rg   r   type__name__KeyErrorr   r   )rM   sourcerY   rk   r\   es         rQ   !get_environment_specifier_by_name4CondaPluginManager.get_environment_specifier_by_name  s    zz|!!#113	]F**62==??!M @ "(.VW]V^^_`   	!99?PTv Va))*"QC 0 	  	!$$(6);G$%' 	s"   B4 %A. .
B184B,,B14%Cc                   U R                  5       n/ n/ nUR                  5        H  u  pVUR                  R                  (       a~  [        R                  SU5         UR                  U5      R                  5       (       a*  [        R                  SUU5        UR                  U5        M  [        R                  SUU5        M  [        R                  SUU5        UR                  U5        M     U(       d   U R                  USS	9$ [        U5      S:X  a  US   $ [        [        SU SSR!                  U Vs/ s H  ofR"                  PM     sn5       S35      5      e! [         a8  n[        R                  SUUU5        [        R                  SXwS9   SnAGMw  SnAff = f! [        [        4 a  n[        UUUS
9UeSnAff = fs  snf )at  Detect the environment specifier plugin for a given spec source

Raises PluginError if more than one environment_spec plugin is found to be able to handle the file.
Raises EnvironmentSpecPluginNotDetected if no plugins were found.

:param source: full path to the environment spec file or source
:returns: an environment specifier plugin that can handle the provided file
z!EnvironmentSpec hook: checking %sz"EnvironmentSpec hook: %s can be %sz1EnvironmentSpec hook: %s can NOT be handled by %szOEnvironmentSpec hook: an error occurred when handling '%s' with plugin '%s'. %sz%rrp   Nzenvironment.ymlr/  rY   )rY   plugin_namesautodetect_disabled_pluginsr   r   zR
                    Too many plugins found that can handle the environment file 'z':

                    r   zn

                    Please make sure that you don't have any overlapping plugins installed.
                )r&  r  r*  detection_supportedru   debugr+  appendrg   errorr1  r   r   r   r   r   r   rY   )	rM   r/  hooksfoundr6  	hook_namer   r0  excs	            rQ   detect_environment_specifier/CondaPluginManager.detect_environment_specifier9  s    //1&(#${{}OI$$88		=yI3,,V4??AA		@"%
 T*		O"% 		G
 ,229=?  -B 

==!(9 >   Z1_8O RRXQY ZYYe<ed		e<=> ?
 
K ! 3IIi!	 IIdAI2232  1 6!&0K 	"  =s=   AE*E7F$ 8G
F!),FF!$G4G  Gc                P    U(       d  U R                  U5      $ U R                  XS9$ )a!  Get the environment specifier plugin for a given spec source, or given a plugin name
Raises PluginError if more than one environment_spec plugin is found to be able to handle the file.
Raises EnvironmentSpecPluginNotDetected if no plugins were found.
Raises CondaValueError if the requested plugin is not available.

:param filename: full path to the environment spec file/source
:param name: name of the environment plugin to load
:returns: an environment specifier plugin that matches the provided plugin name, or can handle the provided file
r4  )r?  r1  )rM   r/  rY   s      rQ   get_environment_specifier,CondaPluginManager.get_environment_specifier  s,     44V<<999SSrS   c              #  B   #    U R                  S5       Sh  vN   g N7f)z,
Yields all detected environment exporters.
r   N)r   r   s    rQ   get_environment_exporters,CondaPluginManager.get_environment_exporters  s      (()@AAAs   c                   0 n0 nU R                  5        Hb  nUR                  /UR                  Q7 HA  nXA;   a5  XB;  a  X   R                  1X$'   X$   R                  UR                  5        M=  X1U'   MC     Md     U(       am  / n[	        UR                  5       5       H6  u  pFSR                  [	        U5      5      nUR                  SU SU 35        M8     [        S[        U5       S35      eU$ )z
Get a mapping from format names (including aliases) to environment exporters.

:return: Dict mapping format name to CondaEnvironmentExporter
:raises PluginError: If multiple exporters use the same format name or alias
r   r)  z' used by plugins: z8Format name conflicts detected in environment exporters:z;
Multiple plugins cannot use the same format name or alias.)
rE  rY   r  r   r   r  r   r9  r   r   )rM   mappingr   r\   format_nameconflict_detailsr5  plugins_strs           rQ   get_exporter_format_mapping.CondaPluginManager.get_exporter_format_mapping  s     	446F &=fnn=)"3292F2K2K1L	.*..v{{;+1K(  > 7 !-3IOO4E-F)"ii|(<= ''}$7}E .G J,-. /MN  rS   c                   [         R                  R                  U5      n/ nU R                  5        H%  nX$R                  ;   d  M  UR                  U5        M'     U(       d  [        UU R                  5       S9e[        U5      S:  a5  [        SU S[        U Vs/ s H  oUR                  PM     sn5       S35      eUS   $ s  snf )a  
Detect an environment exporter based on exact filename matching against default_filenames.

:param filename: Filename to find an exporter for (basename is used for detection)
:return: CondaEnvironmentExporter that supports the filename
:raises EnvironmentExporterNotDetected: If no exporter supports the filename
:raises PluginError: If multiple exporters claim to support the same filename
)filename	exportersr   z?Multiple environment exporters found that can handle filename 'z':zR

Please make sure that you don't have any conflicting exporter plugins installed.r   )osr   basenamerE  default_filenamesr9  r   r   r   r   rY   )rM   rO  rR  r   exporter_configmatchs         rQ   detect_environment_exporter.CondaPluginManager.detect_environment_exporter  s     77##H-#==?O<<</  @
 0!88:  \AQRZQ[[]W=WEZZW=>? @cd  qz	 >s   Cc                    U R                  5       nUR                  U5      nUc1  [        SU S[        [	        UR                  5       5      5       35      eU$ )a  
Get an environment exporter based on the format name.

:param format_name: Format name to find an exporter for (e.g., 'yaml', 'json', 'environment-yaml')
:return: CondaEnvironmentExporter that supports the format
:raises CondaValueError: If no exporter is found for the given format
zUnknown export format 'z'. Available formats:)rL  r   r   r   r   keys)rM   rI  format_mappingexporters       rQ   "get_environment_exporter_by_format5CondaPluginManager.get_environment_exporter_by_format  sg     99;!%%k2!)+ 7%%-f^5H5H5J.K%L$MO 
 rS   c                z    U R                  S5       Vs/ s H  nUR                  UUUUUUU5      PM     sn$ s  snf )a  Get the plugin-defined pre-transaction actions.

:param transaction_context: Mapping between target prefixes and PrefixActions
    instances
:param target_prefix: Target prefix for the action
:param unlink_precs: Package records to be unlinked
:param link_precs: Package records to link
:param remove_specs: Specs to be removed
:param update_specs: Specs to be updated
:param neutered_specs: Specs to be neutered
:return: The plugin-defined pre-transaction actions
pre_transaction_actionsr  	rM   transaction_contexttarget_prefixr  r  remove_specsupdate_specsneutered_specsr   s	            rQ   get_pre_transaction_actions.CondaPluginManager.get_pre_transaction_actions  sZ    @ --.GH
 I KK# I
 	
 
   !8c                z    U R                  S5       Vs/ s H  nUR                  UUUUUUU5      PM     sn$ s  snf )a  Get the plugin-defined post-transaction actions.

:param transaction_context: Mapping between target prefixes and PrefixActions
    instances
:param target_prefix: Target prefix for the action
:param unlink_precs: Package records to be unlinked
:param link_precs: Package records to link
:param remove_specs: Specs to be removed
:param update_specs: Specs to be updated
:param neutered_specs: Specs to be neutered
:return: The plugin-defined post-transaction actions
post_transaction_actionsr  r`  s	            rQ   get_post_transaction_actions/CondaPluginManager.get_post_transaction_actions  sZ    @ --.HI
 J KK# J
 	
 
rh  c                    U R                  S5       VVs0 s H(  nUR                    H  nUR                  5       U_M     M*     snn$ s  snnf )a  
Return a mapping from file extension to package extractor plugin.

Extensions are lowercased for case-insensitive matching.

:return: Dictionary mapping lowercased extensions (e.g., ``".conda"``) to their
    :class:`~conda.plugins.types.CondaPackageExtractor` plugins.
r   )r   
extensionsr   )rM   r   	extensions      rQ   get_package_extractors)CondaPluginManager.get_package_extractors>  sR     --.BC
C!__	 OOt#, C
 	
 
s   /Ac                    [         R                  " U5      R                  5       nU R                  5       R	                  5        H  u  p4UR                  U5      (       d  M  Us  $    [        SU 35      e)a  
Get the package extractor plugin for a given package path.

Searches through registered package extractor plugins to find one that
handles the file extension of the provided package path.

:param source_full_path: Full path to the package archive file.
:return: The matching :class:`~conda.plugins.types.CondaPackageExtractor` plugin.
:raises PluginError: If no registered extractor handles the file extension.
z=No registered 'package_extractors' plugin found for package: )rQ  fspathr   rp  r  endswithr   )rM   source_full_path
source_strro  	extractors        rQ   get_package_extractor(CondaPluginManager.get_package_extractorM  sn     YY/0668
$($?$?$A$G$G$I I""9--   %J KL\K]^
 	
rS   c                H    U R                  U5      nUR                  X5        g)an  
Extract a package archive to a destination directory.

Finds the appropriate extractor plugin based on the file extension
and extracts the package.

:param source_full_path: Full path to the package archive file.
:param destination_directory: Directory to extract the package contents to.
:raises PluginError: If no registered extractor handles the file extension.
N)rx  extract)rM   ru  destination_directoryrw  s       rQ   extract_package"CondaPluginManager.extract_packaged  s$     ../?@	*BrS   c                    [         R                  " U5      R                  5       nU R                  5        H  nUR	                  U5      (       d  M  Us  $    g)z
Check if a path has a supported package file extension.

:param path: Path to check.
:return: The matched extension (lowercased) if found, None otherwise.
N)rQ  rs  r   rp  rt  )rM   r   path_strexts       rQ   has_package_extension(CondaPluginManager.has_package_extensionv  sH     99T?((*..0C  %%
 1 rS   )rC   rB   rA   )r\   objectreturnr   rE   )rY   
str | Noner  r  )r  int)rs   r   rY   r  r  r  )rY   zLiteral['subcommands']r  zlist[CondaSubcommand])rY   zLiteral['virtual_packages']r  zlist[CondaVirtualPackage])rY   zLiteral['solvers']r  zlist[CondaSolver])rY   zLiteral['pre_commands']r  zlist[CondaPreCommand])rY   zLiteral['post_commands']r  zlist[CondaPostCommand])rY   zLiteral['auth_handlers']r  zlist[CondaAuthHandler])rY   zLiteral['health_checks']r  zlist[CondaHealthCheck])rY   zLiteral['pre_solves']r  zlist[CondaPreSolve])rY   zLiteral['post_solves']r  zlist[CondaPostSolve])rY   zLiteral['session_headers']r   r   r  list[CondaRequestHeader])rY   zLiteral['request_headers']r   r   r   r   r  r  )rY   zLiteral['settings']r  zlist[CondaSetting])rY   zLiteral['reporter_backends']r  zlist[CondaReporterBackend])rY   z"Literal['pre_transaction_actions']r  zlist[CondaPreTransactionAction])rY   z#Literal['post_transaction_actions']r  z list[CondaPostTransactionAction])rY   zLiteral['prefix_data_loaders']r  zlist[CondaPrefixDataLoader])rY   z!Literal['environment_specifiers']r  zlist[CondaEnvironmentSpecifier])rY   zLiteral['package_extractors']r  zlist[CondaPackageExtractor])rY   z Literal['environment_exporters']r  zlist[CondaEnvironmentExporter])r  zdict[str, CondaSolver])rY   r  r  ztype[Solver])rY   r   r  ztype[AuthBase] | None)r  zdict[str, CondaSetting])r   r   r  None)r  r  )r  zdict[str, CondaSubcommand])r  zdict[str, CondaHealthCheck])r  z tuple[CondaReporterBackend, ...])rY   r   r  r8   )r  tuple[PackageRecord, ...])r   r   r  dict[str, str])r   r   r   r   r  r  )r  z'Iterable[CondaPrefixDataLoaderCallable])r  frozenset[MatchSpec]r  r  r  r  )r  r   r  r  r  r  r  r  )r  r   )r  z$dict[str, CondaEnvironmentSpecifier])r/  r   rY   r   r  r-   )r/  r   r  r-   )r/  r   rY   r  r  r-   )r  z"Iterable[CondaEnvironmentExporter])r  z#dict[str, CondaEnvironmentExporter])rO  r   r  r,   )rI  r   r  r,   )NNNNNNN)ra  zdict[str, str] | Nonerb  r  r  Iterable[PackageRecord] | Noner  r  rc  Iterable[MatchSpec] | Nonerd  r  re  r  r  zlist[Action])r  z dict[str, CondaPackageExtractor])ru  r&   r  r/   )ru  r&   r|  r&   r  r  )r   r&   r  r  )0r-  
__module__rZ   __firstlineno____doc____annotations__rG   r_   re   rm   rz   r   r   r   rJ   r   r   r   r   r   r   r   r   r   r   rK   rL   r
  r  r  r  r#  r&  r1  r?  rB  rE  rL  rV  r\  rf  rk  rp  rx  r}  r  __static_attributes____classcell__)rP   s   @rQ   r?   r?   T   s     DCl ??m DDmTM$ $
"H $*$	$ $ (/(	"( ( R R$+$	$ $ %,%	% % %,%	% % %,%	% % W W#*#	# # '.'9<'	!' ' '.'9<'DG'	!' ' T T)0)	#) ) .6.	(. . /7/	)/ / *2*	$* * .5.	(. . *1*	$* * -4-	'- -.?`
%8
	
%%'
WA$,


7*7 .7 
	7?? 0? .	?
 
? V"
** * 
#	*XLb  TT T 
#	T&B!F@	!. 6:$(7;59373759!
2!
 "!
 5	!

 3!
 1!
 1!
 3!
 
!
J 6:$(7;59373759!
2!
 "!
 5	!

 3!
 1!
 1!
 3!
 
!
F

"
 

.C"C  (C 
	C$ rS   r?   c                    [        5       n U R                  [        5        U R                  " [        /[
        R                  Q[        R                  Q[        R                  Q[        R                  Q[        R                  Q[        R                  Q[        R                  Q[        R                  Q[        R                  Q76   U R                  [         5        U $ )z
Get a cached version of the :class:`~conda.plugins.manager.CondaPluginManager` instance,
with the built-in and entrypoints provided by the plugins loaded.
)r?   add_hookspecsr    rm   r   r   rk   r   r!   r   r   r   r   r   r   rz   r   )plugin_managers    rQ   get_plugin_managerr    s     ()N  ,		!	! 
		 
			
 
		 
	"	" 
	#	# 
	$	$ 
 	'	' 
	&	& ##H-rS   )r  r?   )Zr  
__future__r   rH   loggingrQ  importlib.metadatar   inspectr   r   typingr   r   pluggyauxlibr
   
auxlib.ishr   base.constantsr   r   base.contextr   	common.ior   
exceptionsr   r   r   r    r   r   r   r   r   r   r   r   r   configr   hookspecr    subcommands.doctorr!   collections.abcr"   r#   r$   requests.authr%   common.pathr&   core.path_actionsr'   
core.solver(   models.match_specr)   models.recordsr*   typesr+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   	getLoggerr-  ru   PluginManagerr?   rI   r  r}   rS   rQ   <module>r     s    #   	 , & *    G "   
 
 
 !   -2&&*#-.     , !m-- m`  rS   