
    \ZiJ                       % 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	  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  \(       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%S,S jr&S-S 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 '   S.S! jr+S/S" jr,S0S# jr-S1S$ jr.S2S% jr/S1S& jr0\S'   r1  " S( S)5      r2S3S* jr3S4S+ jr4g)5z\CLI implementation for `conda info`.

Display information about current conda installation.
    )annotationsN)SUPPRESS)cached_property)	getLogger)exists
expanduserisfilejoin)
gettempdir)wrap)TYPE_CHECKINGLiteral   )ArgumentError)ArgumentParser	Namespace_SubParsersAction)Iterable)Any)Context)PackageRecordc                   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S	SS9  UR                  SS	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-sz--systemzList environment variables.z--sizeziShow conda-managed disk usage for each environment (excludes untracked files created after installation).z--unsafe-channelsz-Display list of channels with tokens exposed.zconda.cli.main_info.execute)func)info)common.constantsr   helpersr   
add_parseradd_argumentr   set_defaults)sub_parserskwargsr   r   summaryr   r   ps           3lib/python3.13/site-packages/conda/cli/main_info.pyconfigure_parserr/   "   s0   '(@GKF			
 	A ANN	   NN$	   NN-  
 NN_	   NN*	   NNx  
 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.compatr3   r   r   recompileoslistdirmatchappendenvironr
   OSErrorlogdebug)r3   	site_dirs	python_repathr4   ies          r.   get_user_siterG   _   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itemsrL   )preckvs      r.   dump_recordr]      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_bytesrM   rN   rO   rP   rS   )z	file namerM   rN   build stringzbuild numberrQ   rS   z{} {} {}r`   -12: zdependencies:rU   z    N)utilsr_   r]   rT   strrQ   sortedsetkeysrV   printformatlen)rZ   r_   pkgdkeyheaderdeps          r.   pretty_packagerq      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 r0   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_pathr2   )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)rM   
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channelsry   rc_pathrx   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.0r\   s     r.   	<genexpr> get_info_dict.<locals>.<genexpr>   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)r6   Nr   r   s     r.   r   r   !  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     r.   r   r   "  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     r.   r   r   #  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     r.   r   r   )  s#     GZ779+=+=g+F!!Zr   z<set>)zsys.versionz
sys.prefixzsys.executablerB   env_vars )Gr   rs   rt   base.contextru   rv   rw   rx   ry   r7   r3   
common.urlrz   
core.indexr{   models.channelr|   r}   conda_buildImportErrorr@   rA   	Exceptionr~   system_packagesvaluesrM   rN   rO   listr   jsonr:   r>   getr   r	   r   r   solver_user_agentdictsubdirr   r   r   signing_metadata_url_baser   r   r   r   shlvlr   r
   mapre   sysversion_infor   r   r   r   common._os.windowsr   geteuidgetegidupdategetenvlowerprefix
executablerG   )rs   r   ru   rv   rw   rx   ry   r3   rz   r{   r|   r}   r   errvirtual_pkg_indexr-   r   r   cr   
user_netrcr   r   	info_dictr   env_var_keysevr   
proxy_keyss                                r.   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                          
)r=   r   rf   r   rk   r
   )r   builderr   rn   value
first_lineother_linesvals           r.   get_env_vars_strr   9  s     GNN7445}}Z,HhX]#!$UU1X
#&u:>eABirC45CNN8c>*    99Wr0   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   r2   c                @    SR                  [        [        U 5      5      $ )Nz
                          )r
   r   re   )liness    r.   flatten&get_main_info_display.<locals>.flattenT  s    %%c#uo66r0   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 filery   zpopulated config filesr   zconda versionr   zconda-build versionr   zpython versionr   r   rM   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   rl   s     r.   r   9get_main_info_display.<locals>.builder.<locals>.<genexpr>l  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   r3   s    r.   r   &get_main_info_display.<locals>.builderW  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]returnre   )r7   r3   )r   r   rn   r   r   r3   s   `   @@r.   get_main_info_displayr   N  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   rn   r   s      r.   r   $get_main_info_str.<locals>.<genexpr>  s!     M8L*##c#eW%8Ls   )r   r
   rY   )r   display_infos     r.   get_main_info_strr     s>     )3L99	RM8J8J8LMRrR r0   )baser   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)selfrv   	show_sizes      r.   __init__InfoRenderer.__init__  s(    ##%
!r0   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     r.   
_info_dictInfoRenderer._info_dict  s/    !O	 00	&$($@$@	.!r0   c                    SSK Jn  U" 5       $ )Nr   )list_all_known_prefixes)core.envs_managerr  )r	  r  s     r.   r  InfoRenderer._info_dict_envs  s    ?&((r0   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)rM   createdlast_modifiedactiver   frozenr   rS   )core.prefix_datar  r  r   r  r  	isoformatr  rM   is_base	is_frozenis_writabler  rS   )	r	  r  resultr   active_prefix_datar   prefix_datar  r  s	            r.   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&! +" r0   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'  	componentr*  	data_funcdatar+   s           r.   r'  InfoRenderer.render  s    
 	'#I--11)<E)J&?FI;Dt&4??*.F;'t353F3 $r0   c                    U R                   R                  (       a  SU R                   R                  0$ U R                   R                   S3$ )Nr   r   )r  r   r   r	  s    r.   _base_componentInfoRenderer._base_component  s<    ==!4==#<#<==mm//033r0   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     r.   _channels_component InfoRenderer._channels_component  sI    == 6 67799T]]%;%;<L"^2&&r0   c                ,    [        U R                  5      $ N)r   r  r3  s    r.   _detail_componentInfoRenderer._detail_component  s    $T__55r0   c                    U R                   R                  (       a  U R                  U R                  S.$ U R                  $ )N)r   r  )r  r   r  r  r3  s    r.   _envs_componentInfoRenderer._envs_component  s9    ==,, $ < <  ###r0   c                   S[         R                  S S  S3S[         R                   3S[         R                   3SR	                  U R
                  S   5      /nU R                  R                  R                  5       nUR                  SS 5      n[        [        US	S 5      S
S 5      nUR                  SU=(       d    S 35        [        UR                  5       5       H=  u  pV[        [        US	S 5      S
S 5      nUR                  SU SU=(       d    S 3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  pYUR                  U SU	 35        M     UR                  S5        SR                  U5      $ )Nzsys.version: (   z...zsys.prefix: zsys.executable: zconda location: {}r   rO   implplugin_namezconda-build: z	(missing)zconda-rc   z	(unknown)rB   zuser site dirs: r   zuser site dirs:r   z                r   r   r   )r   rN   r   r   rj   r  r  plugin_managerget_subcommandspopr,  r=   rf   rY   r
   )
r	  outputsubcommandsr   rD  rM   pluginrB   site_dirr   s
             r.   _system_componentInfoRenderer._system_component  s    CKK,-S13::,'s~~./ ''8H(IJ	
 mm22BBD!oogt4gk64@-QUVk&@[%ABC";#4#4#67LD!'&&$"?PTUKMMF4&;+E+*FGH 8 OOK0	MM,Yq\N;<MM+,!!"HMM,XJ78 & 	b!$//*"="C"C"EFKDMMTF"UG,- G 	byy  r0   c                    U R                   $ r;  )r  r3  s    r.   _json_all_component InfoRenderer._json_all_component!  s    r0   )r  r  r  N)F)rv   r   r
  boolr   z	list[str])r   z-dict[str, dict[str, str | bool | None | int]])r-  Iterable[InfoComponents])r   z
str | dict)r   dict[str, str])r   re   r   dict[str, Any])__name__
__module____qualname____firstlineno____doc__r  r   r  r  r  r'  r4  r8  r<  r?  rL  rO  __static_attributes__r   r0   r.   r  r    sl    

   ) )
  64,4'6$!!Fr0   r  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   )argsrv   s     r.   iter_info_componentsra  %  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   )rv   z#--size can only be used with --envsrS   F)r
  r   )	r   rv   rS   r   r   ra  r,  r  r'  )r`  parserrv   r-  r
  renderers         r.   executere  F  sQ     'yyABB%d4Jfe,IG9HOOJr0   )r*   r   r   r   rR  )rZ   r   r   rV  )rZ   r   r   NonerU  )r   rV  r   re   )r   rV  r   rT  )r`  r   rv   r   r   rS  )r`  r   rc  r   r   int)5r[  
__future__r   r:   r8   r   argparser   	functoolsr   loggingr   os.pathr   r   r	   r
   tempfiler   textwrapr   typingr   r   
exceptionsr   r   r   r   collections.abcr   r   r   r   models.recordsr   rW  r@   r/   rG   rL   __annotations__rV   r]   rq   r   r   r   r   InfoComponentsr  ra  re  r   r0   r.   <module>ru     s#  
 # 	 	 
  %  4 4   ) &EE(&.:z> Ix H
  	
     	 X LB}@*34l ST 9L L^Br0   