
    si                        S r SSKJr  SSKrSSKrSSKJrJrJr  SSK	J
r
  SSKJr  \
(       a
  SSKJrJrJr  \R"                  " \5      rSS	 jr\" S
SSS9S 5       rSS jrSS jrg)zCLI implementation for `conda compare`.

Compare the packages in an environment with the packages listed in an environment file.
    )annotationsN)abspath
expanduser
expandvars)TYPE_CHECKING   )
deprecated)ArgumentParser	Namespace_SubParsersActionc                    SSK Jn  SSKJnJn  SnUnU" S5      nU R
                  "  SUUUS.UD6nU" U5        U" U5        UR                  SS	S
S9  UR                  SS9  U$ )Nr   )dals   )add_parser_jsonadd_parser_prefixz,Compare packages between conda environments.a  
        Examples:

        Compare packages in the current environment with respect
        to 'environment.yml' located in the current working directory::

            conda compare environment.yml

        Compare packages installed into the environment 'myenv' with respect
        to 'environment.yml' in a different directory::

            conda compare -n myenv path/to/file/environment.yml

        )helpdescriptionepilogfilestorez<Path to the environment file that is to be compared against.)actionr   zconda.cli.main_compare.execute)func)compare)
auxlib.ishr   helpersr   r   
add_parseradd_argumentset_defaults)	sub_parserskwargsr   r   r   summaryr   r   ps	            6lib/python3.13/site-packages/conda/cli/main_compare.pyconfigure_parserr$      s    !;<GK	F" 				
 	A AaNNK  
 NN8N9H    z26.3z26.9z<Use `conda.core.prefix_data.PrefixData.map_records` instead.)addendumc                    SSK Jn  SSKJn  [        R
                  R                  U 5      (       d  U" U 5      e[        U" U SS9R                  5       S S9$ )Nr   
PrefixData)EnvironmentLocationNotFoundTinteroperabilityc                    U R                   $ N)name)xs    r#   <lambda>get_packages.<locals>.<lambda>O   s    affr%   )key)	core.prefix_datar)   
exceptionsr*   ospathisdirsortediter_records)prefixr)   r*   s      r#   get_packagesr<   A   sK     .877==  )&116D1>>@ r%   c                    SSK Jn  / nU Hq  nU" U5      nUR                  =o`;   aA  UR                  X   =n5      (       d%  UR	                  U SU SUR
                   35        M[  M]  UR	                  U S35        Ms     U(       d  SS/4$ SU4$ )	Nr   )	MatchSpecz( found but mismatch. Specification pkg: z, Running pkg: z
 not foundr   zzSuccess. All the packages in the specification file are present in the environment with matching version and build string.r   )models.match_specr>   r/   matchappendspec)active_pkgsspecification_pkgsr>   errorspkgpkg_specr/   
active_pkgs           r#   compare_packagesrI   S   s    -F!S>MM!D1>>0A"A*BBfDSE J$$.OO#46 C MMTF*-. " 6
 
 	

 f9r%   c                   SSK Jn  SSKJn  SSKJn  SSKJn  UR                  SS9nUR                  5         U R                  R                  S	S5      S
   nXt;   a  U R                  nO'[        [        [        U R                  5      5      5      nUR                  R!                  UUR"                  S9n	U	R%                  U5      n
U
R&                  nUR)                  5       n/ UR*                  QS UR,                  R/                  5        5       Q7n[1        X5      u  pUR2                  (       a
  U" U5        U$ [5        SR7                  [9        [:        U5      5      5        U$ )Nr   )contextr(   )CONDA_SESSION_SCHEMESr   )stdout_jsonTr+   z://r   )sourcer/   c              3  :   #    U  H  nU  H  nUv   M	     M     g 7fr.    ).0packagespackages      r#   	<genexpr>execute.<locals>.<genexpr>   s$      

:# # :s   
)base.contextrK   r4   r)   gateways.connection.sessionrL   commonrM   from_contextassert_environmentr   splitr   r   r   plugin_managerget_environment_specifierenvironment_specifierenvironment_specenvmap_recordsrequested_packagesexternal_packagesvaluesrI   jsonprintjoinmapstr)argsparserrK   r)   rL   rM   prefix_data
url_schemefilename	spec_hookrB   ra   rC   rD   exitcodeoutputs                   r#   executers   j   s9   &-C#))4)@K""$*1-J*99:j&;<=&&@@** A I %%h/D
((C))+K			

1188:

 (HH||F O 	diiC()*Or%   )r   r   returnr
   )rt   ztuple[int, list[str]])rk   r   rl   r
   rt   int)__doc__
__future__r   loggingr6   os.pathr   r   r   typingr   deprecationsr	   argparser
   r   r   	getLogger__name__logr$   r<   rI   rs   rP   r%   r#   <module>r      sl   
 #  	 3 3   %EE!'T 

K



.'r%   