Viewing File: /opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyc

ó
“tÆ_c@sTddlZddlmZddlmZddlmZejdddgƒZd	e	fd
„ƒYZ
de
fd„ƒYZd
e
fd„ƒYZde
fd„ƒYZde
fd„ƒYZdefd„ƒYZdefd„ƒYZejddƒZde
fd„ƒYZd„ZejddƒZd„Zdefd „ƒYZdS(!iÿÿÿÿNi(tcollections_abc(tAbstractResolver(t
DirectedGraphtRequirementInformationtrequirementtparenttResolverExceptioncBseZdZRS(sÆA base class for all exceptions raised by this module.

    Exceptions derived by this class should all be handled in this module. Any
    bubbling pass the resolver should be treated as a bug.
    (t__name__t
__module__t__doc__(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR
stRequirementsConflictedcBseZd„Zd„ZRS(cCs#tt|ƒj|ƒ||_dS(N(tsuperR
t__init__t	criterion(tselfR
((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRscCs)djdjd„|jjƒDƒƒƒS(NsRequirements conflict: {}s, css|]}t|ƒVqdS(N(trepr(t.0tr((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>s(tformattjoinR
titer_requirement(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt__str__s(RRRR(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR
s	tInconsistentCandidatecBseZd„Zd„ZRS(cCs/tt|ƒj||ƒ||_||_dS(N(RRRt	candidateR
(RRR
((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR!s	cCs/dj|jdjd„|jjƒDƒƒƒS(Ns+Provided candidate {!r} does not satisfy {}s, css|]}t|ƒVqdS(N(R(RR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>)s(RRRR
R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR&s(RRRR(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR s	t	CriterioncBsSeZdZd„Zd„Zed„ƒZd„Zd„Zd„Z	d„Z
RS(sQRepresentation of possible resolution results of a package.

    This holds three attributes:

    * `information` is a collection of `RequirementInformation` pairs.
      Each pair is a requirement contributing to this criterion, and the
      candidate that provides the requirement.
    * `incompatibilities` is a collection of all known not-to-work candidates
      to exclude from consideration.
    * `candidates` is a collection containing all possible candidates deducted
      from the union of contributing requirements and known incompatibilities.
      It should never be empty, except when the criterion is an attribute of a
      raised `RequirementsConflicted` (in which case it is always empty).

    .. note::
        This class is intended to be externally immutable. **Do not** mutate
        any of its attribute containers.
    cCs||_||_||_dS(N(t
candidatestinformationtincompatibilities(RRRR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRAs		cCs)djd„|jDƒƒ}dj|ƒS(Ns, css'|]\}}dj||ƒVqdS(s({!r}, via={!r})N(R(RtreqR((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>Hss
Criterion({})(RRR(Rtrequirements((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt__repr__FscCss|j|gƒ}t|tjƒs3t|ƒ}n|d|dt||ƒgdgƒ}|sot|ƒ‚n|S(s.Build an instance from a requirement.
        RRR(tfind_matchest
isinstanceRtSequencetlistRR
(tclstproviderRRRR
((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pytfrom_requirementMs	cCsd„|jDƒS(Ncss|]}|jVqdS(N(R(Rti((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>^s(R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR]scCsd„|jDƒS(Ncss|]}|jVqdS(N(R(RR&((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>as(R(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pytiter_parent`sc	Cs¨t|jƒ}|jt||ƒƒ|jg|D]\}}|^q2ƒ}t|tjƒsnt|ƒ}nt|ƒ||t|j	ƒƒ}|s¤t
|ƒ‚n|S(s>Build a new instance from this and a new requirement.
        (R"RtappendRRR RR!ttypeRR
(	RR$RRtinfosRt_RR
((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pytmerged_withcs(!cCsst|jƒ}|j|ƒg|jD]}||kr&|^q&}|sNdSt|ƒ|t|jƒ|ƒ}|S(sœBuild a new instance from this, but excluding specified candidate.

        Returns the new instance, or None if we still have no valid candidates.
        N(R"RR(RtNoneR)R(RRt	incompatstcRR
((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pytexcluded_ofps
(!(RRR	RRtclassmethodR%RR'R,R0(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR-s					
tResolutionErrorcBseZRS((RR(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR2~stResolutionImpossiblecBseZd„ZRS(cCs#tt|ƒj|ƒ||_dS(N(RR3Rtcauses(RR4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRƒs(RRR(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR3‚stResolutionTooDeepcBseZd„ZRS(cCs#tt|ƒj|ƒ||_dS(N(RR5Rtround_count(RR6((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRŠs(RRR(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR5‰stStatesmapping criteriat
ResolutioncBsneZdZd„Zed„ƒZd„Zd„Zd„Zd„Z	d„Z
d„Zd	„Zd
„Z
RS(s­Stateful resolution object.

    This is designed as a one-off object that holds information to kick start
    the resolution process, and holds the results afterwards.
    cCs||_||_g|_dS(N(t_pt_rt_states(RR$treporter((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRšs		cCs3y|jdSWntk
r.tdƒ‚nXdS(Niÿÿÿÿtstate(R;t
IndexErrortAttributeError(R((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR=Ÿs
cCs{y|jd}Wn,tk
r?tdtjƒdiƒ}n(Xtd|jjƒd|jjƒƒ}|jj|ƒdS(s‰Push a new state into history.

        This new state will be used to hold resolution results of the next
        coming round.
        iÿÿÿÿtmappingtcriteriaN(	R;R>R7tcollectionstOrderedDictR@tcopyRAR((RtbaseR=((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt_push_new_state¦s
!cCs‡|jj||ƒ|jj|ƒ}y|jj|}Wn)tk
rdtj|j||ƒ}nX|j	|j||ƒ}||fS(N(
R:tadding_requirementR9tidentifyR=RAtKeyErrorRR%R,(RRRtnametcrit((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt_merge_into_criterion¶s
cCsV|\}}y|jj|}Wntk
r9d}nX|jj||j|jƒS(N(R=R@RIR-R9tget_preferenceRR(RtitemRJR
tpinned((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt_get_criterion_item_preferenceÁs

	csLyˆjj|‰Wntk
r(tSXt‡‡fd†|jƒDƒƒS(Nc3s$|]}ˆjj|ˆƒVqdS(N(R9tis_satisfied_by(RR(tcurrent_pinR(sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>Ñs(R=R@RItFalsetallR(RRJR
((RRRsQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt_is_current_pin_satisfyingËs
cCsLi}x?|jj|ƒD]+}|j|d|ƒ\}}|||<qW|S(NR(R9tget_dependenciesRL(RRRARRJRK((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt_get_criteria_to_updateÕs
cság}xÔ|jD]ɉyˆjˆƒ}Wn&tk
rQ}|j|jƒqnXt‡‡fd†|jƒDƒƒ}|stˆ|ƒ‚nˆjj	ˆƒˆj
jj|dƒˆˆj
j|<ˆj
jj|ƒgSW|S(Nc3s$|]}ˆjj|ˆƒVqdS(N(R9RQ(RR(RR(sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>ês(RRWR
R(R
RTRRR:tpinningR=R@tpopR-RAtupdate(RRJR
R4RAtet	satisfied((RRsQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt_attempt_to_pin_criterionÜs$cCsÉ|jd=x¸t|jƒdkrÄ|jjƒ}y|jjƒ\}}Wntk
r`q
nX|jj|ƒ|jƒ|j	j
|j|ƒ}|dkr°|jd=q
n||j	j
|<t
SWtS(Niÿÿÿÿi(R;tlenRYR@tpopitemRIR:tbacktrackingRFR=RAR0R-tTrueRS(Rt
prev_stateRJRR
((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt
_backtrackýs 



cCsÏ|jrtdƒ‚n|jƒxe|D]]}y|j|ddƒ\}}Wn%tk
ru}t|jjƒ‚nX||j	j
|<q)W|jjƒx%t
|ƒD]}|jj|ƒ|jƒ|j	}g|j	j
jƒD]}	|j|	Œsà|	^qà}
|
s(|jd=|jj|ƒ|j	St|
d|jƒ\}}|j||ƒ}|r¨|jƒ}
|
s¨g|D]}|jD]}|^qqt}t|ƒ‚q¨n|jj||ƒq¤Wt|ƒ‚dS(Nsalready resolvedRiÿÿÿÿtkey(R;tRuntimeErrorRFRLR-R
R3R
RR=RAR:tstartingtrangetstarting_roundtitemsRUtendingtminRPR]Rctending_roundR5(RRt
max_roundsRRJRKR[tround_indextcurrRNtunsatisfied_criterion_itemsR
tfailure_causestresultR&R4((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pytresolves@	



	
)(RRR	RtpropertyR=RFRLRPRURWR]RcRs(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR8“s				
	
		!	"cCs­||krtS||kr tSx†||jƒD]t}y|t|ƒ}Wntk
raq1nX||kr|j|ƒtSt||||ƒr1|j|ƒtSq1WtS(N(RaRSR'tidRItaddt_has_route_to_root(RARdtall_keyst	connectedtptpkey((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRwTs 


tResultsmapping graph criteriacsH|j}d„|jƒDƒ}d|tdƒ<tƒ}|jdƒdh‰xÅ|jjƒD]´\}}t|j||ˆƒsˆq^n||kr¤|j|ƒnxk|jƒD]]}y|t|ƒ}Wnt	k
ráq±nX||krþ|j|ƒn|j
||ƒq±Wq^Wtd‡fd†|jƒDƒd|d|jƒS(NcSs%i|]\}}|t|ƒ“qS((Ru(Rtktv((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys
<dictcomp>ls	R@cs+i|]!\}}|ˆkr||“qS(((RR}R~(Ry(sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pys
<dictcomp>‚s	tgraphRA(R@RiR-RuRRvRARwR'RItconnectR|(R=R@RxRRdR
RzR{((RysQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt
_build_resultjs.		
	
tResolvercBs eZdZeZdd„ZRS(s8The thing that performs the actual resolution work.
    idcCs4t|j|jƒ}|j|d|ƒ}t|ƒS(sTake a collection of constraints, spit out the resolution result.

        The return value is a representation to the final resolution result. It
        is a tuple subclass with three public members:

        * `mapping`: A dict of resolved candidates. Each key is an identifier
            of a requirement (as returned by the provider's `identify` method),
            and the value is the resolved candidate.
        * `graph`: A `DirectedGraph` instance representing the dependency tree.
            The vertices are keys of `mapping`, and each edge represents *why*
            a particular package is included. A special vertex `None` is
            included to represent parents of user-supplied requirements.
        * `criteria`: A dict of "criteria" that hold detailed information on
            how edges in the graph are derived. Each key is an identifier of a
            requirement, and the value is a `Criterion` instance.

        The following exceptions may be raised if a resolution cannot be found:

        * `ResolutionImpossible`: A resolution cannot be found for the given
            combination of requirements. The `causes` attribute of the
            exception is a list of (requirement, parent), giving the
            requirements that could not be satisfied.
        * `ResolutionTooDeep`: The dependency tree is too deeply nested and
            the resolver gave up. This is usually caused by a circular
            dependency, but you can try to resolve this by increasing the
            `max_rounds` argument.
        Rm(R8R$R<RsR(RRRmt
resolutionR=((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyRsŽs(RRR	Rtbase_exceptionRs(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyR‚ˆs(RBtcompatRt	providersRtstructsRt
namedtupleRt	ExceptionRR
RtobjectRR2R3R5R7R8RwR|RR‚(((sQ/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/resolvelib/resolvers.pyt<module>s$
QÁ		
Back to Directory File Manager