Reh;@sdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z m Z m Z ddlmZddlmZmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd l m!Z!dd l"m#Z#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.e,rddl/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5m6Z6e3e7e7e2e4e8e7ffZ9ej:e;Z<e j=dded-d.d/d0d1d2gZ>d3Z?d!d"Z@d#d$ZAGd%d&d&eZBGd'd(d(eZCGd)d*d*eZDGd+d,d,e jEZFdS)4zhPipSession and supporting code, containing all pip-specific network request configuration and behavior. N)requestssixurllib3)CacheControlAdapter) BaseAdapter HTTPAdapter)Response)CaseInsensitiveDict)parse)InsecureRequestWarning) __version__)MultiDomainBasicAuth) SafeFileCache)has_tls ipaddress)libc_ver)build_url_from_netlocget_installed_version parse_netloc)MYPY_CHECK_RUNNING) url_to_path)IteratorListOptionalTupleUnion)Linkignorecategoryhttps* localhost 127.0.0.0/8::1/128filessh BUILD_BUILDIDBUILD_IDCI PIP_IS_CIcCstddtDS)z? Return whether it looks like pip is running under CI. css|]}|tjkVqdS)N)osenviron).0namer./builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/network/session.py `sz looks_like_ci..)anyCI_ENVIRONMENT_VARIABLESr.r.r.r/ looks_like_ciXsr3c Cs ddddtidtjddtjii}|dddkratj|ddws zuser_agent..Jython IronPythonlinuxr)distrocSs|dS)Nr.)r?r.r.r/szuser_agent..idcSs|dS)NrEr.)r?r.r.r/rFsliblibcrDdarwinmacOSsystemreleasecpuopenssl_version setuptoolssetuptools_versionTciPIP_USER_AGENT_USER_DATA user_dataz9{data[installer][name]}/{data[installer][version]} {json}datajson separators,: sort_keys)rXrY) r platformpython_versionpython_implementationsyspypy_version_info releaseleveljoin startswith pip._vendorrDdictfilterziplinux_distributionrmac_verrL setdefaultrMmachiner_sslOPENSSL_VERSIONrr3r*r+getformatrVdumps)rUr_rD distro_infosrIsslrQrTr.r.r/ user_agentcsb  ! $   "             rrc@s7eZdZdddddddZddZdS)LocalFSAdapterNc Cst|j}t}d|_|j|_ytj|} Wn7tk ry} zd|_| |_WYdd} ~ XnzXtj j | j dd} t j |dpd} td| d| jd | i|_t|d |_|jj|_|S) NiusegmtTrz text/plainz Content-TypezContent-Lengthz Last-Modifiedrb)rurlr status_coder*statOSErrorrawemailutils formatdatest_mtime mimetypes guess_typer st_sizeheadersopenclose) selfrequeststreamtimeoutverifycertproxiespathnamerespstatsexcmodified content_typer.r.r/sends$     zLocalFSAdapter.sendcCsdS)Nr.)rr.r.r/rszLocalFSAdapter.close)__name__ __module__ __qualname__rrr.r.r.r/rss  rscs"eZdZfddZS)InsecureHTTPAdapterc s/tt|jd|d|ddd|dS)NconnrwrFr)superr cert_verify)rrrwrr) __class__r.r/rszInsecureHTTPAdapter.cert_verify)rrrrr.r.)rr/rs rcs"eZdZfddZS)InsecureCacheControlAdapterc s/tt|jd|d|ddd|dS)NrrwrFr)rrr)rrrwrr)rr.r/rsz'InsecureCacheControlAdapter.cert_verify)rrrrr.r.)rr/rs rcsdeZdZdZfddZddddZddZd d Zfd d ZS) PipSessionNc sz|jdd}|jdd}|jdg}|jdd}tt|j||g|_t|jdschemehostnamerrsplitrr ip_addressr ensure_text ip_network ValueErrorlowerrwarning) rlocationparsedorigin_protocol origin_host origin_portrsecure_protocol secure_host secure_portaddrnetworkr.r.r/is_secure_originXs<      zPipSession.is_secure_origincs2|jd|jtt|j||||S)Nr)rirrrr)rmethodrwrr)rr.r/rszPipSession.request) rrrrrrrrrr.r.)rr/rs L  Hr)rr r )r r!r )r r"r )r r#r )r$r N)r%r r )r&r'r(r))G__doc__ email.utilsr|rVloggingrr*r[r^warningsrcrrrZpip._vendor.cachecontrolrZpip._vendor.requests.adaptersrrZpip._vendor.requests.modelsrZpip._vendor.requests.structuresr Zpip._vendor.six.moves.urllibr rZpip._vendor.urllib3.exceptionsr r5r pip._internal.network.authr pip._internal.network.cacherpip._internal.utils.compatrrpip._internal.utils.glibcrpip._internal.utils.miscrrrpip._internal.utils.typingrpip._internal.utils.urlsrtypingrrrrrpip._internal.models.linkrr>intZ SecureOrigin getLoggerrrfilterwarningsrr2r3rrrsrrSessionrr.r.r.r/sZ        (!  P!