+
     h6  c                   s   R t ^ RIt^ RIt^ RIt^ RIt^ RIHtHtHtH	t	H
t
HtHt ^ RIHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ]P2                  t]
! R]4      t]'       d   R	MR
tRt]! RRRRRR7      t]P>                  ]P@                  ]PB                  ]PD                  ]PF                  3t$]P@                  ]P>                  ]PB                  3t%]! ]&4      t'R R lt(R R lt)R R lt* ! R R4      t+R# )a  Configuration management setup

Some terminology:
- name
  As written in config files.
- value
  Value associated with a name
- key
  Name combined with it's section (section.name)
- variant
  A single word describing where the configuration key-value pair came from
N)AnyDictIterableListNewTypeOptionalTuple)ConfigurationError!ConfigurationFileCouldNotBeLoaded)appdirs)WINDOWS)	getLogger)
ensure_direnumKindzpip.inizpip.confZuserZglobalZsiteZenvzenv-var)USERGLOBALSITEENVENV_VARc                s0    V ^8  d   QhR\         R\         /#    namereturnstrformat   "@/usr/lib/python3.14/site-packages/pip/_internal/configuration.py__annotate__r   2   s      # #     c                s    V P                  4       P                  RR4      p V P                  R4      '       d
   V R,          p V # )zAMake a name consistent regardless of source (environment or file)Z_Z-z--:r   NN)lowerZreplace
startswith)r      &r   _normalize_namer#   2   s7    ::<S)DtBxKr   c                sF    V ^8  d   QhR\         R\        \         ,          /# r   )r   r   r   r   r   r   r   :   s      3 49 r   c                 sV    R V 9  d   RV  R2p\        V4      hV P                  R ^4      # ).zVKey does not contain dot separated section and key. Perhaps you wanted to use 'global.z
' instead?)r   Zsplit)r   Zerror_message   & r   _disassemble_keyr&   :   s>    
$115jB 	 !//::c1r   c                s\    V ^8  d   QhR\         \        \        \        ,          3,          /# r   r   )r   r   r   r   r   r   r   r   r   D   s       dDIo!6 r   c                  sv   \         P                  ! R 4       U u. uF'  p \        P                  P	                  V \
        4      NK)  	  pp \        P                  P	                  \        P                  \
        4      p\        P                  P	                  \        P                  P                  R4      \        '       d   R MR\
        4      p\        P                  P	                  \         P                  ! R 4      \
        4      p\        P                  V\        P                  V.\        P                  W4./# u up i )ZpipZ~z.pip)r	   Zsite_config_dirsospathjoinCONFIG_BASENAMEsysZprefixZ
expanduserr
   Zuser_config_dirkindsr   r   r   )r)   Zglobal_config_filesZsite_config_fileZlegacy_config_fileZnew_config_files        r   get_configuration_filesr.   D   s    8?8P8PQV8W8WT?+8W   ww||CJJ@
3f
 ggll7#:#:5#A?SO)

%&

'9 s   -D6c                   s  a a ] tR t^Wt oRtR-V3R lV 3R llltV3R lR ltV3R lR ltV3R lR	 ltV3R
 lR lt	V3R lR lt
V3R lR ltV3R lR ltV3R lR lt]V3R lR l4       tV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R  lR! ltV3R" lR# ltV3R$ lR% ltV3R& lR' ltV3R( lR) ltV3R* lR+ ltR,tVtV ;t# ).Configurationa  Handles management of configuration.

Provides an interface to accessing and managing configuration files.

This class converts provides an API that takes "section.key-name" style
keys and stores the value associated with it as "key-name" under the
section "section".

This allows for a clean interface wherein the both the section and the
key-name are preserved in an easy to manage form in the configuration files
and the data stored is also nice.
c                s:   < V ^8  d   QhRS[ RS[S[,          RR/# )r   isolated	load_onlyr   N)Zboolr   r   r   __classdict__   "r   r   Configuration.__annotate__e   s+     G G G(4. GD Gr   c           
     s^  < \         SV `  4        VeG   V\        9  d<   \        RP	                  RP                  \        \        \        4      4      4      4      hWn        W n	        \         Uu/ uF  q3. bK  	  upV n        \         Uu/ uF  q3/ bK  	  upV n        . V n        R # u upi u upi )Nz5Got invalid value for load_only - should be one of {}z, )Zsuper__init__VALID_LOAD_ONLYr   r   r*   ZmapZreprr0   r1   OVERRIDE_ORDER_parsers_config_modified_parsers)selfr0   r1   variant	__class__s   &&& r   r6   ZConfiguration.__init__e   s     Yo%E$GNNIIc$89 
 !" (6H
'5GRK~H
 (64
'5GRK~4
 EGH
4
s   .B%	B*c                   < V ^8  d   QhRR/# r   r   N r2   r4   r   r   r5   z   s     * *d *r   c                sn    V P                  4        V P                  '       g   V P                  4        R# R# )z<Loads configuration from configuration files and environmentN)_load_config_filesr0   _load_environment_varsr<   r"   r   loadZConfiguration.loadz   s(    !}}}'') r   c                s0   < V ^8  d   QhRS[ S[,          /# r'   )r   r   r2   r4   r   r   r5      s      (3- r   c                s    V P                   f   Q R4       h V P                  4       ^ ,          #   \         d     R# i ; i)z7Returns the file with highest priority in configurationNz)Need to be specified a file to be editing)r1   _get_parser_to_modifyZ
IndexErrorrD   r"   r   get_file_to_editZConfiguration.get_file_to_edit   sC    ~~)V+VV)	--/22 		s   . ==c                sF   < V ^8  d   QhRS[ S[S[S[3,          ,          /# r'   )r   r   r   r    r2   r4   r   r   r5      s!     ( (xc3h0 (r   c                s6    V P                   P                  4       # )zPReturns key-value pairs like dict.items() representing the loaded
configuration
)_dictionaryitemsrD   r"   r   rI   ZConfiguration.items   s     %%''r   c                &   < V ^8  d   QhRS[ RS[/# )r   keyr   r   r    r2   r4   r   r   r5      s     
B 
BS 
BS 
Br   c                s    Tp\        V4      p V P                  V,          #   \         d    \        T4       \	        RT 24      hi ; i)z#Get a value from the configuration.No such key - )r#   rH   ZKeyErrorr&   r   )r<   rK   orig_keys   && r   	get_valueZConfiguration.get_value   sU    c"	B##C(( 	B S!$~hZ%@AA		Bs	   " %Ac                *   < V ^8  d   QhRS[ RS[RR/# )r   rK   valuer   NrL   r2   r4   r   r   r5      s"     . .S . . .r   c                s~   \        V4      pV P                  4        V P                  '       g   Q hV P                  4       w  r4VeH   \	        V4      w  rVVP                  V4      '       g   VP                  V4       VP                  WVV4       W P                  V P                  ,          V&   V P                  W44       R# )z$Modify a value in the configuration.N)
r#   _ensure_have_load_onlyr1   rF   r&   has_sectionZadd_sectionZsetr:   _mark_as_modified)r<   rK   rQ   fnameparsersectionr      &&&    r   	set_valueZConfiguration.set_value   s    c"##%~~~~224,S1MG %%g..""7+JJwe,,1T^^$S)u-r   c                s$   < V ^8  d   QhRS[ RR/# )r   rK   r   Nr   r2   r4   r   r   r5      s     . .s .t .r   c                s,   Tp\        V4      pV P                  4        V P                  '       g   Q hWP                  V P                  ,          9  d   \	        RV 24      hV P                  4       w  r4Ve   \        V4      w  rVVP                  V4      '       d   VP                  WV4      '       g   \	        R4      hVP                  V4      '       g   VP                  V4       V P                  W44       V P                  V P                  ,          V R# )z#Unset a value in the configuration.rM   Nz4Fatal Internal error [id=1]. Please report as a bug.)r#   rR   r1   r:   r   rF   r&   rS   Zremove_optionrI   Zremove_sectionrT   )r<   rK   rN   rU   rV   rW   r   s   &&     r   unset_valueZConfiguration.unset_value   s    c"##%~~~~ll4>>22$~hZ%@AA224,S1MG""7++0D0DW0S0S )J 
 <<((%%g.""51LL(-r   c                r?   r@   rA   r2   r4   r   r   r5      s      d r   c                s   V P                  4        V P                   Fr  w  r\        P                  RV4       \	        \
        P                  P                  V4      4        \        VR4      ;_uu_ 4       pVP                  V4       RRR4       Kt  	  R#   + '       g   i     K  ; i  \         d   p\        RT RT 24      hRp?ii ; i)z!Save the current in-memory state.zWriting to %sZwNz:An error occurred while writing to the configuration file z: )rR   r;   loggerZinfor   r(   r)   ZdirnameZopenZwriteZOSErrorr   )r<   rU   rV   Zferrors   &    r   saveZConfiguration.save   s    ##%!33MEKK/ rwwu-.%%%LLO &% 4 &%% (PgRw( s6   !B)5BB)B& B)&B))C
4CC
c                r?   r@   rA   r2   r4   r   r   r5      s     M M Mr   c                sx    V P                   f   \        R4      h\        P                  RV P                   4       R # )Nz'Needed a specific file to be modifying.z$Will be working with %s variant only)r1   r   r[   debugrD   r"   r   rR   Z$Configuration._ensure_have_load_only   s+    >>!$%NOO;T^^Lr   c                6   < V ^8  d   QhRS[ S[S[3,          /# r'   )r   r   r    r2   r4   r   r   r5      s     	 	T#s(^ 	r   c                sh    / p\          F%  pVP                  V P                  V,          4       K'  	  V# )z3A dictionary representing the loaded configuration.)r8   updater:   )r<   Zretvalr=   s   &  r   rH   ZConfiguration._dictionary   s/    
 %GMM$,,w/0 & r   c                r?   r@   rA   r2   r4   r   r   r5      s     ? ?D ?r   c                s   \        V P                  4       4      pV\        P                  ,          R,          \        P
                  .8X  d   \        P                  R4       R# VP                  4        Fx  w  r#V Fm  pV P                  e)   W P                  8w  d   \        P                  RWB4       K9  V P                  W$4      pV P                  V,          P                  WE34       Ko  	  Kz  	  R# )z,Loads configuration from configuration files:i    i   NzZSkipping loading configuration files due to environment's PIP_CONFIG_FILE being os.devnullNz Skipping file '%s' (variant: %s))Zdictiter_config_filesr-   r   r(   Zdevnullr[   r^   rI   r1   
_load_filer9   append)r<   config_filesr=   ZfilesrU   rV   s   &     r   rB   Z Configuration._load_config_files   s    D2245		"3'BJJ<7LLA *002NG >>-'^^2KLL!CUT8 g&--uo>  3r   c                s,   < V ^8  d   QhRS[ RS[RS[/# )r   r=   rU   r   )r   r   RawConfigParserr2   r4   r   r   r5     s"      $ s  r   c                s   \         P                  R W4       V P                  V4      pVP                  4        FE  pVP	                  V4      pV P
                  V,          P                  V P                  WE4      4       KG  	  V# )z'For variant '%s', will try loading '%s')r[   Zverbose_construct_parserZsectionsrI   r:   r`   _normalized_keys)r<   r=   rU   rV   rW   rI   s   &&&   r   rb   ZConfiguration._load_file  si    @'Q''.(GLL)ELL!(()>)>w)NO ) r   c                rJ   )r   rU   r   r   re   r2   r4   r   r   r5     s      s  r   c                sX   \         P                  ! 4       p\        P                  P	                  V4      '       d,   \
        P                  ! R 4      p VP                  WR7       V# V#   \         d    \        RT R2TR7      h\         P                   d   p\        TR7      hRp?ii ; i)F)Zencodingzcontains invalid z characters)ZreasonrU   )r\   N)configparserre   r(   r)   existslocaleZgetpreferredencodingZreadZUnicodeDecodeErrorr   ZError)r<   rU   rV   Zlocale_encodingr\   s   &&   r   rf   ZConfiguration._construct_parser  s    --/
 77>>%  $99%@O
EE< v & 7..?{K   %% E7eDDEs   A( (.B)B)B$$B)c                r?   r@   rA   r2   r4   r   r   r5   *  s     
 
 
r   c                s    V P                   \        P                  ,          P                  V P	                  RV P                  4       4      4       R# )z.Loads configuration from environment variablesz:env:N)r:   r-   r   r`   rg   get_environ_varsrD   r"   r   rC   Z$Configuration._load_environment_vars*  s6    U]]#**!!'4+@+@+BC	
r   c                sh   < V ^8  d   QhRS[ RS[S[S[ S[3,          ,          RS[S[ S[3,          /# )r   rW   rI   r   )r   r   r   r    r   r2   r4   r   r   r5   0  s:      #+E#s(O#<	c3hr   c                sZ    / pV F"  w  rEVR,           \        V4      ,           pWSV&   K$  	  V# )zNormalizes items to construct a dictionary with normalized keys.

This routine is where the names become keys and are made the same
regardless of source - configuration files or environment.
r$   )r#   )r<   rW   rI   Z
normalizedr   valrK   rX   r   rg   ZConfiguration._normalized_keys0  s7     
IDC-/$"77C!sO  r   c                sF   < V ^8  d   QhRS[ S[S[S[3,          ,          /# r'   )r   r   r   r2   r4   r   r   r5   >  s!     $ $(5c?"; $r   c              #  s   "   \         P                  P                  4        FG  w  rVP                  R4      '       g   K  VR,          P	                  4       pV\
        9  g   KB  W23x  KI  	  R# 5i)z@Returns a generator with all environmental vars with prefix PIP_ZPIP_:i   NNN)r(   environrI   r!   r    ENV_NAMES_IGNORED)r<   rK   rm   r      &   r   rl   ZConfiguration.get_environ_vars>  sL     

((*HC~~f%%2w}}00)O	 +s   8A.A.#A.c                sV   < V ^8  d   QhRS[ S[S[S[S[,          3,          ,          /# r'   )r   r   r   r   r   r2   r4   r   r   r5   G  s&        8E$S	/,B#C  r   c              #  sT  "   \         P                  P                  RR4      p\        4       p\        P
                  V\        P
                  ,          3x  V P                  '       * ;'       d/    T;'       d     \         P                  P                  V4      '       * pV'       d*   \        P                  V\        P                  ,          3x  \        P                  V\        P                  ,          3x  Ve   \        P                  V.3x  R# \        P                  . 3x  R# 5i)a`  Yields variant and configuration files associated with it.

This should be treated like items of a dictionary. The order
here doesn't affect what gets overridden. That is controlled
by OVERRIDE_ORDER. However this does control the order they are
displayed to the user. It's probably most ergonomic to display
things in the same order as OVERRIDE_ORDER
ZPIP_CONFIG_FILEN)r(   rn   Zgetr.   r-   r   r0   r)   rj   r   r   r   )r<   Zenv_config_filerd   Zshould_load_user_configrp   r   ra   ZConfiguration.iter_config_filesG  s      **..):DA.0llL666 '+mm"3 #
 #
?? ?9
 #**l5::666 jj,uzz222&))o...))R-s   A5D(8,D(%BD(c                s<   < V ^8  d   QhRS[ RS[S[S[3,          /# )r   r=   r   )r   r   r   r    r2   r4   r   r   r5   g  s#     % %D %T#s(^ %r   c                s(    V P                   V,          # )z#Get values present in a config file)r:   )r<   r=   s   &&r   get_values_in_configZ"Configuration.get_values_in_configg  s    ||G$$r   c                r_   r'   )r   r   re   r2   r4   r   r   r5   k  s      uS/-A'B r   c                s    V P                   '       g   Q hV P                  V P                   ,          pV'       g   \        R 4      hVR,          # )z4Fatal Internal error [id=2]. Please report as a bug.i)r1   r9   r   )r<   Zparsersr%   r   rF   Z#Configuration._get_parser_to_modifyk  sA    ~~~~--/$F 
 r{r   c                rP   )r   rU   rV   r   Nrh   r2   r4   r   r   r5   y  s"     = =s =O = =r   c                sf    W3pW0P                   9  d   V P                   P                  V4       R # R # N)r;   rc   )r<   rU   rV   Zfile_parser_tuples   &&& r   rT   ZConfiguration._mark_as_modifiedy  s0    "O$:$::""))*;< ;r   c                s    < V ^8  d   QhRS[ /# r'   r   r2   r4   r   r   r5   ~  s     B B# Br   c                sP    V P                   P                   R V P                  : R2# )Z(Z))r>   __name__rH   rD   r"   r   __repr__ZConfiguration.__repr__~  s'    ..))*!D,<,<+?qAAr   )r:   r;   r9   r0   r1   rr   )rs   Z
__module__Z__qualname__Z__firstlineno____doc__r6   rE   rG   rI   rO   rY   rZ   r]   rR   ZpropertyrH   rB   rb   rf   rC   rg   rl   ra   rq   rF   rT   rt   Z__static_attributes__Z__classdictcell__Z__classcell__)r>   r3   s   @@r   r/   r/   W   s     G G** * ( (
B 
B. .&. .: 0M M
 	 	? ?.  *
 
 $ $   @% % = =
B B Br   r/   )ZversionZhelp),ru   ri   rk   r(   r,   Ztypingr    r   r   r   r   r   r   Zpip._internal.exceptionsr   r   Zpip._internal.utilsr	   Zpip._internal.utils.compatr
   Zpip._internal.utils.loggingr   Zpip._internal.utils.miscr   r   re   r   r   r+   ro   r-   r   r   r   r   r   r8   r7   rs   r[   r#   r&   r.   r/   rA   r   r   <module>rv      s      	 
 F F F ( . 1 5..vs&)J%  				 uzz5::uyy%--O**ellEJJ6	8	&hB hBr   