ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyc

�
Bu�_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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR
stRequirementsConflictedcBseZd�Zd�ZRS(cCs#tt|�j|�||_dS(N(tsuperR
t__init__t	criterion(tselfR
((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>s(tformattjoinR
titer_requirement(R((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyt__str__s(RRRR(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR
s	tInconsistentCandidatecBseZd�Zd�ZRS(cCs/tt|�j||�||_||_dS(N(RRRt	candidateR
(RRR
((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>)s(RRRR
R(R((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR&s(RRRR(((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>Hss
Criterion({})(RRR(Rtrequirements((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pytfrom_requirementMs	cCsd�|jD�S(Ncss|]}|jVqdS(N(R(Rti((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>^s(R(R((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR]scCsd�|jD�S(Ncss|]}|jVqdS(N(R(RR&((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>as(R(R((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pytexcluded_ofps
(!(RRR	RRtclassmethodR%RR'R,R0(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR-s					
tResolutionErrorcBseZRS((RR(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR2~stResolutionImpossiblecBseZd�ZRS(cCs#tt|�j|�||_dS(N(RR3Rtcauses(RR4((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR�s(RRR(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR3�stResolutionTooDeepcBseZd�ZRS(cCs#tt|�j|�||_dS(N(RR5Rtround_count(RR6((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR�s(RRR(((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR�s		cCs3y|jdSWntk
r.td��nXdS(Ni����tstate(R;t
IndexErrortAttributeError(R((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>�s(R=R@RItFalsetallR(RRJR
((RRRsQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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��}|s�t�|��n�jj	���j
jj|d���j
j|<�j
jj|�gSW|S(Nc3s$|]}�jj|��VqdS(N(R9RQ(RR(RR(sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys	<genexpr>�s(RRWR
R(R
RTRRR:tpinningR=R@tpopR-RAtupdate(RRJR
R4RAtet	satisfied((RRsQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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]}|^q�qt}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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pytresolves@	



	
)(RRR	RtpropertyR=RFRLRPRURWR]RcRs(((sQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys
<dictcomp>ls	R@cs+i|]!\}}|�kr||�qS(((RR}R~(Ry(sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pys
<dictcomp>�s	tgraphRA(R@RiR-RuRRvRARwR'RItconnectR|(R=R@RxRRdR
RzR{((RysQ/opt/alt/python36/lib/python3.6/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/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyRs�s(RRR	Rtbase_exceptionRs(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyR��s(RBtcompatRt	providersRtstructsRt
namedtupleRt	ExceptionRR
RtobjectRR2R3R5R7R8RwR|R�R�(((sQ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.pyt<module>s$
Q�		

Zerion Mini Shell 1.0