HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/__pycache__/resolvers.cpython-39.pyc
a

?�f�:�@s�ddlZddlmZddlmZddlmZe�dddg�ZGd	d
�d
e	�Z
Gdd�de
�ZGd
d�de
�ZGdd�de
�ZGdd�de
�ZGdd�de�ZGdd�de�Ze�dd�ZGdd�de
�Zdd�Ze�dd�Zdd �ZGd!d"�d"e�ZdS)#�N�)�collections_abc)�AbstractResolver)�
DirectedGraph�RequirementInformation�requirement�parentc@seZdZdZdS)�ResolverExceptionz�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.
    N)�__name__�
__module__�__qualname__�__doc__�rr�D/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.pyr	
sr	cs$eZdZ�fdd�Zdd�Z�ZS)�RequirementsConflictedcstt|��|�||_dS�N)�superr�__init__�	criterion)�selfr��	__class__rrrszRequirementsConflicted.__init__cCs d�d�dd�|j��D���S)NzRequirements conflict: {}�, css|]}t|�VqdSr��repr��.0�rrrr�	<genexpr>�z1RequirementsConflicted.__str__.<locals>.<genexpr>)�format�joinr�iter_requirement�rrrr�__str__s�zRequirementsConflicted.__str__�r
rrrr$�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�InconsistentCandidatecs"tt|��||�||_||_dSr)rr'r�	candidater)rr(rrrrr!szInconsistentCandidate.__init__cCs$d�|jd�dd�|j��D���S)Nz+Provided candidate {!r} does not satisfy {}rcss|]}t|�VqdSrrrrrrr)rz0InconsistentCandidate.__str__.<locals>.<genexpr>)r r(r!rr"r#rrrr$&s�zInconsistentCandidate.__str__r%rrrrr' sr'c@sLeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�	CriterionaQRepresentation 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||_||_||_dSr��
candidates�information�incompatibilities)rr+r,r-rrrrAszCriterion.__init__cCs d�dd�|jD��}d�|�S)Nrcss|]\}}d�||�VqdS)z({!r}, via={!r})N)r )rZreqrrrrrGs�z%Criterion.__repr__.<locals>.<genexpr>z
Criterion({}))r!r,r )r�requirementsrrr�__repr__Fs
�zCriterion.__repr__cCsF|�|g�}t|tj�s t|�}||t||�ggd�}|sBt|��|S)z.Build an instance from a requirement.
        r*)�find_matches�
isinstancer�Sequence�listrr)�cls�providerrrr+rrrr�from_requirementMs
�zCriterion.from_requirementcCsdd�|jD�S)Ncss|]}|jVqdSr)r�r�irrrr^rz-Criterion.iter_requirement.<locals>.<genexpr>�r,r#rrrr"]szCriterion.iter_requirementcCsdd�|jD�S)Ncss|]}|jVqdSr�rr7rrrrarz(Criterion.iter_parent.<locals>.<genexpr>r9r#rrr�iter_parent`szCriterion.iter_parentcCsht|j�}|�t||��|�dd�|D��}t|tj�sBt|�}t|�||t|j	��}|sdt
|��|S)z>Build a new instance from this and a new requirement.
        cSsg|]\}}|�qSrr)rr�_rrr�
<listcomp>hrz)Criterion.merged_with.<locals>.<listcomp>)r3r,�appendrr0r1rr2�typer-r)rr5rrZinfosr+rrrr�merged_withcs
zCriterion.merged_withcsJt|j�}|����fdd�|jD�}|s0dSt|�|t|j�|�}|S)z�Build a new instance from this, but excluding specified candidate.

        Returns the new instance, or None if we still have no valid candidates.
        csg|]}|�kr|�qSrr)r�c�r(rrr=wrz)Criterion.excluded_of.<locals>.<listcomp>N)r3r-r>r+r?r,)rr(Z	incompatsr+rrrBr�excluded_ofps

zCriterion.excluded_ofN)r
rrr
rr/�classmethodr6r"r;r@rCrrrrr)-s

r)c@seZdZdS)�ResolutionErrorN)r
rrrrrrrE~srEcseZdZ�fdd�Z�ZS)�ResolutionImpossiblecstt|��|�||_dSr)rrFr�causes)rrGrrrr�szResolutionImpossible.__init__�r
rrrr&rrrrrF�srFcseZdZ�fdd�Z�ZS)�ResolutionTooDeepcstt|��|�||_dSr)rrIr�round_count)rrJrrrr�szResolutionTooDeep.__init__rHrrrrrI�srI�Statezmapping criteriac@sdeZdZdZdd�Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
Resolutionz�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|_dSr)�_p�_r�_states)rr5�reporterrrrr�szResolution.__init__cCs,z|jdWSty&td��Yn0dS)N����state)rO�
IndexError�AttributeErrorr#rrrrR�szResolution.statecCsZz|jd}Wn"ty0tt��id�}Yn0t|j��|j��d�}|j�|�dS)z�Push a new state into history.

        This new state will be used to hold resolution results of the next
        coming round.
        rQ)�mapping�criteriaN)	rOrSrK�collections�OrderedDictrU�copyrVr>)r�baserRrrr�_push_new_state�s�zResolution._push_new_statecCsf|j�||�|j�|�}z|jj|}Wn"tyLt�|j||�}Yn0|�	|j||�}||fSr)
rNZadding_requirementrMZidentifyrRrV�KeyErrorr)r6r@)rrr�name�critrrr�_merge_into_criterion�sz Resolution._merge_into_criterioncCsD|\}}z|jj|}Wnty.d}Yn0|j�||j|j�Sr)rRrUr\rMZget_preferencer+r,)r�itemr]rZpinnedrrr�_get_criterion_item_preference�s

�z)Resolution._get_criterion_item_preferencecsBz�jj|�Wnty$YdS0t��fdd�|��D��S)NFc3s|]}�j�|��VqdSr�rMZis_satisfied_byr�Zcurrent_pinrrrr�s�z8Resolution._is_current_pin_satisfying.<locals>.<genexpr>)rRrUr\�allr")rr]rrrcr�_is_current_pin_satisfying�s�z%Resolution._is_current_pin_satisfyingcCs4i}|j�|�D]}|j||d�\}}|||<q|S)Nr:)rMZget_dependenciesr_)rr(rVrr]r^rrr�_get_criteria_to_update�s

z"Resolution._get_criteria_to_updatecs�g}|jD]��z����}Wn<tyX}z$|�|j�WYd}~q
WYd}~n
d}~00t��fdd�|��D��}|s�t�|���j�	���j
j�|d���j
j|<�j
j
�|�gS|S)Nc3s|]}�j�|��VqdSrrbr�r(rrrr�s�z7Resolution._attempt_to_pin_criterion.<locals>.<genexpr>)r+rfrr>rrdr"r'rNZpinningrRrU�poprV�update)rr]rrGrV�eZ	satisfiedrrgr�_attempt_to_pin_criterion�s$
"�
z$Resolution._attempt_to_pin_criterioncCs�|jd=t|j�dkr�|j��}z|j��\}}WntyHYqYn0|j�|�|��|j	j
|�|�}|dur�|jd=q||j	j
|<dSdS)NrQ�TF)rO�lenrhrU�popitemr\rNZbacktrackingr[rRrVrC)rZ
prev_stater]r(rrrr�
_backtrack�s 

zResolution._backtrackcsD�jrtd�����|D]X}z�j|dd�\}}Wn0tyd}zt|jj��WYd}~n
d}~00|�jj	|<q�j
��t|�D]�}�j
�
|�����j}�fdd��jj	��D�}	|	s�jd=�j
�|��jSt|	�jd�\}}
��||
�}|�r(���}|�s(dd�|D�}
t|
���j
�||�q�t|��dS)Nzalready resolvedr:csg|]}�j|�s|�qSr)re)rr`r#rrr=3s
�z&Resolution.resolve.<locals>.<listcomp>rQ)�keycSsg|]}|jD]}|�qqSrr9)rr^r8rrrr=Js)rO�RuntimeErrorr[r_rrFrr,rRrVrNZstarting�rangeZstarting_round�itemsZending�minrarkroZending_roundrI)rr.�
max_roundsrr]r^rjZround_indexZcurrZunsatisfied_criterion_itemsrZfailure_causes�resultrGrr#r�resolvesF"


�
�
�zResolution.resolveN)r
rrr
r�propertyrRr[r_rarerfrkrorwrrrrrL�s


!"rLc	Cs�||vrdS||vrdS||��D]b}z|t|�}WntyNYq$Yn0||vrh|�|�dSt||||�r$|�|�dSq$dS)NTF)r;�idr\�add�_has_route_to_root)rVrp�all_keys�	connected�p�pkeyrrrr{Ts 


r{�Resultzmapping graph criteriac
s�|j}dd�|��D�}d|td�<t�}|�d�dh�|j��D]�\}}t|j||��s^qD||vrp|�|�|��D]J}z|t|�}Wnty�YqxYn0||vr�|�|�|�	||�qxqDt
�fdd�|��D�||jd�S)NcSsi|]\}}t|�|�qSr)ry�r�k�vrrr�
<dictcomp>lrz!_build_result.<locals>.<dictcomp>csi|]\}}|�vr||�qSrrr��r}rrr��r)rU�graphrV)rUrsryrrzrVr{r;r\Zconnectr�)rRrUr|r�rprr~rrr�r�
_build_resultjs0



�r�c@seZdZdZeZddd�ZdS)�Resolverz8The thing that performs the actual resolution work.
    �dcCs$t|j|j�}|j||d�}t|�S)aTake 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.
        )ru)rLr5rPrwr�)rr.ruZ
resolutionrRrrrrw�szResolver.resolveN)r�)r
rrr
r	Zbase_exceptionrwrrrrr��sr�)rW�compatrZ	providersrZstructsr�
namedtupler�	Exceptionr	rr'�objectr)rErFrIrKrLr{r�r�r�rrrr�<module>s(�
QB