+
     hP  c                  sB   ^ RI Ht ^ RIt^ RIt^ RIt^ RIHtHtHtH	t	H
t
 ^RIHtHtHtHtHtHtHtHtHt ^RIHtHt ^RIHt ^RIHtHtHtHtHt ]'       d   ^RI H!t!H"t" ^R	I#H$t$ R
 R lt% ! R R]]]]3,          4      t& ! R R]]]]3,          4      t'R R lt(R# )i    )annotationsN)TYPE_CHECKING
CollectionGenericIterableMapping)	CTKTRTDirectedGraphIterableViewIteratorMappingRequirementInformationStatebuild_iter_view)AbstractResolverResult)	Criterion)InconsistentCandidateRequirementsConflictedResolutionImpossibleResolutionTooDeepResolverException)AbstractProvider
Preference)BaseReporterc                    V ^8  d   QhRRRR/# )   stateState[RT, CT, KT]returnResult[RT, CT, KT] Zformat   "P/usr/lib/python3.14/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py__annotate__r$   "   s      * /A     c                s   V P                   pVP                  4        UUu/ uF  w  r#\        V4      VbK  	  pppR V\        R 4      &   \        4       pVP	                  R 4       R 0pV P
                  P                  4        F  w  rx\        V P
                  WtV4      '       g   K$  Wu9  d   VP	                  V4       VP                  4        F>  p	 V\        V	4      ,          p
Y9  d   TP	                  T
4       TP                  Y4       K@  	  K  	  \        VP                  4        UUu/ uF  w  r#W&9   g   K  W#bK  	  uppVV P
                  R7      # u uppi   \         d     K  i ; iu uppi )N)mappinggraphcriteria)r&   itemsidr	   addr(   _has_route_to_rootiter_parentKeyErrorZconnectr   )r   r&   kvall_keysr'   	connectedkey	criterionppkeys   &          r#   _build_resultr7   "   s4   mmG;B==?%K?41beQh?H%KHRX&3oE	IIdO!%I....0!%..#KKIIcN&&(A1  		$MM$$ ) 1 ")--/D/$!Q^/D + &L   Es#   EE)
E+
8E+
E('E(c                  s    ] tR t^@tRtR R lt]R R l4       tR R ltR R	 lt	R
 R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltRtR# )
ResolutionzStateful resolution object.

This is designed as a one-off object that holds information to kick start
the resolution process, and holds the results afterwards.
c               $    V ^8  d   QhRRRRRR/# )r   providerzAbstractProvider[RT, CT, KT]reporterzBaseReporter[RT, CT, KT]r   Noner    r!   r"   r#   r$   Resolution.__annotate__G   s(     3 3.3 +3 
	3r%   c                	s,    Wn         W n        . V n        R # N_p_r_states)selfr:   r;   s   &&&r#   __init__ZResolution.__init__G   s    
 02r%   c                   V ^8  d   QhRR/# )r   r   r   r    r!   r"   r#   r$   r=   Q   s     1 1( 1r%   c                	sh     V P                   R,          #   \         d   p\        R4      ThRp?ii ; i)i   r   N)rB   
IndexErrorZAttributeError)rC   e   & r#   r   ZResolution.stateP   s3    	1<<## 	1 )q0	1s    1,1c               rE   )r   r   r<   r    r!   r"   r#   r$   r=   W   s     # # #r%   c                s    V P                   R,          p\        VP                  P                  4       VP                  P                  4       VP
                  R,          R7      pV P                   P                  V4       R# )zqPush a new state into history.

This new state will be used to hold resolution results of the next
coming round.
NNNr&   r(   backtrack_causesNrF   )rB   r   r&   copyr(   rL   append)rC   Zbaser   s   &  r#   _push_new_stateZResolution._push_new_stateW   s^     ||BLL%%']]'')!2215

 	E"r%   c               s(    V ^8  d   QhRRRRRRRR/# )	r   r(   dict[KT, Criterion[RT, CT]]requirementr   parentz	CT | Noner   r<   r    r!   r"   r#   r$   r=   e   s2     *) *)-*) *) 	*)
 
*)r%   c           
     	s   V P                   P                  W#R 7       V P                  P                  VR7      pVP	                  V4      pV'       d   \        VP                  4      pM. pV P                  P                  V\        V\        P                  ! R4      WB./4      \        V\        P                  ! R4      WF/4      R7      pV'       d1   \        VP                  4      pVP                  \        W#4      4       M\        W#4      .p\        \!        V4      VVR7      pVP"                  '       g   \%        V4      hWQV&   R# ))rQ   rR   )Zrequirement_or_candidateiter_requirementincompatibilities
identifierrequirementsrT   
candidatesinformationrT   N)rA   Zadding_requirementr@   identifyZgetlistrT   find_matchesr   operatormethodcaller
attrgetterrZ   rN   r   r   r   rY   r   )	rC   r(   rQ   rR   rV   r4   rT   matchesrZ   s	   &&&&     r#   _add_to_criteriaZResolution._add_to_criteriae   s'    	""{"JWW%%{%K
LL,	 $Y%@%@ A "''&&!(%%&89]+
 .##$78/ ' 
 y445K5kJK1+FGK&w/#/
	
 ###(33(r%   c               r9   )r   r(   rP   parentszCollection[KT]r   r<   r    r!   r"   r#   r$   r=      s$      3>L	r%   c           
     sD   V'       g   R# VP                  4        F|  w  r4\        VP                  VP                   Uu. uF?  pVP                  e-   V P
                  P                  VP                  4      V9  g   K=  VNKA  	  upVP                  4      W&   K~  	  R# u upi )a/  Remove information from parents of criteria.

Concretely, removes all values from each criterion's ``information``
field that have one of ``parents`` as provider of the requirement.

:param criteria: The criteria to update.
:param parents: Identifiers for which to remove information from all criteria.
N)r)   r   rY   rZ   rR   r@   r[   rT   )rC   r(   rc   r3   r4   rZ   s   &&&   r#   !_remove_information_from_criteriaZ,Resolution._remove_information_from_criteria   s     &nn.NC%$$ (1'<'<'<#**277++K,>,>?wN	  K'< ++HM /s   :B=Bc               r   )r   namer   r   r   r    r!   r"   r#   r$   r=      s     
 
B 
: 
r%   c                	sZ   V P                   P                  VV P                  P                  \	        V P                  P
                  \        P                  ! R 4      4      \	        V P                  P
                  \        P                  ! R4      4      V P                  P                  R7      # )rY   rZ   )rV   resolutionsrY   rZ   rL   )	r@   Zget_preferencer   r&   r   r(   r^   r`   rL   )rC   re   s   &&r#   _get_preferenceZResolution._get_preference   s    ww%%

**&

####L1 (

####M2 "ZZ88 & 
 	
r%   c               r9   )r   re   r   r4   zCriterion[RT, CT]r   boolr    r!   r"   r#   r$   r=      s$     

 



#4

	

r%   c                	s  a a  S P                   P                  V,          o\        ;QJ d.    TT 3R lTP	                  4        4       F  '       d   K   R # 	  R# ! TT 3R lTP	                  4        4       4      #   \         d     R # i ; i)Fc              3  ^   <"   T F"  pSP                   P                  VSR 7      x  K$  	  R# 5i)rQ   	candidateNr@   Zis_satisfied_by).0rcurrent_pinrC      & r#   	<genexpr>Z8Resolution._is_current_pin_satisfying.<locals>.<genexpr>   s/      
1 GG##[#II1   *-T)r   r&   r.   allrS   )rC   re   r4   ro   s   f&&@r#   _is_current_pin_satisfyingZ%Resolution._is_current_pin_satisfying   s    	**,,T2K s 
//1
ss 	
s 	
s 
//1
 
 	
  		s   A9 9BBc               r   )r   rk   r   r   rP   r    r!   r"   r#   r$   r=      s      r 6Q r%   c                	s    V P                   P                  P                  4       pV P                  P	                  VR 7       F  pV P                  W#VR7       K  	  V# )rk   rR   )r   r(   rM   r@   get_dependenciesrb   )rC   rk   r(   rQ      &&  r#   _get_updated_criteriaZ Resolution._get_updated_criteria   sO    ::&&++-7733i3HK!!(	!J Ir%   c               r   )r   re   r   r   list[Criterion[RT, CT]]r    r!   r"   r#   r$   r=      s     # #b #5L #r%   c                	s&  a a S P                   P                  V,          p. pVP                   EF  o S P                  S4      p\        ;QJ d.    TT 3R lTP                  4        4       F  '       d   K   RM#	  RM! TT 3R lTP                  4        4       4      pT'       g   \        ST4      hS P
                  P                  SR7       S P                   P                  P                  T4       S P                   P                  P                  TR 4       SS P                   P                  T&   . u # 	  V#   \         dN   pS P
                  P                  TP                  S4       TP                  TP                  4        R p?EK]  R p?ii ; i)Nc              3  ri   rj   rl   )rm   rn   rk   rC   rp   r#   rq   Z7Resolution._attempt_to_pin_criterion.<locals>.<genexpr>   s/      5A ''A'KK5rr   FTru   )r   r(   rY   ry   r   rA   Zrejecting_candidater4   rN   rs   rS   r   ZpinningZupdater&   pop)rC   re   r4   causesr(   rH   Z	satisfiedrk   s   f&     @r#   _attempt_to_pin_criterionZ$Resolution._attempt_to_pin_criterion   s6   JJ''-	*,"--I55i@  "335 "335 I +IyAAGGOOiO0JJ&&x0 JJ""4.'0DJJt$I7 .> 9 * ++AKKCakk*s   D88FAFFc               r   )r   incompatibilities_from_brokenzlist[tuple[KT, list[CT]]]r   rh   r    r!   r"   r#   r$   r=      s     ! !-F!	!r%   c                	sp   V EF  w  r#V'       g   K   V P                   P                  V,          pT P                  P	                  T\        T P                   P                  \        P                  ! R 4      4      \        T P                   P                  \        P                  ! R4      Y#/4      R7      p\        T4      pT'       g    R# TP                  TP                  4       \        T\        TP                  4      TR7      T P                   P                  T&   EK  	  R#   \         d     EK1  i ; i)rS   rT   rU   FrX   T)r   r(   r.   r@   r]   r   r^   r_   r`   r   ZextendrT   r   r\   rZ   )rC   r~   r/   rT   r4   ra   rY   s   &&     r#   _patch_criteriaZResolution._patch_criteria   s   
 %B A$ JJ//2	 gg**,JJ''))*<= #2JJ''''(;<*# + G ,;7+CJ$$Y%@%@A%.% !6!67"3&DJJ"/ %B8 /  s   D%%D54D5c               r   )r   r|   $list[RequirementInformation[RT, CT]]r   rh   r    r!   r"   r#   r$   r=     s     W W D W Wr%   c                s   \         P                  ! R V 4       R V 4       4      pV Uu0 uF  q0P                  P                  V4      kK  	  pp\	        V P
                  4      ^8  EdK   V P
                  R V P                  p  V P
                  P                  4       pVP                  P                  4       w  rgYd9  d   MoT P                  P                  T4       Uu0 uF  qP                  P                  T4      kK  	  p	pT	P                  T4      '       g   MTP                  '       d   K   TP                  P!                  4        U
Uu. uF  w  rT
\#        TP$                  4      3NK  	  pp
pTP'                  Yg.34       T P)                  4        T P+                  T4      pT'       g   EKc  R# R# u upi   \        \        3 d    \        T4      Rhi ; iu upi u upp
i )ar  Perform backjumping.

When we enter here, the stack is like this::

    [ state Z ]
    [ state Y ]
    [ state X ]
    .... earlier states are irrelevant.

1. No pins worked for Z, so it does not have a pin.
2. We want to reset state Y to unpinned, and pin another candidate.
3. State X holds what state Y was before the pin, but does not
   have the incompatibility information gathered in state Y.

Each iteration of the loop will:

1.  Identify Z. The incompatibility is not always caused by the latest
    state. For example, given three requirements A, B and C, with
    dependencies A1, B1 and C1, where A1 and B1 are incompatible: the
    last state might be related to C, so we want to discard the
    previous state.
2.  Discard Z.
3.  Discard Y but remember its incompatibility information gathered
    previously, and the failure we're dealing with right now.
4.  Push a new state Y' based on X, and apply the incompatibility
    information from Y to Y'.
5a. If this causes Y' to conflict, we need to backtrack again. Make Y'
    the new Z and go back to step 2.
5b. If the incompatibilities apply cleanly, end backtracking.
c              3  sX   "   T F   qP                   f   K  VP                   x  K"  	  R # 5ir>   rv   rm   crI   r#   rq   'Resolution._backjump.<locals>.<genexpr>5  s     >v!XQXXvs   **c              3  s8   "   T F  qP                   x  K  	  R # 5ir>   )rQ   r   rI   r#   rq   r   6  s     +Fq]]Fs   TNFrF   )	itertoolsZchainr@   r[   lenrB   r   r{   r&   ZpopitemrG   r.   r   rw   Z
isdisjointr(   r)   r\   rT   rN   rO   r   )rC   r|   Zincompatible_reqsrn   Zincompatible_depsZbroken_statere   rk   ZdZcurrent_dependenciesr/   r0   r~   successs   &&            r#   	_backjumpZResolution._backjump  s   > 09>v>+F+0
 ;LL:KQWW--a0:KL$,,1$R   ::LA#'<<#3#3#5L&2&:&:&B&B&DOD 0
 261I1I)1T(1TAGG$$Q'1T % ( ,667HII
 $+++ <H;P;P;V;V;X-;X41D,,-.;X * -
 *00$1DE  "**+HIG w i M #H- A.v6D@A(-s   #F66F; #G"G!;Gc               r   )r   criteronrz   r   r   r    r!   r"   r#   r$   r=   n  s      R R/R	-Rr%   c           
     s    \        V UUu/ uF!  q"P                   F  p\        V4      VbK  	  K#  	  uppP                  4       4      # u uppi )z5Extract causes from list of criterion and deduplicate)r\   rZ   r*   Zvalues)rC   r   r   Zirx   r#   _extract_causesZResolution._extract_causesn  s<     xGx!ARUAXUxGNNPQQGs   'A
c               r9   )r   rW   Iterable[RT]
max_roundsintr   r   r    r!   r"   r#   r$   r=   t  s'     f, f,L f,c f,FW f,r%   c                	st   V P                   '       d   \        R 4      hV P                  P                  4        \	        \
        P                  ! 4       / . R7      .V n         V F,  p V P                  V P                  P                  VRR7       K.  	  V P                  4        \        V4       EF?  pV P                  P!                  VR7       V P                  P                  P#                  4        UUu. uF   w  rgV P%                  Wg4      '       d   K  VNK"  	  pppV'       g5   V P                  P'                  V P                  R7       V P                  u # \)        V P                  P                  P+                  4       4      \)        V4      ,
          p	\-        V4      ^8  d   \/        V P0                  P3                  VV P                  P4                  \7        V P                  P                  \8        P:                  ! R4      4      \7        V P                  P                  \8        P:                  ! R4      4      V P                  P<                  R7      4      p
MTp
V
'       g   \        R	4      h\-        V
4      ^8  d   \?        WP@                  R
7      pM	V
^ ,          pV PC                  V4      pV'       d   V PE                  V4      pV P                  PG                  VR7       V PI                  V4      pWP                  P<                  R&   V'       g    \        V P                  P<                  4      hMV P                  P                  P#                  4        UUu0 uF(  w  rgWi9   g   K  V P%                  Wg4      '       d   K&  VkK*  	  pppV PK                  V P                  P                  V4       V P                  4        V P                  PM                  WPP                  R7       EKB  	  \O        V4      h  \         d&   p\        TP                  P                  4      ThRp?ii ; iu uppi u uppi )zalready resolvedrK   Nrv   )index)r   rY   rZ   )Zidentifiersrf   rY   rZ   rL   z-narrow_requirement_selection returned 0 names)r3   )r|   rJ   )r   r   )(rB   ZRuntimeErrorrA   Zstartingr   collectionsZOrderedDictrb   r   r(   r   r   r4   rZ   rO   ZrangeZstarting_roundr)   rt   ZendingZsetZkeysr   r\   r@   Znarrow_requirement_selectionr&   r   r^   r`   rL   Zminrg   r}   r   Zresolving_conflictsr   rd   Zending_roundr   )rC   rW   r   rn   rH   Zround_indexr3   r4   Zunsatisfied_namesZsatisfied_namesZnarrowed_unstatisfied_namesre   Zfailure_criterionr|   r   Znewly_unsatisfied_namess   &&&             r#   resolveZResolution.resolvet  s|   <<<122 #//1!#
 AK%%djj&9&91T%J  	 ,KGG"""5 '+jj&9&9&?&?&A!&ANC66sF &A  ! %TZZ0zz! "$**"5"5":":"<=DU@VVO$%).2GG88$5$(JJ$6$6#2 JJ//$//=$ %4 JJ//$//>% *.)D)D 9 /+  /@+ /"#RSS ./!36<P<PQ215 $ > >t D --.?@ ++6+:..017

++A. .tzz/J/JKK  +/***=*=*C*C*E+*E-  !;;CK C*E ( + 66JJ'')@ $$&GG  {** EW -Z  
++k * K*1;;+B+BCJK!x+s6   %(O;3P.P.
P4-P4P4;P+ P&&P+r?   N)__name__
__module____qualname____firstlineno____doc__rD   Zpropertyr   rO   rb   rd   rg   rt   ry   r}   r   r   r   r   __static_attributes__r    r%   r#   r8   r8   @   sd    3 1 1#*)X6


#J!FWrRf, f,r%   r8   c                  s.    ] tR tRtRt]tRR R lltRtR# )Resolveri  z3The thing that performs the actual resolution work.c               r9   )r   rW   r   r   r   r   r   r    r!   r"   r#   r$   ZResolver.__annotate__  s(     "$ "$""$ "$ 
	"$r%   c                s|    \        V P                  V P                  4      pVP                  WR7      p\	        V4      # )af  Take 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.
)r   )r8   r:   r;   r   r7   )rC   rW   r   Z
resolutionr   s   &&&  r#   r   ZResolver.resolve  s7    @  t}}=
""<"GU##r%   r    N)id   )	r   r   r   r   r   r   Zbase_exceptionr   r   r    r%   r#   r   r     s    =&N"$ "$r%   r   c          
     s,    V ^8  d   QhRRRRRRRRR	R
/# )r   r(   zMapping[KT, Criterion[RT, CT]]r3   z	KT | Noner1   zdict[int, KT | None]r2   zset[KT | None]r   rh   r    r!   r"   r#   r$   r$     s:      ,	 # 	
 
r%   c                s6   W9   d   R # W9  d   R# Vf   Q hW,          P                  4        FV  p V\        V4      ,          pYS9   d   TP                  T4        R # \	        YY#4      '       g   KD  TP                  T4        R # 	  R#   \         d     Kj  i ; i)TF)r-   r*   r.   r+   r,   )r(   r3   r1   r2   r5   r6   s   &&&&  r#   r,   r,     s     
??]&&(	BqE?D MM#hhBBMM# )   		s   B		BB))Z
__future__r    r   r   r^   Ztypingr   r   r   r   r   Zstructsr   r   r   r	   r
   r   r   r   r   Zabstractr   r   r4   r   Z
exceptionsr   r   r   r   r   Z	providersr   r   Z	reportersr   r7   r8   r   r,   r    r%   r#   <module>r      s    "    H H
 
 
 /    8(<Z,R$ Z,z'$B
+ '$Tr%   