
    wOg                        d Z ddlZddlZddlZddlmZ ddlmZmZm	Z	 ddl
mZ ddlmZ ddlmZ erddlmZ dd	lmZ  ej        e          Zd
e	d         fdZ G d de          Zddded
dfdZ G d dee          ZdS )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.
    N)Values)TYPE_CHECKINGListOptional)certifi)Command)CommandContextMixIn)
SSLContext
PipSessionreturnr
   c                     t           j        dk     rt                              d           d S 	 dd l} n+# t
          $ r t                              d           Y d S w xY w	 ddlm} n+# t
          $ r t                              d           Y d S w xY w|	                    | j
                  }|                    t          j                               |S )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      Y/var/www/AppWebDeiv/myenv/lib/python3.11/site-packages/pip/_internal/cli/index_command.py_create_truststore_ssl_contextr      s    
'!!NOOOt



   JKKKtt*******   NOOOtt 

 7
8
8Cgmoo...Js!   3 $AAA& &$BBc            	            e Zd ZdZd fdZededeee	                  fd            Z
deddfdZ	 	 dded	ee         d
ee         ddfdZ xZS )SessionCommandMixinzE
    A class mixin for command classes needing _build_session().
    r   Nc                 V    t                                                       d | _        d S )N)super__init___session)self	__class__s    r   r$   zSessionCommandMixin.__init__7   s$    .2    optionsc                     g }t          |dd          s(t          |dd          }|r|                    |           t          |dd          }|r|                    |           |pdS )z7Return a list of index urls from user-provided options.no_indexF	index_urlNextra_index_urls)getattrappendextend)clsr)   
index_urlsurlurlss        r   _get_index_urlsz#SessionCommandMixin._get_index_urls;   s     
w
E22 	'';55C '!!#&&&w 2D99 	$d###!T!r(   r   c                     | j         6|                     |                     |                    | _         | j         J | j         S )zGet a default-managed session.)r%   enter_context_build_session)r&   r)   s     r   get_default_sessionz'SessionCommandMixin.get_default_sessionI   sE    =  ..t/B/B7/K/KLLDM =,,,}r(   retriestimeoutc                 H   ddl m} |j        }|r!t          j                            |          sJ d|j        vrt                      }nd } ||r t          j                            |d          nd ||n|j	        |j
        |                     |          |          }|j        r|j        |_        |j        r|j        |_        |j        s|r||n|j        |_        |j        r|j        |j        d|_        d|_        |j         |j        _        |j        |j        _        |S )Nr   r   zlegacy-certszhttp-v2)cacher:   trusted_hostsr2   ssl_context)httphttpsF)pip._internal.network.sessionr   	cache_dirospathisabsdeprecated_features_enabledr   joinr:   r>   r5   certverifyclient_certr;   proxyproxies	trust_envno_inputauth	promptingkeyring_provider)r&   r)   r:   r;   r   rC   r?   sessions           r   r8   z"SessionCommandMixin._build_sessionS   s]    	=<<<<<%	8i 8 8888!DDD8::KKK*8AK"',,y)444t&2GG!/++G44#
 
 
 < 	*$\GN  	/".GL ? 	Rg 	R)0)<gg'/GO = 	&  GO !&G &-%5!5(/(@%r(   )r   N)NN)__name__
__module____qualname____doc__r$   classmethodr   r   r   strr5   r9   intr8   __classcell__)r'   s   @r   r!   r!   2   s         3 3 3 3 3 3 "f "$s)1D " " " ["6 l     "&!%	0 00 #0 #	0
 
0 0 0 0 0 0 0 0r(   r!   rS   r   r)   c                 *    ddl m}  || |           d S )Nr   )pip_self_version_check)!pip._internal.self_outdated_checkr]   )rS   r)   checks      r   _pip_self_version_checkr`      s,    QQQQQQ	E'7r(   c                   "    e Zd ZdZdeddfdZdS )IndexGroupCommandz
    Abstract base class for commands with the index_group options.

    This also corresponds to the commands that permit the pip version check.
    r)   r   Nc                    t          |d          sJ |j        s|j        rdS 	 |                     |dt	          d|j                            }|5  t          ||           ddd           dS # 1 swxY w Y   dS # t          $ r: t          	                    d           t          
                    dd	           Y dS w xY w)
z
        Do the pip version check if not disabled.

        This overrides the default behavior of not doing the check.
        r+   Nr      )r:   r;   z6There was an error checking the latest version of pip.zSee below for errorT)exc_info)hasattrdisable_pip_version_checkr+   r8   minr;   r`   	Exceptionr   r   r   )r&   r)   rS   s      r   handle_pip_version_checkz*IndexGroupCommand.handle_pip_version_check   s2    w
+++++, 	0@ 	F	?))Aw// *  G
  : :'999: : : : : : : : : : : : : : : : : : 	? 	? 	?NNSTTTLL.L>>>>>>	?s6   -A< A/"A< /A33A< 6A37A< <A C ?C )rT   rU   rV   rW   r   rj    r(   r   rb   rb      s@         ? ?4 ? ? ? ? ? ?r(   rb   )rW   loggingrD   r   optparser   typingr   r   r   r   r   pip._internal.cli.base_commandr   !pip._internal.cli.command_contextr	   r   r
   rB   r   	getLoggerrT   r   r   r!   r`   rb   rk   r(   r   <module>rr      s     				 



       0 0 0 0 0 0 0 0 0 0       2 2 2 2 2 2 A A A A A A 9888888		8	$	$(>    ,Q Q Q Q Q- Q Q Qh\ F t    ? ? ? ? ?!4 ? ? ? ? ?r(   