Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyo

ó
“tÆ_c@s_ddlZddlZddlmZddlmZmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZddlmZmZdd	lmZdd
lmZddlmZmZddlmZdd
lmZddlm Z m!Z!er­ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ddl	m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddlm0Z0ddl1m2Z2e(d&Z3nej4e5ƒZ6d„Z7d„Z8d„Z9de fd„ƒYZ:de:fd„ƒYZ;de:fd „ƒYZ<de fd!„ƒYZ=d"e fd#„ƒYZ>d$e fd%„ƒYZ?dS('iÿÿÿÿN(tsuppress(tInvalidSpecifiertSpecifierSet(tcanonicalize_name(tVersion(t	HashErrortMetadataInconsistent(tHTTPRangeRequestUnsupportedtdist_from_wheel_url(tinstall_req_from_editabletinstall_req_from_line(tInstallRequirement(t
indent_log(tdist_is_editabletnormalize_version_info(tget_requires_python(tMYPY_CHECK_RUNNINGi(t	Candidatetformat_name(tAnyt	FrozenSettIterabletOptionaltTupletUnion(t_BaseVersion(tDistribution(tAbstractDistribution(tLink(tRequirement(tFactorytAlreadyInstalledCandidatetEditableCandidatet
LinkCandidatecCsš|jrt|jƒ}n	|j}t|d|jd|jd|jd|jd|jdt	d|j
d|jd	|jƒƒ}|j
|_
||_|S(
Nt
user_suppliedt
comes_fromt
use_pep517tisolatedt
constrainttoptionstinstall_optionstglobal_optionsthashes(treqtstrturlR
R"R#R$R%R&tdictR(R)thash_optionst
original_linktlink(R1ttemplatetlinetireq((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pytmake_install_req_from_link0s"										cCs^t|jd|jd|jd|jd|jd|jdtd|jd|j	d	|j
ƒƒS(
NR"R#R$R%R&R'R(R)R*(R	R-R"R#R$R%R&R.R(R)R/(R1R2((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pytmake_install_req_from_editableIs								cCsÍt|jƒ}|jr*t|jƒ}n9|jrNdj||jjƒ}ndj||jƒ}t|d|j	d|j
d|jd|jd|j
dtd	|jd
|jd|jƒƒ}||_|S(Ns{} @ {}s{}=={}R"R#R$R%R&R'R(R)R*(Rtproject_nameR+R,R1tformatR-tparsed_versionR
R"R#R$R%R&R.R(R)R/tsatisfied_by(tdistR2R7R3R4((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pytmake_install_req_from_dist[s&										t"_InstallRequirementBackedCandidatecBsËeZdZeZddd„Zd„Zd„Zd„Z	d„Z
ed„ƒZed„ƒZ
ed„ƒZd	„Zd
„Zd„Zd„Zd
„Zed„ƒZd„Zd„Zd„ZRS(s÷A candidate backed by an ``InstallRequirement``.

    This represents a package request with the target not being already
    in the environment, and needs to be fetched and installed. The backing
    ``InstallRequirement`` is responsible for most of the leg work; this
    class exposes appropriate information to the resolver.

    :param link: The link passed to the ``InstallRequirement``. The backing
        ``InstallRequirement`` will use this link to fetch the distribution.
    :param source_link: The link this candidate "originates" from. This is
        different from ``link`` when the link is found in the wheel cache.
        ``link`` would point to the wheel cache, while this points to the
        found remote link (e.g. from pypi.org).
    cCsL||_||_||_||_||_||_d|_t|_	dS(N(
t_linkt_source_linkt_factoryt_ireqt_namet_versiontNonet_disttFalset	_prepared(tselfR1tsource_linkR4tfactorytnametversion((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt__init__†s
							cCs%djd|jjdt|jƒƒS(Ns{class_name}({link!r})t
class_nameR1(R8t	__class__t__name__R,R>(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt__repr__™s	cCst|j|jfƒS(N(thashROR>(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt__hash__ scCs&t||jƒr"|j|jkStS(N(t
isinstanceROR>RF(RHtother((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt__eq__¤scCs|j|ƒS(N(RV(RHRU((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt__ne__«scCs|jS(N(R?(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRI¯scCs.|jdkr't|jjƒ|_n|jS(s:The normalised name of the project the candidate refers toN(RBRDRR;R7(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRK´scCs(|jdkr!|jj|_n|jS(N(RCRDR;R9(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRL¼scCs4dj|j|j|jjr*|jjn|jƒS(Ns{} {} (from {})(R8RKRLR>tis_filet	file_path(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pytformat_for_errorÃscCstdƒ‚dS(NsOverride in subclass(tNotImplementedError(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt_prepare_abstract_distributionËscCs—|j}t|jƒ}|jdk	rQ|j|krQt|jd|jƒ‚n|j}|jdk	r“|j|kr“t|jd|j	ƒ‚ndS(s:Check for consistency of project name and version of dist.RKRLN(
RERR7RBRDRRAR9RCRL(RHR;RKRL((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt_check_metadata_consistencyÏs		cCsh|jr
dSy|jƒ}Wn"tk
rA}|j|_‚nX|jƒ|_|jƒt|_dS(N(	RGR\RRAR+tget_pkg_resources_distributionRER]tTrue(RHt
abstract_distte((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt_prepareÜs	
cCs|jj}|jj}|jjo.|jj}|rï|rï|jrïtjd|j	j
pb|j	ƒtƒ{tt
ƒhtjd|j|jƒ|jjjddƒd}|jj}t|j||ƒ|_|jƒWdQXWdQXn|jdkr|jƒndS(s-Fetch metadata, using lazy wheel if possible.s
Collecting %ss+Obtaining dependency information from %s %st#iiN(R@tpreparertuse_lazy_wheelR>tis_wheelRXtrequire_hashestloggertinfoRAR+RRRRBRCR-tsplitt
downloadert_sessionRRER]RDRb(RHRdRetremote_wheelR-tsession((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt_fetch_metadataës 

cCs#|jdkr|jƒn|jS(N(RERDRo(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR;s
cCsrt|jƒ}|dkrdSyt|ƒ}Wn0tk
ra}d}tj||j|ƒdSX|jj	|ƒS(Ns-Package %r has an invalid Requires-Python: %s(
RR;RDRRRhtwarningRKR@t make_requires_python_requirement(RHtrequires_pythontspecRatmessage((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt_get_requires_python_dependencysccsX|r|jjƒnd}x+|D]#}|jjt|ƒ|jƒVq"W|jƒVdS(N((R;trequiresR@tmake_requirement_from_specR,RARu(RHt
with_requiresRvtr((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pytiter_dependenciess
!cCs|jƒ|jS(N(RbRA(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pytget_install_requirements
N(RPt
__module__t__doc__RFtis_installedRDRMRQRSRVRWtpropertyRIRKRLRZR\R]RbRoR;RuRzR{(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR=us(							
			
	cBs&eZeZddd„Zd„ZRS(c	CsÀ|}|j||ƒ}|dk	rCtjd|jƒ|j}nt||ƒ}|dk	r…|jr…|j|jkr…t|_	nt
t|ƒjd|d|d|d|d|d|ƒdS(NsUsing cached wheel link: %sR1RIR4RJRKRL(
tget_wheel_cache_entryRDRhtdebugR1R5t
persistentR0R_toriginal_link_is_in_wheel_cachetsuperR!RM(	RHR1R2RJRKRLRItcache_entryR4((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRM%s"		cCs|jjj|jdtƒS(Ntparallel_builds(R@Rdtprepare_linked_requirementRAR_(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR\CsN(RPR|RFtis_editableRDRMR\(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR!"scBs&eZeZddd„Zd„ZRS(c
CsDtt|ƒjd|d|dt||ƒd|d|d|ƒdS(NR1RIR4RJRKRL(R„R RMR6(RHR1R2RJRKRL((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRMMs	cCs|jjj|jƒS(N(R@Rdtprepare_editable_requirementRA(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR\_sN(RPR|R_RˆRDRMR\(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR JscBs‰eZeZdZd„Zd„Zd„Zd„Z	d„Z
ed„ƒZed„ƒZ
ed„ƒZd„Zd	„Zd
„ZRS(cCsD||_t||ƒ|_||_d}|jj|j|ƒdS(Nsalready satisfied(R;R<RAR@Rdtprepare_installed_requirement(RHR;R2RJtskip_reason((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRMhs
		cCsdjd|jjd|jƒS(Ns{class_name}({distribution!r})RNtdistribution(R8RORPR;(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRQzs	cCst|j|j|jfƒS(N(RRRORKRL(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRSscCs8t||jƒr4|j|jko3|j|jkStS(N(RTRORKRLRF(RHRU((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRV…s"cCs|j|ƒS(N(RV(RHRU((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRWŒscCst|jjƒS(N(RR;R7(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRKscCs
|jjS(N(R;R9(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRL•scCs
t|jƒS(N(R
R;(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRˆšscCsdj|j|jƒS(Ns{} {} (Installed)(R8RKRL(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRZŸsccsE|s
dSx4|jjƒD]#}|jjt|ƒ|jƒVqWdS(N(R;RvR@RwR,RA(RHRxRy((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRz£scCsdS(N(RD(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR{ªsN(RPR|R_R~RDRIRMRQRSRVRWRRKRLRˆRZRzR{(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRds							tExtrasCandidatecBs¡eZdZd„Zd„Zd„Zd„Zd„Zed„ƒZ	ed„ƒZ
d„Zed	„ƒZed
„ƒZ
ed„ƒZd„Zd
„ZRS(síA candidate that has 'extras', indicating additional dependencies.

    Requirements can be for a project with dependencies, something like
    foo[extra].  The extras don't affect the project/version being installed
    directly, but indicate that we need additional dependencies. We model that
    by having an artificial ExtrasCandidate that wraps the "base" candidate.

    The ExtrasCandidate differs from the base in the following ways:

    1. It has a unique name, of the form foo[extra]. This causes the resolver
       to treat it as a separate node in the dependency graph.
    2. When we're getting the candidate's dependencies,
       a) We specify that we want the extra dependencies as well.
       b) We add a dependency on the base candidate.
          See below for why this is needed.
    3. We return None for the underlying InstallRequirement, as the base
       candidate will provide it, and we don't want to end up with duplicates.

    The dependency on the base candidate is needed so that the resolver can't
    decide that it should recommend foo[extra1] version 1.0 and foo[extra2]
    version 2.0. Having those candidates depend on foo=1.0 and foo=2.0
    respectively forces the resolver to recognise that this is a conflict.
    cCs||_||_dS(N(tbasetextras(RHRŽR((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRMÇs	cCs(djd|jjd|jd|jƒS(Ns.{class_name}(base={base!r}, extras={extras!r})RNRŽR(R8RORPRŽR(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRQÐs		cCst|j|jfƒS(N(RRRŽR(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRSØscCs8t||jƒr4|j|jko3|j|jkStS(N(RTRORŽRRF(RHRU((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRVÜs"cCs|j|ƒS(N(RV(RHRU((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRWãscCst|jj|jƒS(s:The normalised name of the project the candidate refers to(RRŽRKR(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRKçscCs
|jjS(N(RŽRL(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRLíscCs+dj|jjƒdjt|jƒƒƒS(Ns{} [{}]s, (R8RŽRZtjointsortedR(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRZòscCs
|jjS(N(RŽR~(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR~ùscCs
|jjS(N(RŽRˆ(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRˆþscCs
|jjS(N(RŽRI(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRIsccsæ|jj}|j|jƒV|s'dS|jj|jjjƒ}|jj|jjjƒ}x3t|ƒD]%}tj	d|jj
|j|ƒqjWxL|jjj|ƒD]5}|j
t|ƒ|jj|ƒ}|r©|Vq©q©WdS(Ns%%s %s does not provide the extra '%s'(RŽR@tmake_requirement_from_candidateRtintersectionR;t
differenceR‘RhRpRKRLRvRwR,RA(RHRxRJtvalid_extrastinvalid_extrastextraRytrequirement((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRzs"	cCsdS(N(RD(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR{%s(RPR|R}RMRQRSRVRWRRKRLRZR~RˆRIRzR{(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR¯s								tRequiresPythonCandidatecBsVeZeZdZd„Zed„ƒZed„ƒZ	d„Z
d„Zd„ZRS(cCsN|dk	rt|ƒ}n
tjd }tdjd„|Dƒƒƒ|_dS(Nit.css|]}t|ƒVqdS(N(R,(t.0tc((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pys	<genexpr>7s(RDRtsystversion_infoRRRC(RHtpy_version_infoRž((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRM1s
cCsdS(Ns<Python from Requires-Python>((RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRK=scCs|jS(N(RC(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRLCscCsdj|jƒS(Ns	Python {}(R8RL(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRZHscCsdS(N(((RHRx((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyRzLscCsdS(N(RD(RH((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR{PsN(
RPR|RFR~RDRIRMRRKRLRZRzR{(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyR™-s			(sAlreadyInstalledCandidatesEditableCandidates
LinkCandidate(@tloggingRtpip._vendor.contextlib2Rt pip._vendor.packaging.specifiersRRtpip._vendor.packaging.utilsRtpip._vendor.packaging.versionRtpip._internal.exceptionsRRt pip._internal.network.lazy_wheelRRtpip._internal.req.constructorsR	R
tpip._internal.req.req_installRtpip._internal.utils.loggingRtpip._internal.utils.miscR
Rtpip._internal.utils.packagingRtpip._internal.utils.typingRRŽRRttypingRRRRRRRtpip._vendor.pkg_resourcesRtpip._internal.distributionsRtpip._internal.models.linkRRRJRt
BaseCandidatet	getLoggerRPRhR5R6R<R=R!R RRR™(((s_/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/resolution/resolvelib/candidates.pyt<module>sH.
			­(K~
Back to Directory File Manager