
    i!                        S 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  SSKJ	r	  SSKJ
r
  SS	KJr  SS
KJr  / r " S S\5      r\" \R                  5      S-  S-  r " S S\
5      r\" S5      \" S5      \" S\R$                  S5      S.rS\	\\\4      S\\\4   4S jr S0S\S\\\4   S\SS4S jjr S1S\S\S\	\\\4      4S jjr S1S\S\S\4S jjr   S2S\\\4   S\S\S \SS4
S! jjrS0S \SS4S" jjrS3S\SS4S# jjr\S$:X  a  SSKr\R<                  S%S  V s/ s H  o S&;  d  M
  U PM     sn r\ " \R<                  5      S%:X  d  \(       a^  \!" S'\R<                  S    S(3\RD                  S)9  \(       a#  \!" S*S+RG                  \5       3\RD                  S)9  \RH                  " S%5        S,\R<                  ;   a  \" S-\R<                  ;   S.9  S/\R<                  ;   a  \" 5         gggs  sn f )4ad  Configuration manager for the conda plugin.

This file is used as a central location to manage global configuration
settings and deliver them to the locations where they are needed, including
other modules and YAML configuration files. It is designed to be callable as
a standalone script or as a module. It can install a conda configuration file
in the prefix, and to verify its existence and expected behavioral impact.
These functions are both used by the conda recipe itself.

It is imperative that this module not include any other anaconda_auth imports
so that it can be run during the conda build process
    N)Enum)Path)Any)Dict)List)
NamedTuple)Set)Unionc                       \ rS rSrSrSrSrg)CredentialType   zapi-keyz
repo-token N)__name__
__module____qualname____firstlineno__API_KEY
REPO_TOKEN__static_attributes__r       ;lib/python3.13/site-packages/anaconda_auth/_conda/config.pyr   r      s    GJr   r   z	condarc.dzanaconda-auth.ymlc                   P    \ rS rSr% \\S'   \R                  r\\S'   Sr	\
\S'   Srg)TokenDomainSetting*   token_domaindefault_credential_typeF$autoconfigure_conda_channel_settingsr   N)r   r   r   r   str__annotations__r   r   r   r   boolr   r   r   r   r   r   *   s$    .<.D.D^D16($6r   r   zanaconda.comT)zrepo.continuum.iozrepo.anaconda.comzrepo.anaconda.cloudchannel_settingsreturnc                 X    U  Vs0 s H  oS   UR                  SS5      _M     sn$ s  snf )zb
Extract the authentication information for each channel
for better comparison with expectations.
channelauth )get)r!   cs     r   _dictifyr)   9   s1    
 6FF5EiL!%%++5EFFFs   'contextexpectedfilteredc                     [        U R                  5      nU(       a+  UR                  5        VVs0 s H  u  pEXA;   d  M  XE_M     nnnX1:X  d   SU< SU< 35       egs  snnf )zt
Compare just the channel authentication information for each
channel with the expectation, with order independence
zfound=z, expected=N)r)   r!   items)r*   r+   r,   foundkvs         r   _assert_settingsr2   A   sb     W--.E"*.."2D"2$!am"2D68+66 Es
   AAinclude_defaultsinclude_sitesc                 N   [        5       nU (       a*  UR                  S [        R                  5        5       5        U(       aE  SSKJn  UR                  S U" 5       R                  R                  R                  5        5       5        U Vs/ s H  nSU S3SS.PM     sn$ s  snf )	Nc              3   P   #    U  H  u  pUR                   (       d  M  Uv   M     g 7fN)r   ).0repo_domainsettingss      r   	<genexpr>*_build_channel_settings.<locals>.<genexpr>S   s%      
)A%<< K)As   &	&r   )AnacondaAuthSitesConfigc              3   8   #    U  H  oR                   v   M     g 7fr7   )domain)r8   ss     r   r;   r<   \   s     U'T!XX'Ts   zhttps://z/*zanaconda-auth)r$   r%   )	setupdateTOKEN_DOMAIN_MAPr.   anaconda_auth.configr=   sitesrootvalues)r3   r4   hostsr=   hosts        r   _build_channel_settingsrJ   N   s     eE 
)9)?)?)A
 	

 @U'>'@'F'F'K'K'R'R'TUURWXRW$(4&+_ERWXXXs   B"c           	      ,   [        X5      nSS/nUR                  S5        U H9  nSnUR                  5        H   u  pgUR                  U U SU S35        SnM"     M;     U(       d  US==   S	-  ss'   UR                  S
5        SR                  U5      $ )Nz# DO NOT EDIT THIS FILE.z:# This file was generated automatically for anaconda-auth.zchannel_settings:z- z: ""z  z []r&   
)rJ   appendr.   join)r3   r4   r:   linesrecordpfxkeyvalues           r   _build_channel_yamlrV   `   s     ''7GH 	#DE 
LL$% ,,.JCLLC5Sq12C ) 
 b	U		LL99Ur   fpath	overwritec                     [        U 5      R                  U(       a  SOSS9 nUR                  [        X5      5        S S S 5        g ! , (       d  f       g = f)Nwx)mode)r   openwriterV   )rW   r3   r4   rX   fps        r   _write_channel_settingsr`   v   s>     
e		isS		9R
$%5EF 
:	9	9s   A
Ac                 ^    [         R                  R                  SSS9  [        [         SU S9  g )NT)parentsexist_okF)r4   rX   )PREFIX_CONDARC_PATHparentmkdirr`   rX   s    r   _write_condarc_d_settingsrh      s*    $$TD$A5Ir   c                 j    SSK Jn  UR                  5         [        SS9n[	        U[        U5      U S9  g )Nr   )r*   F)r4   )r,   )conda.base.contextr*   __init__rJ   r2   r)   )r,   r*   r+   s      r   _verify_channel_settingsrl      s,    *&U;HWhx08Dr   __main__   )	--install--verify--overwritezUsage: z% [--install] [--verify] [--overwrite])filezInvalid option(s):  ro   rq   rg   rp   )F)TT)TTF)T)%__doc__sysenumr   pathlibr   typingr   r   r   r   r	   r
   __all__r   prefixrd   r   r   rC   r   r)   r    r2   rJ   rV   r`   rh   rl   r   argvinvalidlenprintstderrrP   exit)r[   s   0r   <module>r      s           
T 
 3::&47JJ 7 7 ,N;+N;-114 GtDcN3 GS#X G >C
7
7 cN
76:
7	
7 :>YY26Y	$sCx.Y& :>260 "	GsGG G 	G
 
G $ Et Et E z 88AB<a,T#T<G 388}Wchhqk]"GH	
 '(9':;#**Mchh!MSXX,EFSXX " ! s   $	G21G2