
    sicL                       % S r SSKJr  SSKrSSKrSSK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  SS	KJr  SS
KJrJr  SSKJr  SSKJr  \(       a"  SSKJrJrJr  SSK J!r!  SSKJ"r"  SSK#J$r$  SSK%J&r&  \" \'5      r(S2S jr)S3S jr*1 Skr+S\,S'   1 \+kSiSiSiSiSiSiSiSiS ir-S\,S!'   S4S" jr.S5S# jr/S6S$ jr0S7S% jr1S8S& jr2S7S' jr3\S(   r4  " S) S*5      r5\" S+S,S-S.9S9S/ j5       r6S:S0 jr7S;S1 jr8g)<z\CLI implementation for `conda info`.

Display information about current conda installation.
    )annotationsN)SUPPRESS_StoreTrueAction)cached_property)	getLogger)exists
expanduserisfilejoin)
gettempdir)wrap)TYPE_CHECKINGLiteral   )
deprecated)ArgumentError)ArgumentParser	Namespace_SubParsersAction)Iterable)Any)Context)PackageRecordc           
     B   SSK Jn  SSKJn  SnUnSnU R                  "  S&UUUS.UD6nU" U5        UR                  SS	U[        S
9  UR                  SSS	SS9  UR                  SS	SS9  UR                  SSS	SS9  UR                  SS[        R                  " SS[        5      [        S9  UR                  SSS	SS9  UR                  SS	SS9  UR                  S[        R                  " SS[        SS9[        S S!9  UR                  S"S	S#S9  UR                  S$S%9  U$ )'Nr   )NULL   )add_parser_jsonz0Display information about current conda install. )helpdescriptionepilogz	--offline
store_true)actiondefaultr   z-az--allzShow all information.)r#   r   z--basezDisplay base environment path.z-ez--envszPList all known conda environments. Combine with `--json` to obtain more details.z-lz	--license25.926.3z-sz--systemzList environment variables.z--sizeziShow conda-managed disk usage for each environment (excludes untracked files created after installation).z--rootzUse `--base` instead.addendumbase)r#   r   destz--unsafe-channelsz-Display list of channels with tokens exposed.zconda.cli.main_info.execute)func)info)common.constantsr   helpersr   
add_parseradd_argumentr   r   r#   r   set_defaults)sub_parserskwargsr   r   summaryr    r!   ps           3lib/python3.13/site-packages/conda/cli/main_info.pyconfigure_parserr7   #   s   '(@GKF			
 	A ANN	   NN$	   NN-  
 NN_	   NN  1AB	   NN*	   NNx  
 NN  ,	
   
 NN<   NN5N6H    c                    SSK Jn   / n U (       d  [        [        S5      5      (       ah  [        R
                  " S5      n[        R                  " [        S5      5       H/  nUR                  U5      (       d  M  UR                  SU 35        M1     U$ S[        R                  ;  a  U$ [        R                  S   n[        [        US5      5      (       a;  [        R                  " [        US5      5       Vs/ s H  n[        USU5      PM     nnU$ s  snf ! [         a!  n[        R                  S	U5         S
nAU$ S
nAff = f)zZ
Method used to populate ``site_dirs`` in ``conda info``.

:returns: List of directories.
r   on_winz~/.local/libzpython\d\.\dz~/.local/lib/APPDATAPythonPYTHONz'Error accessing user site directory.
%rN)common.compatr;   r   r	   recompileoslistdirmatchappendenvironr   OSErrorlogdebug)r;   	site_dirs	python_repathr<   ies          r6   get_user_siterO   q   s     'IAj011JJ7	JJz/'BCD t,,!((=)?@ D  

*  jj+Gd7H-..  ZZWh(?@@ (A.@     A		<a@@As=   A,D :D D *AD 9DD D 
E#D??E>   authfilesprioritypreferred_envzset[str]IGNORE_FIELDSnameversionbuildbuild_numberchannelschannelsizefndependsSKIP_FIELDSc                    U R                  5       R                  5        VVs0 s H  u  pU[        ;  d  M  X_M     snn$ s  snnf )z
Returns a dictionary of key/value pairs from ``prec``.  Keys included in ``IGNORE_FIELDS`` are not returned.

:param prec: A ``PackageRecord`` object.
:returns: A dictionary of elements dumped from ``prec``
)dumpitemsrT   )preckvs      r6   dump_recordre      s:     "YY[..0K0TQA]4JDAD0KKKs
   A A c           
         SSK Jn  [        U 5      nU R                  US   US   US   US   [	        U R
                  5      U" US   5      S.n[        [        UR                  5       5      [        -
  5       H	  nX$   X4'   M     [        5         S	R                  US   US   US
   5      n[        U5        [        S[        U5      -  5        U H  n[        U<S SX4   < 35        M     [        S5        US    H  n[        SU 35        M     g)zQ
Pretty prints contents of a ``PackageRecord``

:param prec: A ``PackageRecord``
r   )human_bytesrU   rV   rW   rX   r[   )z	file namerU   rV   build stringzbuild numberrY   r[   z{} {} {}rh   -12: zdependencies:r]   z    N)utilsrg   re   r\   strrY   sortedsetkeysr^   printformatlen)rb   rg   pkgdkeyheaderdeps          r6   pretty_packagery      s     $
d
CWWFy>GN+t||$CK(	A c#((*o34 5 
Gqy!I,.8IJF	&M	#F
S!&)* 	/9~SEl r8   c                 	   SSK Jn   SSK Jn  SSKJnJnJnJnJn  SSK	J
n  SSKJn  SSKJn	  SSKJn
Jn   S	SKJn  U	" 5       R0                  nUR3                  5        Vs/ s H%  oR4                  UR6                  UR8                  /PM'     nn[;        U
" UR<                  5      5      nUR>                  (       d$  U Vs/ s H  nUU" U5      (       a  SOS-   PM     nnU Vs/ s H  nU" U5      PM     nn[@        RB                  RE                  S5      nU(       d  [G        S5      n[I        U5      (       a  UnU" URJ                  5      nURL                  URO                  5       URL                  U:H  S.n[Q        S@0 SURR                  _SU_SU_SU_SURT                  _SURV                  _SURX                  _SURZ                  _SUR\                  _SUR^                  _SUR`                  _SURb                  _S URJ                  _S!U_S"URd                  _S#U_S$U_S%U_S&U_S'URf                  _S(/ _S)S*Ri                  [k        [l        [n        Rp                  5      5      _S+URr                  _S,URt                  _S-U _S.URv                  _S/U_S0U_S1U_S2[y        5       _6nU(       a  SS3K=J>n  U" 5       US4'   O0[@        R~                  " 5       US5'   [@        R                  " 5       US6'   1 S7knUR                  S8 [@        RB                   5       5        UR                  S9 [@        RB                   5       5        UR                  S: [@        RB                   5       5        UR                  S; [@        RB                   5       5        U Vs0 s H>  nU[@        R                  " U[@        R                  " UR                  5       S<5      5      _M@     nnS= [@        RB                   5       nUR                  U Vs0 s H  nUS>_M     sn5        UR                  [n        R6                  [n        R                  [n        R                  [        5       US?.5        U$ ! [&         a#  n[(        R+                  S
U5        Sn SnAGNASnAf[,         a#  n[(        R/                  SU5        Sn SnAGNlSnAff = fs  snf s  snf s  snf s  snf s  snf )Azs
Returns a dictionary of contextual information.

:returns:  Dictionary of conda information to be sent to stdout.
r   )CONDA_PACKAGE_ROOT)__version__)DEFAULT_SOLVERcontextenv_namesys_rc_pathuser_rc_pathr:   )mask_anaconda_token)Index)all_channel_urlsoffline_keepr   z Unable to import conda-build: %sznot installedNzError importing conda-build: %serrorr   z  (offline)NETRCz~/.netrc)rU   
user_agentr$   platformconda_versionconda_env_versionconda_build_versionroot_prefixconda_prefixav_data_dirav_metadata_url_baseroot_writable	pkgs_dirs	envs_dirsdefault_prefixactive_prefixactive_prefix_nameconda_shlvlchannelsr   rc_pathr   offlineenvspython_version.requests_versionr   conda_locationconfig_files
netrc_filevirtual_pkgssolvertmp_dir)is_admin_on_windowsis_windows_adminUIDGID>   CIO_TEST
LD_PRELOADSSL_CERT_FILECURL_CA_BUNDLEREQUESTS_CA_BUNDLEc              3  p   #    U  H,  oR                  5       R                  S 5      (       d  M(  Uv   M.     g7f)CONDANupper
startswith.0rd   s     r6   	<genexpr> get_info_dict.<locals>.<genexpr>2  s#     O:a1E1Eg1N:   '6	6c              3  p   #    U  H,  oR                  5       R                  S 5      (       d  M(  Uv   M.     g7f)r>   Nr   r   s     r6   r   r   3  s#     P:a1E1Eh1O:r   c              3  p   #    U  H,  oR                  5       R                  S 5      (       d  M(  Uv   M.     g7f)PATHNr   endswithr   s     r6   r   r   4  s#     L:a1C1CF1K:r   c              3  p   #    U  H,  oR                  5       R                  S 5      (       d  M(  Uv   M.     g7f)SUDONr   r   s     r6   r   r   5  s#     N:a1E1Ef1M:r   z	<not set>c              3  p   #    U  H,  oR                  5       R                  S 5      (       d  M(  Uv   M.     g7f)PROXYNr   r   s     r6   r   r   ;  s#     GZ779+=+=g+F!!Zr   z<set>)zsys.versionz
sys.prefixzsys.executablerJ   env_vars )Gr   r{   r|   base.contextr}   r~   r   r   r   r?   r;   
common.urlr   
core.indexr   models.channelr   r   conda_buildImportErrorrH   rI   	Exceptionr   system_packagesvaluesrU   rV   rW   listr   jsonrB   rF   getr	   r
   r   r   solver_user_agentdictsubdirr   r   r   signing_metadata_url_baser   r   r   r   shlvlr   r   maprm   sysversion_infor   r   r   r   common._os.windowsr   geteuidgetegidupdategetenvlowerprefix
executablerO   )r{   r   r}   r~   r   r   r   r;   r   r   r   r   r   errvirtual_pkg_indexr5   r   r   cr   
user_netrcr   r   	info_dictr   env_var_keysevr   
proxy_keyss                                r6   get_info_dictr      st    &/  '0"?&B //:K:R:R:TU:TQVVQYY0:TLU$W%5%567H<<LTUHqA|AMBHU0891#A&H9(J
+
*#J!'"7"78 //1>>^3F    #  (  0	 
 ''  ))  ''  %>>  ++  ##  ##  --  ++  .  MM   ! " "# $ % &  ' * + , - . xxC)9)9 :;/ 0 !111 2 %%3 4 *5 6 ))7 8 9 : "; < = > ? IB <(;(=	$%::<	%::<	%L O2::OOP2::PPL2::LLN2::NN IUHT"BIIb"))BHHJ<==   HRZZGJOO:6:RR[:67;;**!nn& 	
 M  .		4c:- &		3S9%&
 V V9N
 7sB   Q ,R0=R5!R:	AR?6S
R-Q==R-
R((R-c                x   / nUR                  SS-  5        U R                  S0 5      n[        U5       Hs  n[        X#   5      n[	        U5      (       a  US   OSn[	        U5      S:  a  USS OSnUR                  U<S	 S
U< 35        U H  nUR                  SU-   5        M     Mu     SR                  U5      $ )z
Returns a printable string representing environment variables from the dictionary returned by ``get_info_dict``.

:param info_dict:  The returned dictionary from ``get_info_dict()``.
:returns:  String to print.
z%23s:zenvironment variablesr   r   r   r   Nr   z>25=z                          
)rE   r   rn   r   rs   r   )r   builderr   rv   value
first_lineother_linesvals           r6   get_env_vars_strr   K  s     GNN7445}}Z,HhX]#!$UU1X
#&u:>eABirC45CNN8c>*    99Wr8   c                r   ^ ^^ SSK Jm  SS jmUU U4S jnU" 5        VVs0 s H  u  p#X#_M	     snn$ s  snnf )zI
Returns the data that can be used to display information for conda info
r   r:   c                @    SR                  [        [        U 5      5      $ )Nz
                          )r   r   rm   )liness    r6   flatten&get_main_info_display.<locals>.flattenf  s    %%c#uo66r8   c               3    >#    TS   (       a  STS   4v   STS   4v   O	STS   4v   TS   S:  a	  STS   4v   STS	   4v   S
T" TS   5      4v   STS   4v   STS   4v   STS   4v   STS   S    TS   S   (       a  SOS 34v   ST" S TS    5       5      4v   TS   (       a  SOSn STS    SU  S 34v   S!TS"   4v   S#TS$   4v   S%T" TS&   5      4v   S'T" TS(   5      4v   S)T" TS*   5      4v   S+TS,   4v   S-TS-   4v   S.TS/   4v   T(       a
  S0TS1   4v   OS2TS3    S4TS5    34v   S6TS7   4v   S8TS9   4v   g 7f):Nr   zactive environmentzactive env locationr   r   r   zshell levelzuser config filer   zpopulated config filesr   zconda versionr   zconda-build versionr   zpython versionr   r   rU   r$   z
 (default)r   zvirtual packagesc              3  D   #    U  H  nS R                  U5      v   M     g7f)r   N)r   )r   rt   s     r6   r   9get_main_info_display.<locals>.builder.<locals>.<genexpr>~  s     G-FcCHHSMM-Fs    r   r   writablez	read onlyzbase environmentr   z  ()zconda av data dirr   zconda av metadata urlr   zchannel URLsr   zpackage cacher   zenvs directoriesr   ztemporary directoryr   r   z
user-agentr   administratorr   zUID:GIDr   :r   z
netrc filer   zoffline moder   r   )r   r   r   r;   s    r6   r   &get_main_info_display.<locals>.builderi  s    )*'3G)HII()O*DEE'?)CDD]#q( )M":;;!9^#<=='>1J)KLL	/ :;;$i0E&FGG+;!<=="6*+Ih<OPY<ZL`b+cd
 	

 GY~-FGG
 	
 "+?!;:!i&>%?s8*A#NOO"Im$<==&	2H(IJJwy'<=>>	+(> ?@@!79[+A#BCC$i	&:;;9Z011Y|455"I.@$ABB5!1 2!Ie4D3EFGGY|455y344s   EE)r   zIterable[str]returnrm   )r?   r;   )r   r   rv   r   r   r;   s   `   @@r6   get_main_info_displayr   `  s3     '7(5T *13:3CJ333s   3c                p    [        U 5      nSR                  S/S UR                  5        5       QSP75      $ )z
Returns a printable string of the contents of ``info_dict``.

:param info_dict:  The output of ``get_info_dict()``.
:returns:  String to print.
r   r   c              3  6   #    U  H  u  pUS  SU 3v   M     g7f)z>23z : Nr   )r   rv   r   s      r6   r   $get_main_info_str.<locals>.<genexpr>  s!     M8L*##c#eW%8Ls   )r   r   ra   )r   display_infos     r6   get_main_info_strr    s>     )3L99	RM8J8J8LMRrR r8   )r)   r   r   systemdetailjson_allc                      \ rS rSrSrSSS jjr\S 5       r\SS j5       r\SS j5       r	SS jr
SS jrSS	 jrSS
 jrS rSS jrSS jrSrg)InfoRendereri  z?
Provides a ``render`` method for rendering ``InfoComponents``
c                8    Xl         X l        S S SSS S S.U l        g )Ndetail_view	envs_list)r)   r   r  r   r  r  )_context
_show_size_component_style_map)selfr~   	show_sizes      r6   __init__InfoRenderer.__init__  s(    ##%
!r8   c                V    [        5       nU R                  US'   U R                  US'   U$ )Nr   envs_details)r   _info_dict_envs_info_dict_envs_details)r  r   s     r6   
_info_dictInfoRenderer._info_dict  s/    !O	 00	&$($@$@	.!r8   c                    SSK Jn  U" 5       $ )Nr   )list_all_known_prefixes)core.envs_managerr  )r  r  s     r6   r  InfoRenderer._info_dict_envs  s    ?&((r8   c           	        SSK Jn  0 nU R                  R                  =n(       a	  U" U5      nOS nU R                   H  nU" U5      nUR
                  =n(       a  UR                  5       nUR                  =n(       a  UR                  5       nUR                  UUXd:H  UR                  5       UR                  5       UR                  S.X%'   U R                  (       d  M  UR                  5       X%   S'   M     U$ )Nr   )
PrefixData)rU   createdlast_modifiedactiver)   frozenr   r[   )core.prefix_datar  r  r   r  r   	isoformatr!  rU   is_base	is_frozenis_writabler  r[   )	r  r  resultr   active_prefix_datar   prefix_datar   r!  s	            r6   r  $InfoRenderer._info_dict_envs_details  s    1 MM777=7!+M!:!%**F$V,K%---w-!++- + 9 99}9 - 7 7 9#(("!.%;#++-%//1'33FN )4)9)9);v&! +" r8   c                    SSK Jn  U Hq  nU R                  R                  U5      n[	        U SU S3S5      nU(       d  M8  U" 5       nU(       d  MH  0 nUS:X  a  U R
                  (       a  SUS'   U" U4S	U0UD6  Ms     g)
z
Iterates through the registered components, obtains the data to render via a
``_<component>_component`` method and then renders it.
r   )render_
_componentNr   Tr  style)	reportersr.  r  r   getattrr  )r  
componentsr.  	componentr1  	data_funcdatar3   s           r6   r.  InfoRenderer.render  s    
 	'#I--11)<E)J&?FI;Dt&4??*.F;'t353F3 $r8   c                    U R                   R                  (       a  SU R                   R                  0$ U R                   R                   S3$ )Nr   r   )r  r   r   r  s    r6   _base_componentInfoRenderer._base_component  s<    ==!4==#<#<==mm//033r8   c                    U R                   R                  (       a  SU R                   R                  0$ SR                  U R                   R                  5      nU S3$ )Nr   r   )r  r   r   r   )r  channels_strs     r6   _channels_component InfoRenderer._channels_component  sI    == 6 67799T]]%;%;<L"^2&&r8   c                ,    [        U R                  5      $ N)r   r  r:  s    r6   _detail_componentInfoRenderer._detail_component  s    $T__55r8   c                    U R                   R                  (       a  U R                  U R                  S.$ U R                  $ )N)r   r  )r  r   r  r  r:  s    r6   _envs_componentInfoRenderer._envs_component  s9    ==,, $ < <  ###r8   c           
     
   SSK J nJn  S[        R                  S S  S3S[        R                   3S[        R
                   3SR                  U R                  S	   5      /n[        [        U" 5       S
-   5      5       H,  nUR                  SR                  XB" SU-   5      5      5        M.     U R                  S   nU(       a  UR                  SUS    35        OUR                  S5        USS   H  nUR                  SU 35        M     UR                  S5        [        U R                  S   R                  5       5       H  u  pxUR                  U SU 35        M     UR                  S5        SR                  U5      $ )Nr   )find_commandsfind_executablezsys.version: (   z...zsys.prefix: zsys.executable: zconda location: {}r   )rW   zconda-{}: {}zconda-rJ   zuser site dirs: r   zuser site dirs:z                r   r   rk   r   )rI  rJ  r   rV   r   r   rr   r  rn   ro   rE   ra   r   )	r  rI  rJ  outputcmdrJ   site_dirrU   r   s	            r6   _system_componentInfoRenderer._system_component  s]   A CKK,-S13::,'s~~./ ''8H(IJ	
 #mo
:;<CMM.//_XPS^5TUV = OOK0	MM,Yq\N;<MM+,!!"HMM,XJ78 & 	b!$//*"="C"C"EFKDMMTF"UG,- G 	byy  r8   c                    U R                   $ rB  )r  r:  s    r6   _json_all_component InfoRenderer._json_all_component/  s    r8   )r  r  r  N)F)r~   r   r  boolr   z	list[str])r   z-dict[str, dict[str, str | bool | None | int]])r4  Iterable[InfoComponents])r   z
str | dict)r   dict[str, str])r   rm   r   dict[str, Any])__name__
__module____qualname____firstlineno____doc__r  r   r  r  r  r.  r;  r?  rC  rF  rO  rR  __static_attributes__r   r8   r6   r	  r	    sk    

   ) )
  64,4'6$!>r8   r	  r%   r&   z7Use `conda.cli.main_info.iter_info_components` instead.r'   c                *    [        [        X5      5      $ rB  )ro   iter_info_componentsargsr~   s     r6   get_info_componentsrd  3  s     #D233r8   c              #    #    U R                   (       a  Sv   U R                  (       a  Sv   U R                  (       d"  U R                  (       dH  U R                  (       d7  UR
                  (       d&  U R                   (       d  U R                  (       d  Sv   U R                  (       d"  U R                  (       a  UR
                  (       d  Sv   Sv   U R                  (       d  U R                  (       a  UR
                  (       d  Sv   UR
                  (       a;  U R                   (       d)  U R                  (       d  U R                  (       d  Sv   ggggg7f)	z
Determine which components to display.

:param args: The parsed command line arguments.
:param context: The conda context.
:returns: An iterable of components to display.
r)   r   r  r   r  r  r  N)r)   unsafe_channelsallr   r  r   rb  s     r6   ra  ra  <  s      yy 
$))DKK		$$yyTXXglltxx||DIId.B.B499 LU.BI|s   EEc                    SSK Jn  U R                  (       a  U R                  (       d  [	        S5      e[        X5      n[        U SS5      n[        X$S9nUR                  U5        g)z
Implements ``conda info`` command.

 * ``conda info``
 * ``conda info --base``
 * ``conda info <package_spec> ...``
 * ``conda info --unsafe-channels``
 * ``conda info --envs``
 * ``conda info --system``
r   )r~   z#--size can only be used with --envsr[   F)r  r   )	r   r~   r[   r   r   ra  r3  r	  r.  )rc  parserr~   r4  r  renderers         r6   executerk  ]  sQ     'yyABB%d4Jfe,IG9HOOJr8   )r2   r   r   r   rU  )rb   r   r   rY  )rb   r   r   NonerX  )r   rY  r   rm   )r   rY  r   rW  )rc  r   r~   r   r   zset[InfoComponents])rc  r   r~   r   r   rV  )rc  r   ri  r   r   int)9r^  
__future__r   rB   r@   r   argparser   r   	functoolsr   loggingr   os.pathr   r	   r
   r   tempfiler   textwrapr   typingr   r   deprecationsr   
exceptionsr   r   r   r   collections.abcr   r   r   r   models.recordsr   rZ  rH   r7   rO   rT   __annotations__r^   re   ry   r   r   r   r  InfoComponentsr	  rd  ra  rk  r   r8   r6   <module>r|     sI  
 # 	 	 
 / %  4 4   ) % &EE(&.K\> Ix H
  	
     	 X LB}@*34l ST 9H HV 

F
4
4Br8   