+
    i8                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	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 ]P0                  t]! R
]4      t]'       d   RMRtRt]! RRRRRR7      t]P<                  ]P>                  ]P@                  ]PB                  ]PD                  3t#]P>                  ]P<                  ]P@                  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
)annotationsN)Iterable)AnyNewType)ConfigurationError!ConfigurationFileCouldNotBeLoaded)appdirs)WINDOWS)	getLogger)
ensure_direnumKindzpip.inizpip.confuserglobalsiteenvzenv-var)USERGLOBALSITEENVENV_VARc                    V ^8  d   QhRRRR/# )   namestrreturn )formats   "a/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_internal/configuration.py__annotate__r   5   s      # #     c                h    V P                  4       P                  RR4      p V P                  R4      p V # )zAMake a name consistent regardless of source (environment or file)_-z--)lowerreplaceremoveprefix)r   s   &r   _normalize_namer'   5   s/    ::<S)DT"DKr    c                    V ^8  d   QhRRRR/# )r   r   r   r   z	list[str]r   )r   s   "r   r   r   <   s      3 9 r    c                V    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   split)r   error_messages   & r   _disassemble_keyr-   <   s>    
$115jB 	 !//::c1r    c                   V ^8  d   QhRR/# )r   r   zdict[Kind, list[str]]r   )r   s   "r   r   r   F   s      !6 r    c                 v   \         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 )pip~z.pip)r   site_config_dirsospathjoinCONFIG_BASENAMEsysprefix
expanduserr	   user_config_dirkindsr   r   r   )r4   global_config_filessite_config_filelegacy_config_filenew_config_files        r   get_configuration_filesr@   F   s    8?8P8PQV8W8WT?+8W   ww||CJJ@
3f
 ggll7#:#:5#A?SO)

%&

'9 s   -D6c                  0  a  ] tR t^YtRtR-R V 3R llltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltR R ltR R lt]R R l4       tR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR,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               $    V ^8  d   QhRRRRRR/# )r   isolatedbool	load_onlyzKind | Noner   Noner   )r   s   "r   r   Configuration.__annotate__g   s&     G G G+ G Gr    c           
     	^  < \         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, )super__init__VALID_LOAD_ONLYr   r   r5   mapreprrD   rF   OVERRIDE_ORDER_parsers_config_modified_parsers)selfrD   rF   variant	__class__s   &&& r   rK   Configuration.__init__g   s     Yo%E$GNNIIc$89 
 !" (6H
'5GRK~H
 (6?
'5GRK~?
 EGH
?
s   .B%	B*c                   V ^8  d   QhRR/# r   r   rG   r   )r   s   "r   r   rH   |   s     * *d *r    c                n    V P                  4        V P                  '       g   V P                  4        R# R# )z<Loads configuration from configuration files and environmentN)_load_config_filesrD   _load_environment_varsrS   s   &r   loadConfiguration.load|   s(    !}}}'') r    c                   V ^8  d   QhRR/# )r   r   z
str | Noner   )r   s   "r   r   rH      s      * r    c                    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)rF   _get_parser_to_modify
IndexErrorr\   s   &r   get_file_to_editConfiguration.get_file_to_edit   sC    ~~)V+VV)	--/22 		s   . ==c                   V ^8  d   QhRR/# )r   r   Iterable[tuple[str, Any]]r   )r   s   "r   r   rH      s     ( (0 (r    c                6    V P                   P                  4       # )zPReturns key-value pairs like dict.items() representing the loaded
configuration
)_dictionaryitemsr\   s   &r   ri   Configuration.items   s     %%''r    c                    V ^8  d   QhRRRR/# )r   keyr   r   r   r   )r   s   "r   r   rH      s     B BS BS Br    c                    Tp\        V4      p / pV P                  P                  4        F  pVP                  V4       K  	  W1,          #   \         d    \        T4       \        RT 24      hi ; i)z#Get a value from the configuration.No such key - )r'   rh   valuesupdateKeyErrorr-   r   )rS   rl   orig_keyclean_configfile_valuess   &&   r   	get_valueConfiguration.get_value   sy    c"		B+-L#//668##K0  9$$ 	B S!$~hZ%@AA		Bs   ;A %A0c               $    V ^8  d   QhRRRRRR/# )r   rl   r   valuer   r   rG   r   )r   s   "r   r   rH      s!     . .S . . .r    c                   \        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       V P                  V P                  ,          P                  V/ 4       W P                  V P                  ,          V,          V&   V P                  W44       R# )z$Modify a value in the configuration.N)r'   _ensure_have_load_onlyrF   ra   r-   has_sectionadd_sectionsetrQ   
setdefault_mark_as_modified)rS   rl   rx   fnameparsersectionr   s   &&&    r   	set_valueConfiguration.set_value   s    c"##%~~~~224,S1MG %%g..""7+JJwe,T^^$//r:38T^^$U+C0u-r    c                    V ^8  d   QhRRRR/# )r   rl   r   r   rG   r   )r   s   "r   r   rH      s      2  2s  2t  2r    c                   Tp\        V4      pV P                  4        V P                  '       g   Q hV P                  4       w  r4WP                  V P                  ,          V,          9  d0   WP                  V P                  ,          9  d   \        RV 24      hV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,          V R#   \         d#    T P                  T P                  ,          T  R# i ; i)z#Unset a value in the configuration.rn   Nz4Fatal Internal error [id=1]. Please report as a bug.)r'   rz   rF   ra   rQ   r   r-   r{   remove_optionri   remove_sectionr   rq   )rS   rl   rr   r   r   r   r   s   &&     r   unset_valueConfiguration.unset_value   s/   c"##%~~~~224 ||DNN3E::<<77$~hZ%@AA,S1MG""7++0D0DW0S0S )J 
 <<((%%g.""51	2T^^,U3C8 	2T^^,S1	2s   %E )E32E3c                   V ^8  d   QhRR/# rX   r   )r   s   "r   r   rH      s      d r    c                   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 %swNz:An error occurred while writing to the configuration file z: )rz   rR   loggerinfor   r3   r4   dirnameopenwriteOSErrorr   )rS   r   r   ferrors   &    r   save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                   V ^8  d   QhRR/# rX   r   )r   s   "r   r   rH      s     M M Mr    c                	x    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)rF   r   r   debugr\   s   &r   rz   $Configuration._ensure_have_load_only   s+    >>!$%NOO;T^^Lr    c                   V ^8  d   QhRR/# )r   r   zdict[str, dict[str, Any]]r   )r   s   "r   r   rH      s     	 	6 	r    c                h    / p\          F%  pVP                  V P                  V,          4       K'  	  V# )z3A dictionary representing the loaded configuration.)rO   rp   rQ   )rS   retvalrT   s   &  r   rh   Configuration._dictionary   s/    
 %GMM$,,w/0 & r    c                   V ^8  d   QhRR/# rX   r   )r   s   "r   r   rH      s     ? ?D ?r    c                   \        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:       NzZSkipping loading configuration files due to environment's PIP_CONFIG_FILE being os.devnullNz Skipping file '%s' (variant: %s))dictiter_config_filesr;   r   r3   devnullr   r   ri   rF   
_load_filerP   append)rS   config_filesrT   filesr   r   s   &     r   rZ    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               $    V ^8  d   QhRRRRRR/# )r   rT   r   r   r   r   RawConfigParserr   )r   s   "r   r   rH     s!     	 	$ 	s 	 	r    c                	Z   \         P                  R W4       V P                  V4      pVP                  4        Fo  pVP	                  V4      pV P
                  V,          P                  V/ 4       V P
                  V,          V,          P                  V P                  WE4      4       Kq  	  V# )z'For variant '%s', will try loading '%s')	r   verbose_construct_parsersectionsri   rQ   r~   rp   _normalized_keys)rS   rT   r   r   r   ri   s   &&&   r   r   Configuration._load_file  s    @'Q''.(GLL)ELL!,,UB7LL!%(//0E0Eg0UV )
 r    c                    V ^8  d   QhRRRR/# )r   r   r   r   r   r   )r   s   "r   r   rH   !  s      s  r    c                	X   \         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)encodingzcontains invalid z characters)reasonr   )r   N)configparserr   r3   r4   existslocalegetpreferredencodingreadUnicodeDecodeErrorr   Error)rS   r   r   locale_encodingr   s   &&   r   r   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                   V ^8  d   QhRR/# rX   r   )r   s   "r   r   rH   6  s     
 
 
r    c                   V P                   \        P                  ,          P                  R/ 4       V P                   \        P                  ,          R,          P	                  V P                  RV P                  4       4      4       R# )z.Loads configuration from environment variablesz:env:N)rQ   r;   r   r~   rp   r   get_environ_varsr\   s   &r   r[   $Configuration._load_environment_vars6  sX    U]]#..w;U]]#G,33!!'4+@+@+BC	
r    c               $    V ^8  d   QhRRRRRR/# )r   r   r   ri   rf   r   dict[str, Any]r   )r   s   "r   r   rH   =  s$      #<	r    c                Z    / 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'   )rS   r   ri   
normalizedr   valrl   s   &&&    r   r   Configuration._normalized_keys=  s7     
IDC-/$"77C!sO  r    c                   V ^8  d   QhRR/# )r   r   zIterable[tuple[str, str]]r   )r   s   "r   r   rH   K  s     $ $"; $r    c              #     "   \         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_PIP_:   NNN)r3   environri   
startswithr$   ENV_NAMES_IGNORED)rS   rl   r   r   s   &   r   r   Configuration.get_environ_varsK  sL     

((*HC~~f%%2w}}00)O	 +s   8A.A.#A.c                   V ^8  d   QhRR/# )r   r   z Iterable[tuple[Kind, list[str]]]r   )r   s   "r   r   rH   T  s        #C  r    c              #  T  "   \         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
PIP_CONFIG_FILEN)r3   r   getr@   r;   r   rD   r4   r   r   r   r   )rS   env_config_filer   should_load_user_configs   &   r   r   Configuration.iter_config_filesT  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                    V ^8  d   QhRRRR/# )r   rT   r   r   r   r   )r   s   "r   r   rH   t  s     % %D %^ %r    c                (    V P                   V,          # )z#Get values present in a config file)rQ   )rS   rT   s   &&r   get_values_in_config"Configuration.get_values_in_configt  s    ||G$$r    c                   V ^8  d   QhRR/# )r   r   ztuple[str, RawConfigParser]r   )r   s   "r   r   rH   x  s      'B r    c                	    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.)rF   rP   r   )rS   parserss   & r   ra   #Configuration._get_parser_to_modifyx  sA    ~~~~--/$F 
 r{r    c               $    V ^8  d   QhRRRRRR/# )r   r   r   r   r   r   rG   r   )r   s   "r   r   rH     s!     = =s =O = =r    c                	f    W3pW0P                   9  d   V P                   P                  V4       R # R # N)rR   r   )rS   r   r   file_parser_tuples   &&& r   r   Configuration._mark_as_modified  s0    "O$:$::""))*;< ;r    c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   rH     s     B B# Br    c                	P    V P                   P                   R V P                  : R2# )())rU   __name__rh   r\   s   &r   __repr__Configuration.__repr__  s'    ..))*!D,<,<+?qAAr    )rQ   rR   rP   rD   rF   r   )r   
__module____qualname____firstlineno____doc__rK   r]   rc   ri   ru   r   r   r   rz   propertyrh   rZ   r   r   r[   r   r   r   r   ra   r   r   __static_attributes____classcell__)rU   s   @r   rB   rB   Y   s    G G**(B.( 2D0M
 	 	?.	*
$ @%=
B Br    rB   )versionhelp)+r   
__future__r   r   r   r3   r7   collections.abcr   typingr   r   pip._internal.exceptionsr   r   pip._internal.utilsr   pip._internal.utils.compatr	   pip._internal.utils.loggingr
   pip._internal.utils.miscr   r   r   r   r   r6   r   r;   r   r   r   r   r   rO   rL   r   r   r'   r-   r@   rB   r   r    r   <module>r      s    #   	 
 $  ( . 1 5..vs&)J%  				 uzz5::uyy%--O**ellEJJ6	8	&sB sBr    