idHUdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlmZmZmZmZmZmZmZmZmZmZddlmZmZddlmZ ddl!m"Z"m#Z#ddl!m$Z%ddl&m'Z'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.dd l/m0Z0dd l1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:ddl;mZ>m?Z?ddl@mAZAer ddlBmCZCddlDmEZEejFeGZHeeIeIeeeJeIffZKejLde.gdZMeeKeNd<dZOdePfdZQdeIfdZRGdd e#ZSGd!d"ZTGd#d$eTe%Z$Gd%d&eTe ZGd'd(e$ZUGd)d*eZVGd+d,ejWZXdS)-zhPipSession and supporting code, containing all pip-specific network request configuration and behavior. N) TYPE_CHECKINGAnyDict GeneratorListMappingOptionalSequenceTupleUnion)requestsurllib3)CacheControlAdapter)DEFAULT_POOLBLOCK BaseAdapter) HTTPAdapter)PreparedRequestResponse)CaseInsensitiveDict)ConnectionPool)InsecureRequestWarning) __version__)get_default_environment)Link)MultiDomainBasicAuth) SafeFileCache)has_tls)libc_ver)build_url_from_netloc parse_netloc) url_to_path) SSLContext) PoolManagerignore)category))https*r')r' localhostr')r'z 127.0.0.0/8r')r'z::1/128r')filer'N)sshr'r'SECURE_ORIGINS) BUILD_BUILDIDBUILD_IDCI PIP_IS_CIreturnc>tdtDS)z? Return whether it looks like pip is running under CI. c32K|]}|tjvVdSN)osenviron).0names R/opt/cloudlinux/venv/lib/python3.11/site-packages/pip/_internal/network/session.py z looks_like_ci..js)GGdtrz!GGGGGG)anyCI_ENVIRONMENT_VARIABLESr:r8 looks_like_cir>cs" GG.FGGG G GGr:c ldtdtjdtjid}|dddkrtj|dd<n|dddkrJtj}|jd kr |d d }d d |D|dd<n]|dddkrtj|dd<n.|dddkrtj|dd<tjdrddl m }| | | f}ttdt!gd|}ttdt!ddgt#}|r||d<|r||d<tjdr8tjdrdtjdd|d<tjr*tj|did<tjr*tj|did<tjrtj|d<t/rdd l}|j|d<t5d}|t9|j |d <t;jd!z t?j d!d"gt>j!d#$}|d%r0|"d&d'#|d(<n#tH$rYnwxYwtKrd)nd |d*<tLj'(d+} | | |d,<d-)|tUj+|d.d)/0S)1z6 Return a string representing the user agent. pip)r7versionr7) installerpythonimplementationrDCPythonrAPyPyfinalN.c,g|]}t|Sr=)str)r6xs r8 zuser_agent..s / / /SVV / / /r:Jython IronPythonlinuxr)distroc|dSNr=rLs r8zuser_agent.. !A$r:)r7rAidc|dSrSr=rUs r8rVzuser_agent..rWr:liblibcrQdarwinmacOSsystemreleasecpuopenssl_version setuptoolssetuptools_versionrustcz --versiong?)stderrtimeoutsrustc  rT rustc_versionTciPIP_USER_AGENT_USER_DATA user_dataz9{data[installer][name]}/{data[installer][version]} {json}),:) separators sort_keys)datajson),rplatformpython_versionpython_implementationsyspypy_version_info releaseleveljoin startswith pip._vendorrQr7rAcodenamedictfilterziprmac_verr^ setdefaultr_machiner_sslOPENSSL_VERSIONrget_distributionrKshutilwhich subprocess check_outputSTDOUTsplitdecode Exceptionr>r4r5getformatrqdumps) rprvrQlinux_distribution distro_infosr[sslsetuptools_dist rustc_outputrks r8 user_agentrmsk $ <<)++ H244 D f%22,4,C,E,E y))   '6 1 11  )W 4 4 1"1" 5 ,/HH / /. / / /- -  y))   '8 3 3,4,C,E,E y))   '< 7 7,4,C,E,E y) |w''*&&&&&&#[[]]FNN,<,O>OO'+ ---/ABB  ( (  UI& 33      (#'L  *)DN |x((MX-=-?-?-BM")h6F6H6H6KLLXB080A0A"%%f-F3;3C3E3E"%%i0)&((U yy6"%"5 -//@@NNO"%()@%A%A !" |G( M%2+&z/@#L &&y11 M)5(:(:4(@(@(C(J(J(L(L_%    D '2dDJ 9::I%[ F M M  Zt D D D N  s#N?? O  O ceZdZ d dededeeeeeeffdeee fdeee ee e ffd ee e e fd e fd Z dd Z dS)LocalFSAdapterFNTrequeststreamrfverifycertproxiesr0ct|j}t}d|_|j|_ t j|} t j| j d} tj |dpd} t| | j | d|_t|d|_|jj|_nm#t$$r`} d|_t'| j|_t-j|jd | d |_Yd} ~ nd} ~ wwxYw|S) NT)usegmtrz text/plain)z Content-TypezContent-Lengthz Last-Modifiedrbiz: utf8)r!urlr status_coder4statemailutils formatdatest_mtime mimetypes guess_typerst_sizeheadersopenrawcloseOSErrortype__name__reasonioBytesIOencode) selfrrrfrrrpathnamerespstatsmodified content_typeexcs r8sendzLocalFSAdapter.sends>w{++zz; (GH%%E{--enT-JJH$/99!<L L.$0&+m%-DLHd++DHDJJ% J J J #D s)),DKzT["9"9C"9"9"@"@"H"HIIDHHHHHH  J( sC D;AD66D;cdSr3r=)rs r8rzLocalFSAdapter.closes r:)FNTNN)r0N)r __module__ __qualname__rboolr r floatr rKrrrrr=r:r8rrs?C#'6:/3%% %%%uUE\': :;< % dCi % uS%S/123 %'#s(+,% %%%%N      r:rc feZdZdZdddeddeddffdZefd ed ed e d edd f fd Z xZ S)_SSLContextAdapterMixina#Mixin to add the ``ssl_context`` constructor argument to HTTP adapters. The additional argument is forwarded directly to the pool manager. This allows us to dynamically decide what SSL store to use at runtime, which is used to implement the optional ``truststore`` backend. N) ssl_contextrr"kwargsr0c H||_tjdi|dS)Nr=) _ssl_contextsuper__init__)rrr __class__s r8rz _SSLContextAdapterMixin.__init__s0 (""6"""""r: connectionsmaxsizeblock pool_kwargsr#c |j|d|jtjd|||d|S)Nr)rrrr=)rrrinit_poolmanager)rrrrrrs r8rz(_SSLContextAdapterMixin.init_poolmanagers_   (  " "=$2C D D D'uww' #      r:) rrr__doc__r rrrintrr __classcell__rs@r8rrs/3###l+# #  ######(                    r:rceZdZdS)rNrrrr=r:r8rr Dr:rceZdZdS)rNrr=r:r8rr$rr:rc peZdZdededeeefdeeeeeeffddf fd Z xZ S)InsecureHTTPAdapterconnrrrr0NcRt||d|dSNF)rrrrr cert_verifyrrrrrrs r8rzInsecureHTTPAdapter.cert_verify), 3u4HHHHHr: rrrrrKr rr r rrrs@r8rr(IIIdCi I uS%S/123 I  IIIIIIIIIIr:rc peZdZdededeeefdeeeeeeffddf fd Z xZ S)InsecureCacheControlAdapterrrrrr0NcRt||d|dSrrrs r8rz'InsecureCacheControlAdapter.cert_verify4rr:rrs@r8rr3rr:rc8eZdZUdZeeed<dddddddededeed e ed ee ed ed d eddffdZ de eddfdZ ddedeede ddfdZdeeddffdZdede fdZdededed edef fd ZxZS) PipSessionNrfrr=)retriescache trusted_hosts index_urlsrargsrrrrrr"rr0c~tj|i|g|_t|jd<t ||_tj|gdd}t|}|rCtt|||} tt|||_ nt|| } ||_ |d | |d ||d t!|D]} || d dS)zj :param trusted_hosts: Domains not to emit warnings for when not using HTTPS. z User-Agent)r)iiiig?)totalstatus_forcelistbackoff_factor) max_retries)rrr)rr)rrzhttps://zhttp://zfile://T)suppress_loggingN)rrpip_trusted_originsrrrauthrRetryrrrr_trusted_host_adapterrmountradd_trusted_host) rrrrrrrrinsecure_adaptersecure_adapterhostrs r8rzPipSession.__init__As $)&)))EG &0\\ \")J??? -211    */7CCC  :0#E**#'N *E#E**#***D & & )W+VVVN)9D & :~... 9./// 9n..///! ? ?D  ! !$ ! > > > > ? ?r:new_index_urlsc||j_dS)zn :param new_index_urls: New index urls to update the authentication handler with. N)rr)rrs r8update_index_urlszPipSession.update_index_urlss . r:Frsourcerc`|s*d|}| |d|dz }t|t|\}}|td|||f|jvr|j||f|t|ddz|j|t|dz|j|sZ|t|dd z|j|t|d z|jdSdS) z :param host: It is okay to provide a host that has previously been added. :param source: An optional source string, for logging where the host string came from. zadding trusted host: Nz (from )z+Trusted host URL must include a host part: http)scheme/rm) loggerinfor ValueErrorrappendrrr)rrrrmsg parsed_host parsed_ports r8rzPipSession.add_trusted_hostso  2$22C!***** KK   #/#5#5 [  S4SSTT T  %T-E E E  $ + +[+,F G G G !$v 6 6 6 X    (..4d6PQQQ V JJ%d6:::S@*    JJ,T22S8$:T U U U U U  V Vr:c#TKtEd{V|jD]\}}d||dn|fVdS)Nr')r+r)rrports r8iter_secure_originszPipSession.iter_secure_originss\!!!!!!!!2 = =JD$T\cct< < < < < = =r:locationcXtjt|}|j|j|j}}}|ddd}|D]}|\}}} ||kr|dkr tj |pd} tj |} | | vrEnD#t$r7|r2| | kr|dkrYYnwxYw|| kr | dkr| dStd||dS) N+rTr'TzThe repository located at %s is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host %s'.F)urllibparseurlparserKrhostnamerrsplitr ipaddress ip_address ip_networkr lowerrwarning) rrparsedorigin_protocol origin_host origin_port secure_originsecure_protocol secure_host secure_portaddrnetworks r8is_secure_originzPipSession.is_secure_origins&&s8}}55 M O K'2*00a88< "5577! ! M8E 5O[+/11o6L6L  +K,=2>>#.{;;w&&'    #))++{/@/@/B/BBB#s**H "{**3&&+44  I      us*B88s!GXc]!!! #')*..2M?M?M?M?M?} M?  } M? T#Y' M?l+M?M? M?M?M?M?M?M?^.S .d....QVVVV!)#VIMV VVVVB=Y|T4/G%H==== AA$AAAAF=c==C=3=8==========r:r)Yr email.utilsrrrrqloggingrr4rrrrru urllib.parserwarningstypingrrrrrrr r r r rzr rpip._vendor.cachecontrolr_BaseCacheControlAdapterpip._vendor.requests.adaptersrrr_BaseHTTPAdapterpip._vendor.requests.modelsrrpip._vendor.requests.structuresr"pip._vendor.urllib3.connectionpoolrpip._vendor.urllib3.exceptionsrr@rpip._internal.metadatarpip._internal.models.linkrpip._internal.network.authrpip._internal.network.cacherpip._internal.utils.compatrpip._internal.utils.glibcrpip._internal.utils.miscrr pip._internal.utils.urlsr!rr"pip._vendor.urllib3.poolmanagerr# getLoggerrrrKrr/filterwarningsr+r.r<rr>rrrrrSessionrr=r:r8rIs                             *)))))))TTTTTTHHHHHHHHIIIIIIAAAAAAAA??????======AAAAAA::::::******;;;;;;555555/...........HHHHHHHH000000<;;;;;;  8 $ $S#xc3h889 +ABBBB & & &\"   ( HtHHHHbCbbbbJ) ) ) ) ) [) ) ) X        D     )+;        13K   IIIII+IIIIIIII"5IIII=I=I=I=I=!I=I=I=I=I=r: