a ReYA@sUdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlmZmZmZmZmZmZmZmZmZddlmZmZddlmZddlm Z m!Z!ddl"m#Z#m$Z$ddl%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.dd l/m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;ddle?Z@eeAeAeeeBeAffZCejDde*dgdZEeeCeFd<dZGeHdddZIeAdddZJGddde ZKGd d!d!e!ZLGd"d#d#eZMGd$d%d%ejNZOdS)&zhPipSession and supporting code, containing all pip-specific network request configuration and behavior. N) AnyDictIteratorListMappingOptionalSequenceTupleUnion)requestsurllib3)CacheControlAdapter) 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_pathignore)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_CIreturncCstddtDS)z? Return whether it looks like pip is running under CI. css|]}|tjvVqdSN)osenviron).0namer2/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/network/session.py Xz looks_like_ci..)anyCI_ENVIRONMENT_VARIABLESr2r2r2r3 looks_like_ciQsr8c Csdtdtdtid}|dddkr@t|dd<n|dddkrtj}|jd krl|d d }d d d|D|dd<nB|dddkrt|dd<n |dddkrt|dd<tjdrRddl m }| | | f}ttddtgd|}ttddtddgt}|rD||d<|rR||d<tjdrtdrdtdd|d<trt|did<trt|did<trt|d<trdd l}|j|d <td!}|d urt|j |d"<td#d urvztj d#d$gtj!d%d&}Wnt"yRYn$0|d'rv|#d(d)$|d*<t%rd+nd |d,<t&j'(d-} | d ur| |d.<d/j)|t*j+|d0d+d1d2S)3z6 Return a string representing the user agent. pip)r1versionr1) installerpythonimplementationr=CPythonr:PyPyfinalN.cSsg|] }t|qSr2)str)r0xr2r2r3 nr5zuser_agent..Jython IronPythonlinuxr)distrocSs|dSNr2rDr2r2r3}r5zuser_agent..)r1r:idcSs|dSrJr2rLr2r2r3rMr5liblibcrIdarwinmacOSsystemreleasecpuopenssl_version setuptoolssetuptools_versionrustcz --versiong?)stderrtimeoutsrustc  rK 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._vendorrIr1r:codenamedictfilterziprmac_verrS setdefaultrTmachiner_sslOPENSSL_VERSIONrget_distributionrCshutilwhich subprocess check_outputSTDOUT Exceptionsplitdecoder8r.r/getformatrfdumps) rerkrIlinux_distribution distro_infosrPsslsetuptools_dist rustc_outputr`r2r2r3 user_agent[s                rc @sreZdZd eeeeeeeeffeee feee ee e ffee e e fe dddZ dddd Z dS) LocalFSAdapterFNT)requeststreamr[verifycertproxiesr,c Cst|j}t}d|_|j|_zt|} WnTty} zzt |} t |} Wn2t y|r| | kr|dkrYq>Yn 0| | vrq>|| kr| dkr| durq>dStd||dS)N+rKr"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)urllibparseurlparserCrhostnamerrsplitr ipaddress ip_address ip_network ValueErrorlowerrwarning) rrparsedorigin_protocol origin_host origin_port secure_originsecure_protocol secure_host secure_portaddrnetworkr2r2r3is_secure_origin~sJ       zPipSession.is_secure_origin)methodrrrr,cs*|d|jtj||g|Ri|S)Nr[)rur[rr)rrrrrrr2r3rszPipSession.request)NF)rrrr[rint__annotations__rrCrrrrrrr SecureOriginrrrrrrr2r2rr3rs.  M  Cr)P__doc__ email.utilsrrrrfloggingrr.rgrzr|rj urllib.parserwarningstypingrrrrrrrr r ror r pip._vendor.cachecontrolr Zpip._vendor.requests.adaptersrrZpip._vendor.requests.modelsrrZpip._vendor.requests.structuresrZ"pip._vendor.urllib3.connectionpoolrZpip._vendor.urllib3.exceptionsrr9rpip._internal.metadatarpip._internal.models.linkrpip._internal.network.authrpip._internal.network.cacherpip._internal.utils.compatrpip._internal.utils.glibcrpip._internal.utils.miscrrpip._internal.utils.urlsr getLoggerrrrCrrfilterwarningsr&rr7rr8rrrrSessionrr2r2r2r3sR,               e,