
    gP                        S SK r S SKrS SKrSSKJr  SSKJrJrJr  \ R                  " SSS/5      r
 " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\ R                  " SS5      r " S S\5      rS r\ R                  " SS5      rS r " S S\5      rg)     N   )AbstractResolver)DirectedGraphIteratorMappingbuild_iter_viewRequirementInformationrequirementparentc                       \ rS rSrSrSrg)ResolverException   zA 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____firstlineno____doc____static_attributes__r       h/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/pip/_vendor/resolvelib/resolvers.pyr   r      s    r   r   c                   .   ^  \ rS rSrU 4S jrS rSrU =r$ )RequirementsConflicted   c                 8   > [         [        U ]  U5        Xl        g N)superr   __init__	criterion)selfr   	__class__s     r   r   RequirementsConflicted.__init__   s    $d4Y?"r   c                     SR                  SR                  S U R                  R                  5        5       5      5      $ )NzRequirements conflict: {}, c              3   8   #    U  H  n[        U5      v   M     g 7fr   repr.0rs     r   	<genexpr>1RequirementsConflicted.__str__.<locals>.<genexpr>        I'H!d1gg'H   )formatjoinr   iter_requirementr   s    r   __str__RequirementsConflicted.__str__   s4    *11IIIt~~'F'F'HII
 	
r   )r   r   r   r   r   r   r2   r   __classcell__r    s   @r   r   r      s    #
 
r   r   c                   .   ^  \ rS rSrU 4S jrS rSrU =r$ )InconsistentCandidate    c                 D   > [         [        U ]  X5        Xl        X l        g r   )r   r8   r   	candidater   )r   r;   r   r    s      r   r   InconsistentCandidate.__init__!   s    #T3II""r   c                     SR                  U R                  SR                  S U R                  R	                  5        5       5      5      $ )Nz+Provided candidate {!r} does not satisfy {}r#   c              3   8   #    U  H  n[        U5      v   M     g 7fr   r%   r'   s     r   r*   0InconsistentCandidate.__str__.<locals>.<genexpr>)   r,   r-   )r.   r;   r/   r   r0   r1   s    r   r2   InconsistentCandidate.__str__&   s;    <CCNNIIIt~~'F'F'HII
 	
r   )r;   r   r4   r6   s   @r   r8   r8       s    #

 
r   r8   c                   0    \ rS rSrSrS rS rS rS rSr	g)		Criterion-   a  Representation 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.
c                 (    Xl         X l        X0l        g r   
candidatesinformationincompatibilities)r   rF   rG   rH   s       r   r   Criterion.__init__A   s    $&!2r   c                 h    SR                  S U R                   5       5      nSR                  U5      $ )Nr#   c              3   H   #    U  H  u  pS R                  X5      v   M     g7f)z({!r}, via={!r})N)r.   )r(   reqr
   s      r   r*   %Criterion.__repr__.<locals>.<genexpr>G   s'      !
/ %%c22/s    "zCriterion({}))r/   rG   r.   )r   requirementss     r   __repr__Criterion.__repr__F   s6    yy !
#//!
 
 %%l33r   c                 (    S U R                    5       $ )Nc              3   8   #    U  H  oR                   v   M     g 7fr   r	   r(   is     r   r*   -Criterion.iter_requirement.<locals>.<genexpr>N   s     8'7!'7r-   rG   r1   s    r   r0   Criterion.iter_requirementM   s    8t'7'788r   c                 (    S U R                    5       $ )Nc              3   8   #    U  H  oR                   v   M     g 7fr   r
   rT   s     r   r*   (Criterion.iter_parent.<locals>.<genexpr>Q   s     3"2Q"2r-   rW   r1   s    r   iter_parentCriterion.iter_parentP   s    3$"2"233r   )rF   rH   rG   N)
r   r   r   r   r   r   rO   r0   r]   r   r   r   r   rB   rB   -   s    &3
494r   rB   c                       \ rS rSrSrg)ResolutionErrorT   r   N)r   r   r   r   r   r   r   r   r`   r`   T   s    r   r`   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ResolutionImpossibleX   c                 8   > [         [        U ]  U5        Xl        g r   )r   rc   r   causes)r   rf   r    s     r   r   ResolutionImpossible.__init__Y   s    "D26:r   rf   r   r   r   r   r   r   r5   r6   s   @r   rc   rc   X   s     r   rc   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ResolutionTooDeep_   c                 8   > [         [        U ]  U5        Xl        g r   )r   rk   r   round_count)r   rn   r    s     r   r   ResolutionTooDeep.__init__`   s    /<&r   )rn   ri   r6   s   @r   rk   rk   _   s    ' 'r   rk   Statez!mapping criteria backtrack_causesc                   d    \ rS rSrSrS r\S 5       rS rS r	S r
S rS	 rS
 rS rS rS rSrg)
Resolutioni   zStateful 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                 *    Xl         X l        / U l        g r   _p_r_states)r   providerreporters      r   r   Resolution.__init__p   s    r   c                 T     U R                   S   $ ! [         a    [        S5      ef = f)Nstate)rx   
IndexErrorAttributeErrorr1   s    r   r~   Resolution.stateu   s0    	*<<## 	* ))	*s    'c                     U R                   S   n[        UR                  R                  5       UR                  R                  5       UR
                  SS S9nU R                   R                  U5        g)zqPush a new state into history.

This new state will be used to hold resolution results of the next
coming round.
r}   Nmappingcriteriabacktrack_causes)rx   rp   r   copyr   r   append)r   baser~   s      r   _push_new_stateResolution._push_new_state|   s^     ||BLL%%']]'')!2215

 	E"r   c           
      n   U R                   R                  X#S9  U R                  R                  US9nUR	                  U5      nU(       a  [        UR                  5      nO/ nU R                  R                  U[        U[        R                  " S5      XB/05      [        U[        R                  " S5      XF05      S9nU(       a0  [        UR                  5      nUR                  [        X#5      5        O[        X#5      /n[        [!        U5      UUS9nUR"                  (       d  [%        U5      eXQU'   g )N)r	   r
   )requirement_or_candidater0   rH   
identifierrN   rH   rE   )rw   adding_requirementrv   identifygetlistrH   find_matchesr   operatormethodcaller
attrgetterrG   r   r   rB   r   rF   r   )	r   r   r	   r
   r   r   rH   matchesrG   s	            r   _add_to_criteriaResolution._add_to_criteria   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           
      <   U(       d  gUR                  5        H{  u  p4[        UR                  UR                   Vs/ s H=  nUR                  b+  U R
                  R                  UR                  5      U;  d  M;  UPM?     snUR                  5      X'   M}     gs  snf )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)itemsrB   rF   rG   r
   rv   r   rH   )r   r   parentskeyr   rG   s         r   !_remove_information_from_criteria,Resolution._remove_information_from_criteria   s     &nn.NC%$$ (1'<'<'<#**277++K,>,>?wN	  '< ++HM /s   :B:Bc                 T   U R                   R                  UU R                  R                  [	        U R                  R
                  [        R                  " S5      5      [	        U R                  R
                  [        R                  " S5      5      U R                  R                  S9$ )NrF   rG   )r   resolutionsrF   rG   r   )	rv   get_preferencer~   r   r   r   r   r   r   )r   names     r   _get_preferenceResolution._get_preference   s    ww%%

**&

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

####M2 "ZZ88 & 
 	
r   c                    ^ ^  T R                   R                  U   m[        UU 4S jUR	                  5        5       5      $ ! [         a     gf = f)NFc              3   X   >#    U  H  nTR                   R                  UTS 9v   M!     g7f)r	   r;   Nrv   is_satisfied_by)r(   r)   current_pinr   s     r   r*   8Resolution._is_current_pin_satisfying.<locals>.<genexpr>   s,      
1 GG##[#I1   '*)r~   r   KeyErrorallr0   )r   r   r   r   s   `  @r   _is_current_pin_satisfying%Resolution._is_current_pin_satisfying   sU    	**,,T2K  
//1
 
 	
  		s   A 
AAc                     U R                   R                  R                  5       nU R                  R	                  US9 H  nU R                  X#US9  M     U$ )Nr;   r[   )r~   r   r   rv   get_dependenciesr   )r   r;   r   r	   s       r   _get_updated_criteria Resolution._get_updated_criteria   sO    ::&&++-7733i3HK!!(	!J Ir   c                   ^ ^ T R                   R                  U   n/ nUR                   H  m T R                  T5      n[        UU 4S jUR                  5        5       5      nU(       d  [        TU5      eT R
                  R                  TS9  T R                   R                  R                  U5        T R                   R                  R                  US 5        TT R                   R                  U'   / s  $    U$ ! [         aM  nT R
                  R                  UR                  T5        UR                  UR                  5         S nAGM#  S nAff = f)Nc              3   X   >#    U  H  nTR                   R                  UTS 9v   M!     g7fr   r   )r(   r)   r;   r   s     r   r*   7Resolution._attempt_to_pin_criterion.<locals>.<genexpr>   s,      5A ''A'K5r   r   )r~   r   rF   r   r   rw   rejecting_candidater   r   r   r0   r8   pinningupdater   pop)r   r   r   rf   r   e	satisfiedr;   s   `      @r   _attempt_to_pin_criterion$Resolution._attempt_to_pin_criterion   s   JJ''-	"--I55i@  "335 I +IyAAGGOOiO0JJ&&x0 JJ""4.'0DJJt$I7 .> 9 * ++AKKCakk*s   C;;
EAEEc                   ^ ^ [         R                  " S U 5       S U 5       5      nU Vs1 s H  nT R                  R                  U5      iM      nn[	        T R
                  5      S:  GaJ  T R
                  S	 SnU(       d   T R
                  R                  5       nUR                  R                  5       u  pxT R                  R                  U5       V	s1 s H  n	T R                  R                  U	5      iM      n
n	U
R                  U5      (       + nU(       d  M  WR                  R                  5        VVs/ s H  u  pU[!        UR"                  5      4PM     snnmTR%                  WW/45        UU 4S jnT R'                  5         U" 5       nU(       a  g[	        T R
                  5      S:  a  GMJ  gs  snf ! [        [        4 a    [        U5      ef = fs  sn	f s  snnf )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   V   #    U  H  oR                   c  M  UR                   v   M!     g 7fr   r[   r(   cs     r   r*   'Resolution._backjump.<locals>.<genexpr>.  s     >v!XQXXvs   ))c              3   8   #    U  H  oR                   v   M     g 7fr   rS   r   s     r   r*   r   /  s     +Fq]]Fr-      r}   Fc                  T  > T GH  u  pU(       d  M   TR                   R                  U    nTR                  R	                  U [        TR                   R                  [        R                  " S5      5      [        TR                   R                  [        R                  " S5      X05      S9n[        U5      nU(       d    gUR                  UR                  5        [        U[        UR                  5      US9TR                   R                  U '   GM     g! [         a     GM"  f = f)Nr0   rH   r   FrE   T)r~   r   r   rv   r   r   r   r   r   r   extendrH   rB   r   rG   )krH   r   r   rF   incompatibilities_from_brokenr   s        r   _patch_criteria-Resolution._backjump.<locals>._patch_criteriaQ  s
   ,I(A, !$(JJ$7$7$:	 #gg22#$%4 JJ//$112DE& +: JJ//$//0CD2+ 3 G "1!9J%$%,,Y-H-HI-6#-$()>)>$?*;.DJJ''*/ -J8 / $ ! !s   D
D'&D'T)	itertoolschainrv   r   lenrx   r   r   popitemr   r   rc   r   
isdisjointr   r   r   rH   r   r   )r   rf   incompatible_reqsr)   incompatible_depsincompatible_statebroken_stater   r;   dcurrent_dependenciesr   vr   successr   s   `              @r   	_backjumpResolution._backjump  s   > &OO>v>+F+
 ;LL:KQTWW--a0:KL$,,1$R  "'(7#'<<#3#3#5L&2&:&:&B&B&DOD
 "WW55i@(@ GG$$Q'@ % ( *>)H)H%* &" )(" )11779-9DA D,,-.9-) *00$1DE>   "%'G G $,,1$R U M #H- 7.v667(-s   %F86F= %G:#G!=Gc           	         U R                   (       a  [        S5      eU R                  R                  5         [	        [
        R                  " 5       0 / S9/U l         U H)  n U R                  U R                  R                  US S9  M+     U R                  5         [        U5       GHH  nU R                  R!                  US9  U R                  R                  R#                  5        VVs/ s H  u  pgU R%                  Xg5      (       a  M  UPM!     nnnU(       d1  U R                  R'                  U R                  S9  U R                  s  $ [)        U R                  R                  R+                  5       5      [)        U5      -
  n	[-        XR.                  S9n
U R1                  U
5      nU(       a  U VVs/ s H  oR                    H  oPM     M     nnnU R                  R3                  US9  U R5                  U5      nXR                  R6                  S S & U(       d  [        U R                  R6                  5      eOU R                  R                  R#                  5        VVs1 s H&  u  pgXi;   d  M  U R%                  Xg5      (       a  M$  UiM(     nnnU R9                  U R                  R                  U5        U R                  5         U R                  R;                  XPR                  S9  GMK     [=        U5      e! [         a$  n[        UR                  R                  5      eS nAff = fs  snnf s  snnf s  snnf )	Nzalready resolvedr   r[   )index)r~   )r   rh   )r   r~   )rx   RuntimeErrorrw   startingrp   collectionsOrderedDictr   r~   r   r   rc   r   rG   r   rangestarting_roundr   r   endingsetkeysminr   r   resolving_conflictsr   r   r   ending_roundrk   )r   rN   
max_roundsr)   r   round_indexr   r   unsatisfied_namessatisfied_namesr   failure_causesr   rU   rf   r   newly_unsatisfied_namess                    r   resolveResolution.resolve}  s   <<122 #//1!#
 AD%%djj&9&91T%J  	 ,KGG"""5 '+jj&9&9&?&?&A!&ANC66sF &A  ! %TZZ0zz! "$**"5"5":":"<=!A O
 (.B.BCD!;;DAN%3K^]]!]!^K ++6+:..017

++A. .tzz/J/JKK  +/***=*=*C*C*E+*E-  !;;CK *E ( + 66JJ'')@ $$&GG  {** Ec -f  
++w * D*1;;+B+BCCD!* L+s<   !%K=)L.	L.3L4$L:3L:L:=
L+L&&L+ru   N)r   r   r   r   r   r   propertyr~   r   r   r   r   r   r   r   r   r   r   r   r   r   rr   rr   i   sR    
 * *#%)N2

#Jm^L,r   rr   c                    X;   a  gX;  a  gX   R                  5        HN  n U[        U5         nXS;   a  UR                  U5          g[	        XX#5      (       d  M=  UR                  U5          g   g! [         a     M`  f = f)NTF)r]   idr   add_has_route_to_root)r   r   all_keys	connectedppkeys         r   r   r     s    

]&&(	BqE?D MM#hhBBMM# )   		s   A22
B ?B Resultzmapping graph criteriac                    U R                   nUR                  5        VVs0 s H  u  p#[        U5      U_M     nnnS U[        S 5      '   [        5       nUR	                  S 5        S 1nU R
                  R                  5        H  u  px[        U R
                  XtU5      (       d  M#  Xu;  a  UR	                  U5        UR                  5        H9  n	 U[        U	5         n
X;  a  UR	                  U
5        UR                  X5        M;     M     [        UR                  5        VVs0 s H  u  p#X&;   d  M  X#_M     snnUU R
                  S9$ s  snnf ! [         a     M  f = fs  snnf )N)r   graphr   )r   r   r   r   r   r   r   r]   r   connectr   )r~   r   r   r   r   r   r   r   r   r   r   s              r   _build_resultr    s3   mmG%,]]_5_TQ1q_H5HRXOE	IIdOI....0!%..#KKIIcN&&(A1  		$MM$$ ) 1 ")--/D/$!Q^/D + 6   Es#   E
E#E!
2E!

EEc                   &    \ rS rSrSr\rSS jrSrg)Resolveri   z3The thing that performs the actual resolution work.c                 v    [        U R                  U R                  5      nUR                  XS9n[	        U5      $ )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   )rr   ry   rz   r   r  )r   rN   r   
resolutionr~   s        r   r   Resolver.resolve  s6    8  t}}=
""<"GU##r   r   N)d   )	r   r   r   r   r   r   base_exceptionr   r   r   r   r   r  r     s    =&N$r   r  )r   r   r   	providersr   structsr   r   r   
namedtupler   	Exceptionr   r   r8   objectrB   r`   rc   rk   rp   rr   r   r   r  r  r   r   r   <module>r     s       ' D D$//}h7 
	 
. 


- 

$4 $4N	' 	? ' ' 	w(KL`, `,F& 
		*B	C<#$ #$r   