ó
    T=Œjâ8  ã                  óâ  • 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	J
r
  SSKJrJr  SSKJr  SSKJrJr  SS	KJr  SS
KJrJr  \R0                  r\
" S\5      r\(       a  SOSrSr\" SSSSSS9r\R<                  \R>                  \R@                  \RB                  \RD                  4r#\R>                  \R<                  \R@                  4r$\" \%5      r&SS jr'SS jr(SS jr) " S S5      r*g)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Úget_locale_encoding)Ú	getLogger)Ú
ensure_dirÚenumÚKindzpip.inizpip.conf)ÚversionÚhelpÚuserÚglobalÚsiteÚenvzenv-var)ÚUSERÚGLOBALÚSITEÚENVÚENV_VARc                óh   • U R                  5       R                  SS5      n U R                  S5      n U $ )zAMake a name consistent regardless of source (environment or file)Ú_Ú-z--)ÚlowerÚreplaceÚremoveprefix)Únames    Ú_/Users/stevendouglas/BidBrain/.venv/lib/python3.13/site-packages/pip/_internal/configuration.pyÚ_normalize_namer#   4   s/   € à�:‰:‹<×Ñ  SÓ)€DØ×Ñ˜TÓ"€DØ€Kó    c                óT   • SU ;  a  SU  S3n[        U5      eU R                  SS5      $ )NÚ.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>   € Ø
�$ƒð1Ø15°°jðBð 	ô ! Ó/Ð/Ø�:‰:�c˜1ÓÐr$   c                 óv  • [         R                  " S5       V s/ s H'  n [        R                  R	                  U [
        5      PM)     nn [        R                  R	                  [        R                  [
        5      n[        R                  R	                  [        R                  R                  S5      [        (       a  SOS[
        5      n[        R                  R	                  [         R                  " S5      [
        5      n[        R                  U[        R                  U/[        R                  X4/0$ s  sn f )NÚpipÚ~z.pip)r	   Úsite_config_dirsÚosÚpathÚjoinÚCONFIG_BASENAMEÚsysÚprefixÚ
expanduserr
   Úuser_config_dirÚkindsr   r   r   )r0   Úglobal_config_filesÚsite_config_fileÚlegacy_config_fileÚnew_config_files        r"   Úget_configuration_filesr<   E   sÚ   € ä8?×8PÒ8PÐQVÔ8WóÚ8W°Œ�‰�‰�Tœ?Ö+Ñ8Wð ð ô —w‘w—|‘|¤C§J¡J´Ó@ÐÜŸ™Ÿ™Ü
�‰×Ñ˜3Óß’‰˜fÜóÐô
 —g‘g—l‘l¤7×#:Ò#:¸5Ó#AÄ?ÓS€Oä�‰Ð)Ü�
‰
Ð%Ð&Ü�
‰
Ð'Ð9ðð ùòs   ™.D6c                  ó  ^ • \ rS rSrSrSSU 4S jjjrSS jrSS jrSS jrSS jr	SS jr
S S	 jrSS
 jrSS jr\S!S j5       rSS jrS"S jrS#S jrSS jr      S$S jrS%S jrS&S jrS'S jrS(S jrS)S jrS*S jrSrU =r$ )+ÚConfigurationéX   aÂ  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           
     ó\  >• [         TU ]  5         UbE  U[        ;  a;  [        SR	                  SR                  [        [        [        5      5      5      5      eXl        X l	        [         Vs0 s H  o3/ _M     snU l        [         Vs0 s H  o30 _M     snU l        / U l        g s  snf s  snf )Nz5Got invalid value for load_only - should be one of {}z, )ÚsuperÚ__init__ÚVALID_LOAD_ONLYr   Úformatr1   ÚmapÚreprÚisolatedÚ	load_onlyÚOVERRIDE_ORDERÚ_parsersÚ_configÚ_modified_parsers)ÚselfrG   rH   ÚvariantÚ	__class__s       €r"   rB   ÚConfiguration.__init__f   s¬   ø€ Ü‰ÑÔàÑ  Y´oÓ%EÜ$ØG×NÑNØ—I‘Iœc¤$¬Ó8Ó9óóð ð
 !ŒØ"Œõ (6óH
Ú'5˜G�RŠK¡~ñH
ˆŒõ (6ó?
Ú'5˜G�RŠK¡~ñ?
ˆŒð EGˆÕùòH
ùò?
s   Á,B$ÂB)c                óh   • U R                  5         U R                  (       d  U R                  5         gg)z<Loads configuration from configuration files and environmentN)Ú_load_config_filesrG   Ú_load_environment_vars©rM   s    r"   ÚloadÚConfiguration.load{   s&   € à×ÑÔ!Ø�}�}Ø×'Ñ'Õ)ð r$   c                ór   • U R                   c   S5       e U R                  5       S   $ ! [         a     gf = f)z7Returns the file with highest priority in configurationNz)Need to be specified a file to be editingr   )rH   Ú_get_parser_to_modifyÚ
IndexErrorrT   s    r"   Úget_file_to_editÚConfiguration.get_file_to_edit�   sC   € à�~‰~Ñ)ÐVÐ+VÓVÐ)ð	Ø×-Ñ-Ó/°Ñ2Ð2øÜó 	Ùð	ús   –) ©
6µ6c                ó6   • U R                   R                  5       $ )zPReturns key-value pairs like dict.items() representing the loaded
configuration
)Ú_dictionaryÚitemsrT   s    r"   r^   ÚConfiguration.itemsŠ   s   € ð ×Ñ×%Ñ%Ó'Ð'r$   c                óÜ   • Un[        U5      n 0 nU R                  R                  5        H  nUR                  U5        M     X1   $ ! [         a    [        U5        [        SU 35      ef = f)z#Get a value from the configuration.úNo such key - )r#   r]   ÚvaluesÚupdateÚKeyErrorr*   r   )rM   ÚkeyÚorig_keyÚclean_configÚfile_valuess        r"   Ú	get_valueÚConfiguration.get_value�   sy   € àˆÜ˜cÓ"ˆð		BØ+-ˆLØ#×/Ñ/×6Ñ6Ö8�Ø×#Ñ# KÖ0ñ  9àÑ$Ð$øÜó 	Bô ˜SÔ!Ü$ ~°h°ZÐ%@ÓAÐAð		Bús   �7A Á$A+c                óÆ  • [        U5      nU R                  5         U R                  (       d   eU R                  5       u  p4UbF  [	        U5      u  pVUR                  U5      (       d  UR                  U5        UR                  XVU5        U R                  U R                     R                  U0 5        X R                  U R                     U   U'   U R                  X45        g)z$Modify a value in the configuration.N)r#   Ú_ensure_have_load_onlyrH   rX   r*   Úhas_sectionÚadd_sectionÚsetrK   Ú
setdefaultÚ_mark_as_modified)rM   re   ÚvalueÚfnameÚparserÚsectionr!   s          r"   Ú	set_valueÚConfiguration.set_valueŸ   sº   € ä˜cÓ"ˆØ×#Ñ#Ô%à�~�~Ðˆ~Ø×2Ñ2Ó4‰ˆàÑÜ,¨SÓ1‰MˆGð ×%Ñ% g×.Ñ.Ø×"Ñ" 7Ô+Ø�J‰J�w eÔ,à�‰�T—^‘^Ñ$×/Ñ/°°rÔ:Ø38�‰�T—^‘^Ñ$ UÑ+¨CÑ0Ø×Ñ˜uÕ-r$   c                ó¨  • Un[        U5      nU R                  5         U R                  (       d   eU R                  5       u  p4XR                  U R                     U   ;  a*  XR                  U R                     ;  a  [        SU 35      eUb|  [        U5      u  pVUR                  U5      (       a  UR                  XV5      (       d  [        S5      eUR                  U5      (       d  UR                  U5        U R                  X45         U R                  U R                     U   U	 g! [         a    U R                  U R                     U	  gf = f)z#Unset a value in the configuration.ra   Nz4Fatal Internal error [id=1]. Please report as a bug.)r#   rl   rH   rX   rK   r   r*   rm   Úremove_optionr^   Úremove_sectionrq   rd   )rM   re   rf   rs   rt   ru   r!   s          r"   Úunset_valueÚConfiguration.unset_value³   s-  € àˆÜ˜cÓ"ˆØ×#Ñ#Ô%à�~�~Ðˆ~Ø×2Ñ2Ó4‰ˆð —|‘| D§N¡NÑ3°EÑ:Ó:ØŸ<™<¨¯©Ñ7Ó7ä$ ~°h°ZÐ%@ÓAÐAàÑÜ,¨SÓ1‰MˆGà×"Ñ" 7×+Ñ+°×0DÑ0DÀW×0SÑ0Sô )ØJóð ð
 —<‘< ×(Ñ(Ø×%Ñ% gÔ.Ø×"Ñ" 5Ô1ð	2Ø—‘˜TŸ^™^Ñ,¨UÑ3°CÑ8øÜó 	2Ø—‘˜TŸ^™^Ñ,¨SÒ1ð	2ús   ÄD* Ä*$EÅEc                ó‚  • U R                  5         U R                   Hj  u  p[        R                  SU5        [	        [
        R                  R                  U5      5         [        US5       nUR                  U5        SSS5        Ml     g! , (       d  f       M~  = f! [         a  n[        SU SU 35      eSnAff = f)z!Save the current in-memory state.zWriting to %sÚwNz:An error occurred while writing to the configuration file z: )rl   rL   ÚloggerÚinfor   r/   r0   ÚdirnameÚopenÚwriteÚOSErrorr   )rM   rs   rt   ÚfÚerrors        r"   ÚsaveÚConfiguration.saveÕ   s¡   € à×#Ñ#Ô%à!×3Ô3‰MˆEÜ�K‰K˜¨Ô/ô ”r—w‘w—‘ uÓ-Ô.ðÜ˜% Ô%¨Ø—L‘L ”O÷ &Ñ%ò 4÷ &Ö%ûäó Ü(ØPØ�g˜R ˜wð(óð ûðús6   Á!BÁ-BÁ?BÂ
B	ÂBÂBÂ
B>Â(B9Â9B>c                ót   • U R                   c  [        S5      e[        R                  SU R                   5        g )Nz'Needed a specific file to be modifying.z$Will be working with %s variant only)rH   r   r   ÚdebugrT   s    r"   rl   Ú$Configuration._ensure_have_load_onlyí   s+   € Ø�>‰>Ñ!Ü$Ð%NÓOÐOÜ�‰Ð;¸T¿^¹^ÕLr$   c                ó`   • 0 n[          H!  nUR                  U R                  U   5        M#     U$ )z3A dictionary representing the loaded configuration.)rI   rc   rK   )rM   ÚretvalrN   s      r"   r]   ÚConfiguration._dictionaryò   s/   € ð
 ˆç%ˆGØ�M‰M˜$Ÿ,™, wÑ/Ö0ñ &ð ˆr$   c                óÀ  • [        U R                  5       5      nU[        R                     SS [        R
                  /:X  a  [        R                  S5        gUR                  5        Hr  u  p#U Hg  nU R                  b'  X R                  :w  a  [        R                  SXB5        M7  U R                  X$5      nU R                  U   R                  XE45        Mi     Mt     g)z,Loads configuration from configuration filesr   r'   zZSkipping loading configuration files due to environment's PIP_CONFIG_FILE being os.devnullNz Skipping file '%s' (variant: %s))ÚdictÚiter_config_filesr7   r   r/   Údevnullr   rŠ   r^   rH   Ú
_load_filerJ   Úappend)rM   Úconfig_filesrN   Úfilesrs   rt   s         r"   rR   Ú Configuration._load_config_filesþ   s¹   € ä˜D×2Ñ2Ó4Ó5ˆØœŸ	™	Ñ" 1 QÐ'¬B¯J©J¨<Ó7Ü�L‰LðAôð à*×0Ñ0Ö2‰NˆGÛ�ð —>‘>Ñ-°'¿^¹^Ó2KÜ—L‘LÐ!CÀUÔTÙàŸ™¨Ó8�ð —‘˜gÑ&×-Ñ-¨u¨oÖ>ó ò 3r$   c                óB  • [         R                  SX5        U R                  U5      nUR                  5        Hc  nUR	                  U5      nU R
                  U   R                  U0 5        U R
                  U   U   R                  U R                  XE5      5        Me     U$ )Nz'For variant '%s', will try loading '%s')	r   ÚverboseÚ_construct_parserÚsectionsr^   rK   rp   rc   Ú_normalized_keys)rM   rN   rs   rt   ru   r^   s         r"   r“   ÚConfiguration._load_file  s‡   € Ü�‰Ð@À'ÔQØ×'Ñ'¨Ó.ˆà—‘Ö(ˆGØ—L‘L Ó)ˆEØ�L‰L˜Ñ!×,Ñ,¨U°BÔ7Ø�L‰L˜Ñ! %Ñ(×/Ñ/°×0EÑ0EÀgÓ0UÖVñ )ð
 ˆr$   c                ó(  • [         R                  " 5       n[        R                  R	                  U5      (       a  [        5       n UR                  XS9  U$ U$ ! [         a    [        SU S3US9e[         R                   a  n[        US9eS nAff = f)N)Úencodingzcontains invalid z characters)Úreasonrs   )r†   )
ÚconfigparserÚRawConfigParserr/   r0   Úexistsr   ÚreadÚUnicodeDecodeErrorr   ÚError)rM   rs   rt   Úlocale_encodingr†   s        r"   rš   ÚConfiguration._construct_parser   s˜   € Ü×-Ò-Ó/ˆô
 �7‰7�>‰>˜%× Ñ Ü1Ó3ˆOð
EØ—‘˜E�Ñ<ð ˆˆvˆøô &ó ä7Ø.¨Ð.?¸{ÐKØñð ô  ×%Ñ%ó Eä7¸eÑDÐDûðEús   ÁA Á+BÂ	BÂBc                óø   • U R                   [        R                     R                  S0 5        U R                   [        R                     S   R	                  U R                  SU R                  5       5      5        g)z.Loads configuration from environment variablesz:env:N)rK   r7   r   rp   rc   rœ   Úget_environ_varsrT   s    r"   rS   Ú$Configuration._load_environment_vars5  sX   € à�‰”U—]‘]Ñ#×.Ñ.¨w¸Ô;Ø�‰”U—]‘]Ñ# GÑ,×3Ñ3Ø×!Ñ! '¨4×+@Ñ+@Ó+BÓCõ	
r$   c                óJ   • 0 nU H  u  pEUS-   [        U5      -   nXSU'   M     U$ )z¿Normalizes 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#   )rM   ru   r^   Ú
normalizedr!   Úvalre   s          r"   rœ   ÚConfiguration._normalized_keys<  s7   € ð ˆ
Û‰IˆDØ˜C‘-¤/°$Ó"7Ñ7ˆCØ!�s‹Oñ ð Ðr$   c              #  óÒ   #   • [         R                  R                  5        HA  u  pUR                  S5      (       d  M  USS R	                  5       nU[
        ;  d  M<  X24v •  MC     g7f)z@Returns a generator with all environmental vars with prefix PIP_ÚPIP_é   N)r/   Úenvironr^   Ú
startswithr   ÚENV_NAMES_IGNORED)rM   re   r®   r!   s       r"   rª   ÚConfiguration.get_environ_varsJ  sN   é € äŸ
™
×(Ñ(Ö*‰HˆCØ�~‰~˜f×%Ó%Ø˜1˜2�w—}‘}“�ØÔ0Õ0Ø˜)”Oò	 +ùs   ‚8A'¾A'Á
A'c              #  ó0  #   • [         R                  R                  SS5      n[        5       n[        R
                  U[        R
                     4v •  U R                  (       + =(       a-    U=(       a    [         R                  R                  U5      (       + nU(       a%  [        R                  U[        R                     4v •  [        R                  U[        R                     4v •  Ub  [        R                  U/4v •  g[        R                  / 4v •  g7f)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)r/   r³   Úgetr<   r7   r   rG   r0   r£   r   r   r   )rM   Úenv_config_filer•   Úshould_load_user_configs       r"   r‘   ÚConfiguration.iter_config_filesS  sÇ   é € ô Ÿ*™*Ÿ.™.Ð):¸DÓAˆÜ.Ó0ˆä�l‰l˜L¬¯©Ñ6Ð6Ò6ð '+§m¡mÔ"3÷ #
Ø×?¤§¡§¡¨Ó ?ô9
Ðö #ä—*‘*˜l¬5¯:©:Ñ6Ð6Ò6ô �j‰j˜,¤u§z¡zÑ2Ð2Ò2àÑ&Ü—)‘)˜oÐ.Ð.Ó.ä—)‘)˜R�-Óùs   ‚DDc                ó    • U R                   U   $ )z#Get values present in a config file)rK   )rM   rN   s     r"   Úget_values_in_configÚ"Configuration.get_values_in_configs  s   € à�|‰|˜GÑ$Ð$r$   c                óˆ   • U R                   (       d   eU R                  U R                      nU(       d  [        S5      eUS   $ )Nz4Fatal Internal error [id=2]. Please report as a bug.éÿÿÿÿ)rH   rJ   r   )rM   Úparserss     r"   rX   Ú#Configuration._get_parser_to_modifyw  s?   € à�~�~Ðˆ~Ø—-‘- §¡Ñ/ˆÞä$ØFóð ð
 �r‰{Ðr$   c                ó`   • X4nX0R                   ;  a  U R                   R                  U5        g g ©N)rL   r”   )rM   rs   rt   Úfile_parser_tuples       r"   rq   ÚConfiguration._mark_as_modified…  s0   € Ø"˜OÐØ×$:Ñ$:Ó:Ø×"Ñ"×)Ñ)Ð*;Õ<ð ;r$   c                óP   • U R                   R                   SU R                  < S3$ )NÚ(Ú))rO   Ú__name__r]   rT   s    r"   Ú__repr__ÚConfiguration.__repr__Š  s'   € Ø—.‘.×)Ñ)Ð*¨!¨D×,<Ñ,<Ñ+?¸qÐAÐAr$   )rK   rL   rJ   rG   rH   rÅ   )rG   ÚboolrH   zKind | NoneÚreturnÚNone)rÏ   rÐ   )rÏ   z
str | None)rÏ   úIterable[tuple[str, Any]])re   ÚstrrÏ   r   )re   rÒ   rr   r   rÏ   rÐ   )re   rÒ   rÏ   rÐ   )rÏ   zdict[str, dict[str, Any]])rN   r   rs   rÒ   rÏ   r¢   )rs   rÒ   rÏ   r¢   )ru   rÒ   r^   rÑ   rÏ   údict[str, Any])rÏ   zIterable[tuple[str, str]])rÏ   z Iterable[tuple[Kind, list[str]]])rN   r   rÏ   rÓ   )rÏ   ztuple[str, RawConfigParser])rs   rÒ   rt   r¢   rÏ   rÐ   )rÏ   rÒ   )rË   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rB   rU   rZ   r^   ri   rv   r{   r‡   rl   Úpropertyr]   rR   r“   rš   rS   rœ   rª   r‘   r¾   rX   rq   rÌ   Ú__static_attributes__Ú__classcell__)rO   s   @r"   r>   r>   X   sª   ø† ñ÷Gñ Gô**ôô(ôBô.ô( 2ôDô0Mð
 ó	ó ð	ô?ô.	ôô*
ðØðØ#<ðà	ôô$ô ô@%ôô=÷
Bò Br$   r>   )r!   rÒ   rÏ   rÒ   )r!   rÒ   rÏ   z	list[str])rÏ   zdict[Kind, list[str]])+r×   Ú
__future__r   r¡   r/   r3   Úcollections.abcr   Útypingr   r   Úpip._internal.exceptionsr   r   Úpip._internal.utilsr	   Úpip._internal.utils.compatr
   r   Úpip._internal.utils.loggingr   Úpip._internal.utils.miscr   r   r¢   rÒ   r   r2   rµ   r7   r   r   r   r   r   rI   rC   rË   r   r#   r*   r<   r>   © r$   r"   Ú<module>rä      s×   ðñõ #ã Û 	Û 
Ý $ß ÷õ (ß CÝ 1ß 5à×.Ñ.€Ùˆv�sÓ€æ&‘)¨J€Ø%Ð ñ 	Ø	ØØ	ØØñ	€ð —‘˜uŸz™z¨5¯:©:°u·y±yÀ%Ç-Á-ÐO€Ø—*‘*˜eŸl™l¨E¯J©JÐ6€á	�8Ó	€ôôô÷&sBò sBr$   