
    NviT                       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  \(       a  SS
KJr  SSKJr  SSKJr  \R0                  " \5      r\SS j5       r " S S\5      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)	lru_cache)Values)TYPE_CHECKING)certifi)Command)CommandContextMixIn)
SSLContext)NormalizedName
PipSessionc                    [         R                  S:  a  [        R                  S5        g  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)N)   
   z7Disabling truststore because Python version isn't 3.10+r   z1Disabling truststore since ssl support is missing)
truststorez5Disabling truststore because platform isn't supported)sysversion_infologgerdebugsslImportErrorwarningpip._vendorr   r
   PROTOCOL_TLS_CLIENTload_verify_locationsr   where)r   r   ctxs      [/var/www/html/land-ocr/venv/lib/python3.13/site-packages/pip/_internal/cli/index_command.py_create_truststore_ssl_contextr   !   s    
'!NO
*
 

 7 7
8Cgmmo.J  JK  NOs"   A8 B 8BB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$ )SessionCommandMixin8   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_urlsA   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'   r3   s     r   get_default_session'SessionCommandMixin.get_default_sessionO   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_hostsr4   ssl_context)httphttpsF)pip._internal.network.sessionr   	cache_dirospathisabsdeprecated_features_enabledr   joinr@   rA   rB   r7   certverifyclient_certtimeoutproxyproxies	trust_env	pip_proxyno_inputauth	promptingkeyring_provider)r'   r3   r@   rP   r   rG   rC   sessions           r   r;   "SessionCommandMixin._build_sessionY   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)r3   r   r[   zlist[str] | None)r3   r   r[   r   )NN)r3   r   r@   
int | NonerP   r]   r[   r   )__name__
__module____qualname____firstlineno____doc__r%   classmethodr7   r<   r;   __static_attributes____classcell__)r(   s   @r   r!   r!   8   s^    0 " " #"	22 2 	2
 
2 2r*   r!   c                     SSK Jn  U" X5        g )Nr   )pip_self_version_check)!pip._internal.self_outdated_checkrg   )rY   r3   checks      r   _pip_self_version_checkrj      s    Q	'r*   c                  8    \ rS rSrSr      SS jrSS j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'   r3   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  g U R                  US[	        SUR
                  5      S9nU   [        X!5        SSS5        g! , (       d  f       g= f! [         a,    [        R                  S5        [        R                  SSS	9   gf = f)
zh
Do the pip version check if not disabled.

This overrides the default behavior of not doing the check.
r,   Nr      )r@   rP   z6There was an error checking the latest version of pip.zSee below for errorT)exc_info)hasattrdisable_pip_version_checkr,   r;   minrP   rj   	Exceptionr   r   r   )r'   r3   rY   s      r   handle_pip_version_check*IndexGroupCommand.handle_pip_version_check   s     w
++++,,0@0@	?))Aw/ * G
 '9  	?NNSTLL.L>	?s/   'B A4+B 4
B>B B 3B;:B; N)r3   r   rq   r   r[   bool)r3   r   r[   r\   )r^   r_   r`   ra   rb   rs   r|   rd   r~   r*   r   rl   rl      s)    -;	"?r*   rl   )r[   zSSLContext | None)rY   r   r3   r   r[   r\   )rb   
__future__r   loggingrH   r   	functoolsr   optparser   typingr   r   r   pip._internal.cli.base_commandr   !pip._internal.cli.command_contextr	   r   r
   pip._vendor.packaging.utilsr   rF   r   	getLoggerr^   r   r   r!   rj   rl   r~   r*   r   <module>r      s~    #  	 
      2 A:8			8	$  ,S- Sl/?!4 /?r*   