
    j                    D   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  SSKJr  SS	KJr  SS
KJr  \(       a  SSKJr  SSKJr  SSKJr  SSKJr  \R8                  " \5      r\	SS j5       r " S S\5      r       SS jr!SS jr" " S S\\ 5      r#g)a&  
Contains command classes which may interact with an index / the network.

Unlike its sister module, req_command, this module still uses lazy imports
so commands which don't always hit the network (e.g. list w/o --outdated or
--uptodate) don't need waste time importing PipSession and friends.
    )annotationsN)Iterator)	lru_cache)Values)TYPE_CHECKING)certifi)Command)CommandContextMixIn)
SSLContext)NormalizedName
PipSession)UpgradePromptc                 0    SS K n  SSKJn  UR                  U R                  5      nUR                  [        R                  " 5       5        U$ ! [         a    [        R                  S5         g f = f! [         a    [        R                  S5         g f = f)Nr   z1Disabling truststore since ssl support is missing)
truststorez5Disabling truststore because platform isn't supported)sslImportErrorloggerwarningpip._vendorr   r   PROTOCOL_TLS_CLIENTload_verify_locationsr   where)r   r   ctxs      p/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/pip/_internal/cli/index_command.py_create_truststore_ssl_contextr   #   s    
*
 

 7 7
8Cgmmo.J  JK  NOs"   A A3 A0/A03BBc                  n   ^  \ rS rSrSrSU 4S jjr\S	S j5       rS
S jr  S       SS jjr	Sr
U =r$ )SessionCommandMixin6   z=
A class mixin for command classes needing _build_session().
c                0   > [         TU ]  5         S U l        g )N)super__init___session)self	__class__s    r   r"   SessionCommandMixin.__init__;   s    +/    c                    / n[        USS5      (       d%  [        USS5      nU(       a  UR                  U5        [        USS5      nU(       a  UR                  U5        U=(       d    S$ )z7Return a list of index urls from user-provided options.no_indexF	index_urlNextra_index_urls)getattrappendextend)clsoptions
index_urlsurlurlss        r   _get_index_urls#SessionCommandMixin._get_index_urls?   sb     
w
E22';5C!!#&w 2D9d#!T!r'   c                    U R                   c4  U R                  U R                  U5      5      U l         U R                   c   eU R                   $ )zGet a default-managed session.)r#   enter_context_build_session)r$   r0   s     r   get_default_session'SessionCommandMixin.get_default_sessionM   sE    ==  ..t/B/B7/KLDM ==,,,}}r'   c           	     n   SSK Jn  UR                  nU(       a&  [        R                  R                  U5      (       d   eSUR                  ;  a  [        5       nOS nU" U(       a   [        R                  R                  US5      OS Ub  UOUR                  UR                  UR                  U R                  U5      US9nUR                  (       a  UR                  Ul        UR                  (       a  UR                  Ul        UR                   (       d  U(       a  Ub  UOUR                   Ul        UR"                  (       a6  UR"                  UR"                  S.Ul        SUl        UR"                  Ul        UR*                  (       + UR,                  l        UR0                  UR,                  l        U$ )Nr   r   zlegacy-certszhttp-v2)cacheretriesresume_retriestrusted_hostsr1   ssl_context)httphttpsF)pip._internal.network.sessionr   	cache_dirospathisabsdeprecated_features_enabledr   joinr=   r>   r?   r4   certverifyclient_certtimeoutproxyproxies	trust_env	pip_proxyno_inputauth	promptingkeyring_provider)r$   r0   r=   rM   r   rD   r@   sessions           r   r8   "SessionCommandMixin._build_sessionW   sF    	=%%	i 8 888!D!DD8:KK8A"'',,y)4t&2G"11!//++G4#
 <<$\\GN "..GL ??g)0)<g'//GO == GO !&G 'G &-%5%5!5(/(@(@%r'   )r#   )returnNone)r0   r   rX   zlist[str] | None)r0   r   rX   r   )NN)r0   r   r=   
int | NonerM   rZ   rX   r   )__name__
__module____qualname____firstlineno____doc__r"   classmethodr4   r9   r8   __static_attributes____classcell__)r%   s   @r   r   r   6   s^    0 " " #"	22 2 	2
 
2 2r'   r   c                    SSK Jn  U" X5      $ )Nr   )pip_self_version_check_fetch)!pip._internal.self_outdated_checkrd   )rV   r0   rd   s      r   _pip_self_version_check_fetchrf      s     O'99r'   c                     SSK Jn  U" U 5        g )Nr   )pip_self_version_check_emit)re   rh   )upgrade_promptrh   s     r   _pip_self_version_check_emitrj      s    M/r'   c                  V    \ rS rSrSr      SS jr\R                  SS j5       rSr	g)	IndexGroupCommand   z
Abstract base class for commands with the index_group options.

This also corresponds to the commands that permit the pip version check.
c                t    UR                   (       a'  UR                   R                  U5      nUSL a  gUSL a  gg)z=
Determine if pre-releases should be excluded for a package.
TF)release_controlallows_prereleases)r$   r0   package_nameallow_prereleasess       r   should_exclude_prerelease+IndexGroupCommand.should_exclude_prerelease   s?     "" ' 7 7 J J< X D("e+ r'   c              #    #    [        US5      (       d   eUR                  (       d  UR                  (       a  Sv   gSn U R                  US[	        SUR
                  5      S9nU   [        XA5      nSSS5         Sv    [        U5        g! , (       d  f       N = f! [         a,    [        R                  S5        [        R                  SSS	9   NXf = f! [         a,    [        R                  S5        [        R                  SSS	9   gf = f!  [        U5        f ! [         a,    [        R                  S5        [        R                  SSS	9   f f = f= f7f)
zh
Do the pip version check if not disabled.

This overrides the default behavior of not doing the check.
r)   Nr      )r=   rM   z6There was an error checking the latest version of pip.zSee below for errorT)exc_info)hasattrdisable_pip_version_checkr)   r8   minrM   rf   	Exceptionr   r   debugrj   )r$   r0   argsri   rV   s        r   pip_version_check#IndexGroupCommand.pip_version_check   s/     w
++++,,0@0@/3
	?))Aw/ * G
 !>w!P 	CC,^<  	?NNSTLL.L>	?  CWX2TBCC,^< CWX2TBCs   =E 'B 'B3B <D C E
BB EB 3CECE3D
EDEEDE3EEEEE N)r0   r   rq   r   rX   bool)r0   r   r}   z	list[str]rX   zIterator[None])
r[   r\   r]   r^   r_   rs   
contextlibcontextmanagerr~   ra   r   r'   r   rl   rl      s@    -;	" !C !Cr'   rl   )rX   zSSLContext | None)rV   r   r0   r   rX   UpgradePrompt | None)ri   r   rX   rY   )$r_   
__future__r   r   loggingrE   collections.abcr   	functoolsr   optparser   typingr   r   r   pip._internal.cli.base_commandr	   !pip._internal.cli.command_contextr
   r   r   pip._vendor.packaging.utilsr   rC   r   re   r   	getLoggerr[   r   r   r   rf   rj   rl   r   r'   r   <module>r      s    #   	 $      2 A:8?			8	$  $S- Sl::"(::0:C!4 :Cr'   