????

Your IP : 216.73.216.152


Current Path : /proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_internal/
Upload File :
Current File : //proc/self/root/proc/self/root/lib/python2.7/site-packages/pip/_internal/index.pyc

�
}�\]c@@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddlmZddlmZdd	lmZmZmZddlmZdd
lmZddlmZm 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&fgZhejiej�Zkd,�Zld-�Zmd.enfd/��YZod0�Zpd1enfd2��YZqd3�Zrd4�Zsegd5�Ztegd6�Zuevd7�Zwd8exfd9��YZyd:�Zzd;exfd<��YZ{d=exfd>��YZ|d#exfd?��YZ}d$exfd@��YZ~dA�ZdB�Z�dC�Z�dD�Z�dE�Z�dF�Z�dGexfdH��YZ�dS(Is!Routines related to PyPI, indexesi(tabsolute_importN(thtml5libtrequeststsix(tunescape(t
specifiers(tcanonicalize_name(tparse(t	HTTPErrort
RetryErrortSSLError(trequest(tis_urlturl_to_path(tBestVersionAlreadyInstalledtDistributionNotFoundtInvalidWheelFilenametUnsupportedWheel(tInstallationCandidate(t
FormatControl(tLink(tSelectionPreferences(tTargetPython(t	ipaddress(t
indent_log(tARCHIVE_EXTENSIONStSUPPORTED_EXTENSIONStWHEEL_EXTENSIONtpath_to_urltredact_password_from_url(tcheck_requires_python(tMYPY_CHECK_RUNNING(tWheel(tLogger(
tAnytCallablet	FrozenSettIterabletIteratortListtMutableMappingtOptionaltSequencetSettTexttTupletUnion(t_BaseVersion(tResponse(tSearchScope(tInstallRequirement(t
PipSession(t	Pep425Tag(tHashes.RtFoundCandidatest
PackageFinderthttpst*t	localhosts127.0.0.0/8s::1/128tfiletsshcC@sWddlm}x@|jD]5}|j�j|�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-ewDPok/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-ewDPok/pip/pip/_internal/index.pyt_is_url_like_archive_s

t_NotHTMLcB@seZd�ZRS(cC@s/tt|�j||�||_||_dS(N(tsuperRMt__init__tcontent_typetrequest_desc(tselfRPRQ((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyROks	(t__name__t
__module__RO(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyRMjscC@sF|jjdd�}|j�jd�sBt||jj��ndS(s�Check 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@RARMRtmethod(tresponseRP((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_ensure_html_headerrst_NotHTTPcB@seZRS((RSRT(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR[}scC@sitj|�\}}}}}|ddhkr<t��n|j|dt�}|j�t|�dS(s�Send 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-ewDPok/pip/pip/_internal/index.pyt_ensure_html_response�s
cC@spt|�rt|d|�ntjdt|��|j|didd6dd6�}|j�t|�|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-ewDPok/pip/pip/_internal/index.pyt_get_html_response�s


cC@s,|dkrtj}n|d||�dS(Ns%Could not fetch URL %s: %s - skipping(RCRjRk(tlinktreasontmeth((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_handle_get_page_fail�sc
C@s-|dkrtd��n|jjdd�d}t|�}|r]tjd||�dStj|�\}}}}}}|dkr�t	j
jtj
|��r�|jd�s�|d7}ntj|d�}tjd	|�nyt|d
|�}Wntk
rtjd|�n
tk
rM}tjd||j|j�n�tk
rl}t||�n�tk
r�}t||�n�tk
r�}d
}	|	t|�7}	t||	dtj�n`tjk
r�}t|d|�n:tjk
rt|d�nXt|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-ewDPok/pip/pip/_internal/index.pyt_get_html_page�sL!'


cC@s�yt|jd|�}Wn*tjk
rEtjd|j|�n^X|s�djtt|��}|s�tjd||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(RmR�tignore_requires_pythont
is_compatibletversion((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_check_link_requires_pythons$t
LinkEvaluatorcB@s2eZdZejd�Zdd�Zd�ZRS(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(RRR�tcanonical_nametformatst
target_pythontallow_yankedR�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyRO=s						cC@s�d}|jr;|jr;|jp%d}tdj|�fS|jrY|j}|j}nT|j�\}}|s{tdfS|t	kr�td|fSd|j
kr�|tkr�d|j}t|fSd|j
kr�|dkr�td	fS|tkr�yt|j�}Wntk
r%td
fSXt|j�|jkrUd|j}t|fS|jj�}|j|�s�|j�}djd
j|��}t|fS|j}nd|j
kr�|tkr�td|jfS|s�t||j�}n|std|jfS|jj|�}	|	ra||	j� }|	jd�}
|
|jjkratdfSnt |d|jj!d|j"�}|s�tdfSt#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<none given>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 incorrectR�R�sFound link %s, version: %sN(&RCt	is_yankedR�t
yanked_reasonRJtformattegg_fragmenttexttsplitextRR�RR�RdR RGRRtnameR�R�tget_tagst	supportedtget_formatted_file_tagsR�R�t_extract_version_from_fragmentt_py_version_retsearchtstarttgroupt
py_versionR�tpy_version_infoR�RjRkRI(RRRmR�Rntegg_infoR�twheeltsupported_tagst	file_tagstmatchR�tsupports_python((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt
evaluate_linkcsh
		









N(	RSRTt__doc__tretcompileR�RCROR�(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�1s
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|�kr�d}	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|j�VqdS(N(R{Rm(t.0t	candidate((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<genexpr>�ssPChecked %s links for project %r against %s hashes (%s matches, %s no digest): %s(RjRkRBtlistRmthas_hashtis_hash_allowedtappendR�R�tdigest_count(
t
candidatesR�R�tmatches_or_no_digesttnon_matchestmatch_countR�Rmtfilteredtdiscard_message((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytfilter_unallowed_hashes�sF	

		

				
tCandidatePreferencescB@seZdZeed�ZRS(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(RRR�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyROs		(RSRTR�RJRO(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�stCandidateEvaluatorcB@sbeZdZedeeddd��Zeedd�Zd�Zd�Z	d�Z
d�ZRS(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.
        R�R�t	specifierR�R�R�N(RCRRtSpecifierSetR�(tclsR�R�R�R�R�R�R�((s2/tmp/pip-install-ewDPok/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(RRR�R�R�R�R�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyRODs					cC@s�|jpd}|j}d�|jd�|D�d|�D�}g|D]!}t|j�|krH|^qH}td|d|jd|j�S(sM
        Return the applicable candidates from a list of candidates.
        cS@sh|]}t|��qS((R{(R�tv((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<setcomp>es	cs@s|]}t|j�VqdS(N(R{R�(R�tc((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<genexpr>mstprereleasesR�R�R�N(	R�RCR�tfilterR{R�R�R�R�(RRR�tallow_prereleasesR�tversionsR�tapplicable_candidates((s2/tmp/pip-install-ewDPok/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.
        R�t	evaluator(R�R6(RRR�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytmake_found_candidates}s
c
C@s'|j}t|�}t�}d}|j}|jr�t|j�}|j|�sjtd|j��n|j	r|d}n|j
|�}|jdk	r�t
jd|j�}	|	j�}
t|
d�|
df}q�n|}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+)(.*)$i����N(R�RBttupleRmtis_wheelR RGR�RR�tsupport_index_mint	build_tagRCR�R�tgroupstintR�R�R�R�(
RRR�t
valid_tagstsupport_numR�tbinary_preferenceRmR�tpriR�tbuild_tag_groupsthas_allowed_hasht
yank_value((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt	_sort_key�s.						 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<none given>uqThe candidate selected for download or install is a yanked version: {candidate}
Reason for being yanked: {reason}R�RnN(	RCtmaxR�RmR�R�R�Rjtwarning(RRR�tbest_candidateRmRntmsg((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytget_best_candidate�s				N(RSRTR�tclassmethodRCRJR�ROR�R�R�R�(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�s	$		<cB@s2eZdZd�Zd�Zd�Zd�ZRS(s�A collection of candidates, returned by `PackageFinder.find_candidates`.

    This class is only intended to be instantiated by CandidateEvaluator's
    `make_found_candidates()` method.
    cC@s||_||_||_dS(s
        :param candidates: A sequence of all available candidates found.
        :param applicable_candidates: The applicable candidates.
        :param evaluator: A CandidateEvaluator object to sort applicable
            candidates by order of preference.
        N(t_applicable_candidatest_candidatest
_evaluator(RRR�R�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyRO�s
		cC@s
t|j�S(s(Iterate through all candidates.
        (titerR�(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytiter_allscC@s
t|j�S(s3Iterate through the applicable candidates.
        (R�R�(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytiter_applicable
scC@s"t|j��}|jj|�S(sdReturn the best candidate available, or None if no applicable
        candidates are found.
        (R�R�R�R�(RRR�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytget_bests(RSRTR�ROR�R�R�(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR6�s
			cB@seZdZddddd�Zedddd��Zed��Zed��Z	ed��Z
d�Zdd�Zd�Z
eed	��Zd
�Zd�Zd�Zddd
�Zddd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s�This finds packages.

    This is meant to match easy_install's technique for looking for
    packages, by reading pages and looking for appropriate links.
    c		C@s�|dkrg}n|dkr-t�}n|pEtt�t��}||_||_||_||_||_||_	||_
||_t�|_dS(s�
        This constructor is primarily meant to be used by the create() class
        method and from tests.

        :param session: The Session to use to make requests.
        :param format_control: A FormatControl object, used to control
            the selection of source packages / binary packages when consulting
            the index and links.
        :param candidate_prefs: Options to use when creating a
            CandidateEvaluator object.
        N(
RCR�RtsetR�t_candidate_prefsR�R�tsearch_scopeRbtformat_controlt
trusted_hostst
_logged_links(	RRR�RbR�R�R�R�tcandidate_prefsR�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyRO s									cC@s�|dkrtd��n|dkr3t�}ntd|jd|j�}|d|d|d|d|d|jd	|jd
|d|j�S(
sCreate a PackageFinder.

        :param selection_prefs: The candidate selection preferences, as a
            SelectionPreferences object.
        :param trusted_hosts: Domains not to emit warnings for when not using
            HTTPS.
        :param session: The Session to use to make requests.
        :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.
        sEPackageFinder.create() missing 1 required keyword argument: 'session'R�R�RR�RbR�R�R�R�R�N(	RCRsRR�R�R�R�R�R�(R�R�tselection_prefsR�RbR�R((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�Os"			cC@s
|jjS(N(R�t
find_links(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR|scC@s
|jjS(N(R�t
index_urls(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�scC@s
|jjS(N(R�R�(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR��scC@st|j_dS(N(RIR�R�(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytset_allow_all_prereleases�scC@sudj|�}|dk	r1|dj|�7}ntj|�|jj|�||jkradS|jj|�dS(st
        :param source: An optional source string, for logging where the host
            string came from.
        sadding trusted host: {!r}s
 (from {})N(R�RCRjR|Rbtadd_insecure_hostR�R�(RRthostR�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytadd_trusted_host�s
cc@s<xtD]}|VqWx|jD]}d|dfVq WdS(NR9(tSECURE_ORIGINSR�(RRt
secure_originR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytiter_secure_origins�s
	c@sng�g���fd�}xC|D];}tjj|�}|jd�}|sX|r4|rg|}nt|�}tjj|�r|r�tjj|�}x_tj|�D]}|tjj||��q�Wq1|r��j	|�q1t
jdj|��q`tjj
|�r!||�q`t
jd|�q%t|�rP�j	|�q%t
jd|�q%W��fS(st
        Sort locations into "files" (archives) and "urls", and return
        a pair of lists (files,urls)
        c@sLt|�}tj|dt�ddkr;�j|�n
�j|�dS(Ntstrictis	text/html(Rt	mimetypest
guess_typeRJR�(RdRD(tfilesturls(s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt	sort_path�ssfile:s)Path '{0}' is ignored: it is a directory.s:Url '%s' is ignored: it is neither a file nor a directory.sQUrl '%s' is ignored. It is either a non-existing path or lacks a specific scheme.(RvRdtexistsRAR
RwtrealpathtlistdirR�R�RjR�R�tisfileR(t	locationst
expand_dirRRDt
is_local_pathtis_file_urlRdtitem((RRs2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_sort_locations�s>
	 


c	C@s�tjt|��}|j|j|jf}|djdd�d}xg|j�D]Y}||dkr�|ddkr�qTny�tj	t
|dtj�s�|ddkr�|dn|djd��}tjt
|dtj�r�|dn|djd��}WnQtk
r_|drr|dj�|dj�krr|ddkrrqTqrnX||krrqTn|d|dkr�|ddkr�|ddk	r�qTntSW|jd|j|j�tS(	Nit+ii����R9tutf8is�The 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{REthostnametporttrsplitRRt
ip_addresst
isinstanceRt	text_typeRCtdecodet
ip_networkt
ValueErrorR@RIR�RJ(	RRRjtlocationtparsedtorigintprotocolR
taddrtnetwork((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_validate_secure_origin�s>  

 

c
C@sRt|�}|jj|�}td|d|d|d|jd|jd|j�S(NR�R�R�R�R�R�(RR�tget_allowed_formatsR�R�R�R�(RRR�R�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytmake_link_evaluator,s		c	C@s�|j}|j|�}|j|�\}}|j|jdt�\}}d�tj||�D�}gtjd�|D�d�|D��D]}	|jt|	�r�|	^q�}
tj	dt
|
�|�x|
D]}tj	d|�q�W|j|�}|j|d�|jD��}
g}x\|j
|
|�D]H}tj	d|j�t��$|j|j||j���Wd	QXq3W|j||�}|r�|jd
t�tj	ddjg|D]}t|jj�^q���n||
|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(R�RD((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<genexpr>Kscs@s|]}t|�VqdS(N(R(R�RD((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<genexpr>Tscs@s|]}t|�VqdS(N(R(R�RD((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<genexpr>Uss,%d location(s) to search for versions of %s:s* %scs@s|]}t|d�VqdS(s-fN(R(R�RD((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<genexpr>dssAnalyzing links from page %sNtreversesLocal files found: %ss, (R�tget_index_urls_locationsRRRIt	itertoolstchainR-RjRkRBR/t_package_versionst
_get_pagesRDRtextendt
iter_linkstsortR�R
Rm(RRR�R�tindex_locationstindex_file_loct
index_url_loctfl_file_loct
fl_url_loctfile_locationsRmt
url_locationsR'tlink_evaluatortfind_links_versionst
page_versionstpaget
file_versionsR�((s2/tmp/pip-install-ewDPok/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.
        R�R�R�R�R�R�(R�R�R�R�R�R�(RRR�R�R�R((s2/tmp/pip-install-ewDPok/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.
        R�R�R�(RERFR�(RRR�R�R�R�tcandidate_evaluator((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytfind_candidates�s		c		C@s�|jdt�}|j|jd|jd|�}|j�}d}|jdk	rit|jj	�}nd�}|dkr�|dkr�t
jd|||j���t
d|��nt}|r�|dks�|j	|kr�t}n|r2|dk	r2|rt
jd|�nt
jd||j	�dS|r`t
jd	|||j���t�nt
jd
|j	||j���|jS(s�Try 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_internetR�R�cS@s)djtd�|D�dt��p(dS(Ns, cS@sh|]}t|j��qS((R{R�(R�R�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pys	<setcomp>�s	R�tnone(R�tsortedt
parse_version(t	cand_iter((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_format_versions�s	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(R�RJRHR�R�R�RCtsatisfied_byRLR�RjtcriticalR�RRIRkR�RRm(	RRtreqtupgradeR�R�R�tinstalled_versionRNtbest_installed((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pytfind_requirement�sR	
	

	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(R�taddR�RbRC(RRRR�tseenR'RC((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR5�s	

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
        (R�RVR�R�(RRtlinksteggstno_eggsRWRm((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_sort_linkss
	

	cC@s9||jkr5tjd||�|jj|�ndS(NuSkipping link: %s: %s(RRjRkRV(RRRmRn((s2/tmp/pip-install-ewDPok/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.
        RntprojectRmR�N(R�R\RCRR�R{(RRR@Rmtis_candidatetresult((s2/tmp/pip-install-ewDPok/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-ewDPok/pip/pip/_internal/index.pyR48sN(RSRTR�RCROR�R�tpropertyRRR�RRRtstaticmethodRJRR-R/RERFRHRUR5R[R\R`R4(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR7s<&&		9	J		F	O				cC@sexFt|�D]8\}}|dkr+q
nt|| �|kr
|Sq
Wtdj||���dS(s�Find the separator's index based on the package's canonical name.

    :param fragment: A <package>+<version> 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�(RfR�tiR�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_find_name_version_sepBscC@sDyt||�d}Wntk
r+dSX||}|s@dS|S(s�Parse the version string from a <package>+<version> 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(RfR�t
version_startR�((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�]s	

cC@s=x6|jd�D]%}|jd�}|dk	r|SqW|S(s�Determine the HTML document's base URL.

    This looks for a ``<base>`` 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-ewDPok/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-ewDPok/pip/pip/_internal/index.pyt_get_encoding_from_headers�s
cC@svtj|�}|jdkr<tjtj|j��}n!tjtj|j�dd�}tj	|j
d|��S(s�Makes 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-ewDPok/pip/pip/_internal/index.pyt_clean_link�s	!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-pythonsdata-yankedt
comes_fromR�R�N(RWRCRyR^RzRR(tanchorRktbase_urlRhRDt	pyrequireR�Rm((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt_create_link_from_element�s		RcB@s,eZdZdd�Zd�Zd�ZRS(s'Represents one page, along with its URLcC@s||_||_||_dS(N(R�RDRV(RRR�RDRV((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyRO�s		cC@s
t|j�S(N(RRD(RR((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt__str__�scc@s�tj|jdt|j�dt�}t||j�}xI|jd�D]8}t	|d|jd|�}|dkr|qIn|VqIWdS(sYields all links in the pagettransport_encodingtnamespaceHTMLElementss.//aRkR|N(RRR�RrRVRJRmRDRiR~RC(RRRjR|R{Rm((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR7�s				N(RSRTR�RCRORR7(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyR�s	(�R�t
__future__RRoR2tloggingR
RvR�tpip._vendorRRRtpip._vendor.distlib.compatRtpip._vendor.packagingRtpip._vendor.packaging.utilsRtpip._vendor.packaging.versionRRLtpip._vendor.requests.exceptionsRR	R
tpip._vendor.six.moves.urllibR^RRxtpip._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.hashesR5tBuildTagR�tCandidateSortingKeytetreetElementTreetElementtHTMLElementR{tSecureOrigint__all__RCR	t	getLoggerRSRjRFRLt	ExceptionRMRZR[RhRlRpR�RJR�tobjectR�R�R�R�R6R7RfR�RmRrRyR~R(((s2/tmp/pip-install-ewDPok/pip/pip/_internal/index.pyt<module>s�"(X 	
				69(�	K�-��+