v]c@@sdZddlmZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z ddl mZddlmZddlmZddlmZdd lmZmZmZddlmZdd lmZdd lmZm Z dd l!m"Z"m#Z#m$Z$m%Z%dd l&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5m6Z6m7Z7m8Z8m9Z9ddl:m;Z;ddl<m=Z=ddl>m?Z?e=r9ddlm@Z@ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNddlOZPddlmQZQddlRmSZSddlTmUZUddlVmWZWddlmXZXddlYmZZZdd l[m\Z\eMeBd!fZ]eMe^e^e^eQe]eIe^fZ_ePj`jajbZceMededeIedfZend"d#d$gZfd%d&d&fd&d'd&fd&d(d&fd&d)d&fd*d&egfd+d&d&fgZhejiejZkd,Zld-Zmd.enfd/YZod0Zpd1enfd2YZqd3Zrd4Zsegd5Ztegd6Zuevd7Zwd8exfd9YZyd:Zzd;exfd<YZ{d=exfd>YZ|d#exfd?YZ}d$exfd@YZ~dAZdBZdCZdDZdEZdFZdGexfdHYZdS(Is!Routines related to PyPI, indexesi(tabsolute_importN(thtml5libtrequeststsix(tunescape(t specifiers(tcanonicalize_name(tparse(t HTTPErrort RetryErrortSSLError(trequest(tis_urlt url_to_path(tBestVersionAlreadyInstalledtDistributionNotFoundtInvalidWheelFilenametUnsupportedWheel(tInstallationCandidate(t FormatControl(tLink(tSelectionPreferences(t TargetPython(t ipaddress(t indent_log(tARCHIVE_EXTENSIONStSUPPORTED_EXTENSIONStWHEEL_EXTENSIONt path_to_urltredact_password_from_url(tcheck_requires_python(tMYPY_CHECK_RUNNING(tWheel(tLogger( tAnytCallablet FrozenSettIterabletIteratortListtMutableMappingtOptionaltSequencetSettTexttTupletUnion(t _BaseVersion(tResponse(t SearchScope(tInstallRequirement(t PipSession(t Pep425Tag(tHashes.RtFoundCandidatest PackageFinderthttpst*t localhosts 127.0.0.0/8s::1/128tfiletsshcC@sWddlm}x@|jD]5}|jj|r|t|dkr|SqWdS(sgLook for VCS schemes in the URL. Returns the matched VCS scheme, or None if there's no match. i(tvcss+:N(tpip._internal.vcsR=tschemestlowert startswithtlentNone(turlR=tscheme((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_match_vcs_schemeRs +cC@s7t|j}x!tD]}|j|rtSqWtS(s2Return whether the URL looks like an archive. (RtfilenameRtendswithtTruetFalse(RDRGtbad_ext((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_is_url_like_archive_s  t_NotHTMLcB@seZdZRS(cC@s/tt|j||||_||_dS(N(tsuperRMt__init__t content_typet request_desc(tselfRPRQ((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyROks (t__name__t __module__RO(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyRMjscC@sF|jjdd}|jjdsBt||jjndS(sCheck the Content-Type header to ensure the response contains HTML. Raises `_NotHTML` if the content type is not text/html. s Content-Typets text/htmlN(theaderstgetR@RARMR tmethod(tresponseRP((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_ensure_html_headerrst_NotHTTPcB@seZRS((RSRT(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR[}scC@sitj|\}}}}}|ddhkr<tn|j|dt}|jt|dS(sSend a HEAD request to the URL, and ensure the response contains HTML. Raises `_NotHTTP` if the URL is not available for a HEAD request, or `_NotHTML` if the content type is not text/html. thttpR8tallow_redirectsN(t urllib_parseturlsplitR[theadRItraise_for_statusRZ(RDtsessionREtnetloctpathtquerytfragmenttresp((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_ensure_html_responses   cC@spt|rt|d|ntjdt||j|didd6dd6}|jt||S(sAccess an HTML page with GET, and return the response. This consists of three parts: 1. If the URL looks suspiciously like an archive, send a HEAD first to check the Content-Type is HTML, to avoid downloading a large file. Raise `_NotHTTP` if the content type cannot be determined, or `_NotHTML` if it is not HTML. 2. Actually perform the request. Raise HTTP exceptions on network failures. 3. Check the Content-Type header to make sure we got HTML, and raise `_NotHTML` otherwise. RbsGetting page %sRVs text/htmltAccepts max-age=0s Cache-Control(RLRhtloggertdebugRRWRaRZ(RDRbRg((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_get_html_responses    cC@s,|dkrtj}n|d||dS(Ns%Could not fetch URL %s: %s - skipping(RCRjRk(tlinktreasontmeth((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_handle_get_page_fails  c C@s-|dkrtdn|jjddd}t|}|r]tjd||dStj|\}}}}}}|dkrt j j t j |r|jds|d7}ntj|d}tjd |nyt|d |}Wntk rtjd |n tk rM}tjd ||j|jntk rl}t||ntk r}t||ntk r}d } | t|7} t|| dtjn`tjk r}t|d|n:tjk rt|dnXt|j|j|j SdS(Ns?_get_html_page() missing 1 required keyword argument: 'session't#iisCannot look at %s URL %sR;t/s index.htmls# file: URL is directory, getting %sRbsQSkipping page %s because it looks like an archive, and cannot be checked by HEAD.s<Skipping page %s because the %s request got Content-Type: %ss4There was a problem confirming the ssl certificate: Rosconnection error: %ss timed out(!RCt TypeErrorRDtsplitRFRjRkR^turlparsetosRdtisdirturllib_requestt url2pathnameRHturljoinRlR[RMRQRPRRpR R tstrtinfoRtConnectionErrortTimeouttHTMLPagetcontentRV( RmRbRDt vcs_schemeREt_RdRgtexcRn((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_get_html_pagesL   !'   cC@syt|jd|}Wn*tjk rEtjd|j|n^X|sdjtt|}|stjd||j|t Stjd||j|nt S(sa Return whether the given Python version is compatible with a link's "Requires-Python" value. :param version_info: A 3-tuple of ints representing the Python major-minor-micro version to check. :param ignore_requires_python: Whether to ignore the "Requires-Python" value if the given Python version isn't compatible. t version_infos2Ignoring invalid Requires-Python (%r) for link: %st.s4Link requires a different Python (%s not in: %r): %ssBIgnoring failed Requires-Python check (%s not in: %r) for link: %s( Rtrequires_pythonRtInvalidSpecifierRjRktjointmapR{RJRI(RmRtignore_requires_pythont is_compatibletversion((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_check_link_requires_pythons$t LinkEvaluatorcB@s2eZdZejdZddZdZRS(sD Responsible for evaluating links for a particular project. s-py([123]\.?[0-9]?)$cC@sO|dkrt}n||_||_||_||_||_||_dS(s :param project_name: The user supplied package name. :param canonical_name: The canonical package name. :param formats: The formats allowed for this package. Should be a set with 'binary' or 'source' or both in it. :param target_python: The target Python interpreter to use when evaluating link compatibility. This is used, for example, to check wheel compatibility, as well as when checking the Python version, e.g. the Python version embedded in a link filename (or egg fragment) and against an HTML link's optional PEP 503 "data-requires-python" attribute. :param allow_yanked: Whether files marked as yanked (in the sense of PEP 592) are permitted to be candidates for install. :param ignore_requires_python: Whether to ignore incompatible PEP 503 "data-requires-python" values in HTML links. Defaults to False. N(RCRJt _allow_yankedt_canonical_namet_ignore_requires_pythont_formatst_target_pythont project_name(RRRtcanonical_nametformatst target_pythont allow_yankedR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyRO=s       c C@sd}|jr;|j r;|jp%d}tdj|fS|jrY|j}|j}nT|j\}}|s{tdfS|t krtd|fSd|j kr|t krd|j }t|fSd|j kr|dkrtd fS|t kryt|j}Wntk r%td fSXt|j|jkrUd |j }t|fS|jj}|j|s|j}d jd j|}t|fS|j}nd|j kr|t krtd|j fS|st||j}n|s td|j fS|jj|} | ra|| j }| jd} | |jjkratdfSnt |d|jj!d|j"} | stdfSt#j$d||t%|fS(sG Determine whether a link is a candidate for installation. :return: A tuple (is_candidate, result), where `result` is (1) a version string if `is_candidate` is True, and (2) if `is_candidate` is False, an optional string to log the reason the link fails to qualify. s uyanked for reason: {}s not a filesunsupported archive format: %stbinarysNo binaries permitted for %stmacosx10s.zips macosx10 onesinvalid wheel filenameswrong project name (not %s)s"none of the wheel's tags match: {}s, tsourcesNo sources permitted for %ssMissing project version for %sisPython version is incorrectRRsFound link %s, version: %sN(&RCt is_yankedRt yanked_reasonRJtformatt egg_fragmenttexttsplitextRRRRRdR RGRRtnameRRtget_tagst supportedtget_formatted_file_tagsRRt_extract_version_from_fragmentt_py_version_retsearchtstarttgroupt py_versionRtpy_version_infoRRjRkRI( RRRmRRntegg_infoRtwheeltsupported_tagst file_tagstmatchRtsupports_python((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt evaluate_linkcsh                    N( RSRTt__doc__tretcompileRRCROR(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR1s c C@s:|s)tjdt||t|Sg}g}d}x_|D]W}|j}|js]n/|jd|r||d7}n|j|qB|j|qBW|r|}n t|}t|t|krd} n+djt|dj d|D} tjd t|||j |t||| |S( s Filter out candidates whose hashes aren't allowed, and return a new list of candidates. If at least one candidate has an allowed hash, then all candidates with either an allowed hash or no hash specified are returned. Otherwise, the given candidates are returned. Including the candidates with no hash specified when there is a match allows a warning to be logged if there is a more preferred candidate with no hash specified. Returning all candidates in the case of no matches lets pip report the hash of the candidate that would otherwise have been installed (e.g. permitting the user to more easily update their requirements file with the desired hash). sJGiven no hashes to check %s links for project %r: discarding no candidatesithashesisdiscarding no candidatessdiscarding {} non-matches: {}s cs@s|]}t|jVqdS(N(R{Rm(t.0t candidate((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys ssPChecked %s links for project %r against %s hashes (%s matches, %s no digest): %s( RjRkRBtlistRmthas_hashtis_hash_allowedtappendRRt digest_count( t candidatesRRtmatches_or_no_digestt non_matchest match_countRRmtfilteredtdiscard_message((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytfilter_unallowed_hashessF             tCandidatePreferencescB@seZdZeedZRS(sk Encapsulates some of the preferences for filtering and sorting InstallationCandidate objects. cC@s||_||_dS(sR :param allow_all_prereleases: Whether to allow all pre-releases. N(tallow_all_prereleasest prefer_binary(RRRR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyROs (RSRTRRJRO(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyRstCandidateEvaluatorcB@sbeZdZedeedddZeeddZdZdZ dZ dZ RS(sm Responsible for filtering and sorting candidates for installation based on what tags are valid. c C@sj|dkrt}n|dkr3tj}n|j}|d|d|d|d|d|d|S(s@Create a CandidateEvaluator object. :param target_python: The target Python interpreter to use when checking compatibility. If None (the default), a TargetPython object will be constructed from the running Python. :param hashes: An optional collection of allowed hashes. RRt specifierRRRN(RCRRt SpecifierSetR(tclsRRRRRRR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytcreate"s    cC@s:||_||_||_||_||_||_dS(s :param supported_tags: The PEP 425 tags supported by the target Python in order of preference (most preferred first). N(t_allow_all_prereleasest_hashest_prefer_binaryt _project_namet _specifiert_supported_tags(RRRRRRRR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyRODs      cC@s|jp d}|j}d|jd|Dd|D}g|D]!}t|j|krH|^qH}td|d|jd|jS(sM Return the applicable candidates from a list of candidates. cS@sh|]}t|qS((R{(Rtv((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys es cs@s|]}t|jVqdS(N(R{R(Rtc((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys mst prereleasesRRRN( RRCRtfilterR{RRRR(RRRtallow_prereleasesRtversionsRtapplicable_candidates((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytget_applicable_candidatesYs    . cC@s%|j|}t|d|d|S(s Create and return a `FoundCandidates` instance. :param specifier: An optional object implementing `filter` (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable versions. Rt evaluator(RR6(RRRR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytmake_found_candidates}s c C@s'|j}t|}t}d}|j}|jrt|j}|j|sjtd|jn|j r|d}n|j | }|j dk rt jd|j } | j} t| d| df}qn| }t|j|j} dt|j} | | ||j||fS(s) Function to pass as the `key` argument to a call to sorted() to sort InstallationCandidates by preference. Returns a tuple such that tuples sorting as greater using Python's default comparison operator are more preferred. The preference is as follows: First and foremost, candidates with allowed (matching) hashes are always preferred over candidates without matching hashes. This is because e.g. if the only candidate with an allowed hash is yanked, we still want to use that candidate. Second, excepting hash considerations, candidates that have been yanked (in the sense of PEP 592) are always less preferred than candidates that haven't been yanked. Then: If not finding wheels, they are sorted by version only. If finding wheels, then the sort order is by version, then: 1. existing installs 2. wheels ordered via Wheel.support_index_min(self._supported_tags) 3. source archives If prefer_binary was set, then all wheels are sorted above sources. Note: it was considered to embed this logic into the Link comparison operators, but then different sdist links with the same version, would have to be considered equal isB%s is not a supported wheel for this platform. It can't be sorted.is ^(\d+)(.*)$iN(RRBttupleRmtis_wheelR RGRRRtsupport_index_mint build_tagRCRRtgroupstintRRRR( RRRt valid_tagst support_numRtbinary_preferenceRmRtpriRtbuild_tag_groupsthas_allowed_hasht yank_value((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt _sort_keys.         cC@sl|s dSt|d|j}|j}|jrh|jp=d}djd|d|}tj|n|S(sy Return the best candidate per the instance's sort order, or None if no candidate is acceptable. tkeys uqThe candidate selected for download or install is a yanked version: {candidate} Reason for being yanked: {reason}RRnN( RCtmaxRRmRRRRjtwarning(RRRtbest_candidateRmRntmsg((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytget_best_candidates    N( RSRTRt classmethodRCRJRRORRRR(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyRs  $            c C@stjt|}|j|j|jf}|djddd}xg|jD]Y}||dkr|ddkrqTnytj t |dt j s|ddkr|dn|djd}tjt |dt j r|dn|djd}WnQtk r_|drr|dj|djkrr|ddkrrqTqrnX||krrqTn|d|dkr|ddkr|ddk rqTntSW|jd|j|jtS( Nit+iiR9tutf8isThe 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'.(R^RuR{REthostnametporttrsplitR Rt ip_addresst isinstanceRt text_typeRCtdecodet ip_networkt ValueErrorR@RIRRJ( RRRjtlocationtparsedtorigintprotocolR taddrtnetwork((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_validate_secure_origins>        c C@sRt|}|jj|}td|d|d|d|jd|jd|jS(NRRRRRR(RRtget_allowed_formatsRRRR(RRRRR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytmake_link_evaluator,s   c C@s|j}|j|}|j|\}}|j|jdt\}}dtj||D}gtjd|Dd|DD]} |jt| r| ^q} tj dt | |x| D]} tj d| qW|j |} |j | d|jD} g}x\|j | |D]H}tj d|jt$|j|j | |jWd QXq3W|j | |}|r|jd ttj d d jg|D]}t|jj^qn|| |S( sFind all available InstallationCandidate for project_name This checks index_urls and find_links. All versions found are returned as an InstallationCandidate list. See LinkEvaluator.evaluate_link() for details on which files are accepted. Rcs@s|]}t|VqdS(N(R(RRD((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys Kscs@s|]}t|VqdS(N(R(RRD((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys Tscs@s|]}t|VqdS(N(R(RRD((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys Uss,%d location(s) to search for versions of %s:s* %scs@s|]}t|dVqdS(s-fN(R(RRD((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys dssAnalyzing links from page %sNtreversesLocal files found: %ss, (Rtget_index_urls_locationsRRRIt itertoolstchainR-RjRkRBR/t_package_versionst _get_pagesRDRtextendt iter_linkstsortRR Rm(RRRRtindex_locationstindex_file_loct index_url_loct fl_file_loct fl_url_loctfile_locationsRmt url_locationsR'tlink_evaluatortfind_links_versionst page_versionstpaget file_versionsR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytfind_all_candidates:sD       #)c C@s@|j}tjd|d|jd|jd|jd|d|S(s3Create a CandidateEvaluator object to use. RRRRRR(RRRRRR(RRRRRR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytmake_candidate_evaluator}s     cC@s:|j|}|jd|d|d|}|j|S(sFind matches for the given project and specifier. :param specifier: An optional object implementing `filter` (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable versions. :return: A `FoundCandidates` instance. RRR(RERFR(RRRRRRtcandidate_evaluator((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytfind_candidatess   c C@s|jdt}|j|jd|jd|}|j}d }|jd k rit|jj }nd}|d kr|d krt j d|||j t d|nt}|r|d ks|j |krt}n| r2|d k r2|rt jd|nt jd||j d S|r`t jd |||jtnt jd |j ||j|jS( sTry to find a Link matching req Expects req, an InstallRequirement and upgrade, a boolean Returns a Link if found, Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise ttrust_internetRRcS@s)djtd|Ddtp(dS(Ns, cS@sh|]}t|jqS((R{R(RR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pys s Rtnone(Rtsortedt parse_version(t cand_iter((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_format_versionss  sNCould not find a version that satisfies the requirement %s (from versions: %s)s%No matching distribution found for %ssLExisting installed version (%s) is most up-to-date and satisfies requirementsUExisting installed version (%s) satisfies requirement (most up-to-date version is %s)s=Installed version (%s) is most up-to-date (past versions: %s)s)Using version %s (newest of versions: %s)N(RRJRHRRRRCt satisfied_byRLRRjtcriticalRRRIRkRRRm( RRtreqtupgradeRRRtinstalled_versionRNtbest_installed((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytfind_requirementsR       cc@sit}xY|D]Q}||kr(qn|j|t|d|j}|dkr\qn|VqWdS(sp Yields (page, page_url) from the given locations, skipping locations that have errors. RbN(RtaddRRbRC(RRRRtseenR'RC((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR5s     cC@sqgg}}t}xP|D]H}||kr|j||jrU|j|qe|j|qqW||S(s Returns elements of links in order, non-egg links first, egg links second, while eliminating duplicates (RRVRR(RRtlinksteggstno_eggsRWRm((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt _sort_linkss      cC@s9||jkr5tjd|||jj|ndS(NuSkipping link: %s: %s(RRjRkRV(RRRmRn((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_log_skipped_linkscC@s]|j|\}}|s;|r7|j|d|ndStd|jd|dt|S(s If the link is a candidate for install, convert it to an InstallationCandidate and return it. Otherwise, return None. RntprojectRmRN(RR\RCRRR{(RRR@Rmt is_candidatetresult((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pytget_install_candidate$s cC@sRg}xE|j|D]4}|j||}|dk r|j|qqW|S(N(R[R`RCR(RRR@RXR_RmR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR48s  N(RSRTRRCRORRtpropertyRRRRRR t staticmethodRJRR-R/RERFRHRUR5R[R\R`R4(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR7s< &&   9 J  F   O   cC@sexFt|D]8\}}|dkr+q nt|| |kr |Sq Wtdj||dS(sFind the separator's index based on the package's canonical name. :param fragment: A + filename "fragment" (stem) or egg fragment. :param canonical_name: The package's canonical name. This function is needed since the canonicalized name does not necessarily have the same length as the egg info's name part. An example:: >>> fragment = 'foo__bar-1.0' >>> canonical_name = 'foo-bar' >>> _find_name_version_sep(fragment, canonical_name) 8 t-s{} does not match {}N(t enumerateRR&R(RfRtiR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_find_name_version_sepBs  cC@sDyt||d}Wntk r+dSX||}|s@dS|S(sParse the version string from a + filename "fragment" (stem) or egg fragment. :param fragment: The string to parse. E.g. foo-2.1 :param canonical_name: The canonicalized name of the package this belongs to. iN(RfR&RC(RfRt version_startR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR]s   cC@s=x6|jdD]%}|jd}|dk r|SqW|S(sDetermine the HTML document's base URL. This looks for a ```` tag in the HTML document. If present, its href attribute denotes the base URL of anchor tags in the document. If there is no such tag (or if it does not have a valid href attribute), the HTML file's URL is used as the base URL. :param document: An HTML document representation. The current implementation expects the result of ``html5lib.parse()``. :param page_url: The URL of the HTML document. s.//basethrefN(tfindallRWRC(tdocumenttpage_urltbaseRh((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_determine_base_urlps  cC@sF|rBd|krBtj|d\}}d|krB|dSndS(sBDetermine if we have any encoding information in our headers. s Content-TypetcharsetN(tcgit parse_headerRC(RVRPtparams((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_get_encoding_from_headerss   cC@svtj|}|jdkr<tjtj|j}n!tjtj|jdd}tj |j d|S(sMakes sure a link is fully encoded. That is, if a ' ' shows up in the link, it will be rewritten to %20 (while not over-quoting % or other characters).RUtsafes/@Rd( R^RuRcRxt pathname2urlRyRdtquotetunquotet urlunparset_replace(RDR_Rd((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt _clean_links !cC@s|jd}|sdSttj||}|jd}|rRt|nd}|jd}|r|t|}nt|d|d|d|}|S(sJ Convert an anchor element in a simple repository page to a Link. Rhsdata-requires-pythons data-yankedt comes_fromRRN(RWRCRyR^RzRR(tanchorRktbase_urlRhRDt pyrequireRRm((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt_create_link_from_elements  RcB@s,eZdZddZdZdZRS(s'Represents one page, along with its URLcC@s||_||_||_dS(N(RRDRV(RRRRDRV((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyROs  cC@s t|jS(N(RRD(RR((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyt__str__scc@stj|jdt|jdt}t||j}xI|jdD]8}t |d|jd|}|dkr|qIn|VqIWdS(sYields all links in the pagettransport_encodingtnamespaceHTMLElementss.//aRkR|N( RRRRrRVRJRmRDRiR~RC(RRRjR|R{Rm((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyR7s     N(RSRTRRCRORR7(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyRs  (Rt __future__RRoR2tloggingR RvRt pip._vendorRRRtpip._vendor.distlib.compatRtpip._vendor.packagingRtpip._vendor.packaging.utilsRtpip._vendor.packaging.versionRRLtpip._vendor.requests.exceptionsRR R tpip._vendor.six.moves.urllibR^R Rxtpip._internal.downloadR R tpip._internal.exceptionsRRRRtpip._internal.models.candidateRt#pip._internal.models.format_controlRtpip._internal.models.linkRt$pip._internal.models.selection_prefsRt"pip._internal.models.target_pythonRtpip._internal.utils.compatRtpip._internal.utils.loggingRtpip._internal.utils.miscRRRRRtpip._internal.utils.packagingRtpip._internal.utils.typingRtpip._internal.wheelR R!ttypingR"R#R$R%R&R'R(R)R*R+R,R-R.txml.etree.ElementTreetxmlR/tpip._vendor.requestsR0t!pip._internal.models.search_scopeR1tpip._internal.reqR2R3tpip._internal.pep425tagsR4tpip._internal.utils.hashesR5tBuildTagRtCandidateSortingKeytetreet ElementTreetElementt HTMLElementR{t SecureOrigint__all__RCR t getLoggerRSRjRFRLt ExceptionRMRZR[RhRlRpRRJRtobjectRRRRR6R7RfRRmRrRyR~R(((s2/tmp/pip-install-vZZv26/pip/pip/_internal/index.pyts      "(X           6  9 ( K-+