
    q"h1                        S SK r S SKrS SKrS SKrS SKJrJrJrJrJ	r	J
r
Jr  S SKJr  S SKJrJrJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SK J!r!  S SK"J#r#  S SK$J%r%J&r&  S SK'J(r(  S SK)J*r*J+r+  S SK,J-r-  SSK.J/r/J0r0  SSK1J2r2  \(       a  S SK3J4r5  \5\0\/\64   r4\Rn                  " \85      r9 " S S\%5      rSSS\	\6   S\\\6   \:4   4S jr;S\
\6\!4   S\\\6   \:4   S\
\:\64   4S jr<g)     N)TYPE_CHECKINGDictListOptionalSetTuplecastcanonicalize_name)BaseReporterResolutionImpossibleResolutionTooDeep)Resolver)DirectedGraph)
WheelCache)ResolutionTooDeepError)PackageFinder)RequirementPreparer)install_req_extend_extras)InstallRequirement)RequirementSet)BaseResolverInstallRequirementProvider)PipProvider)PipDebuggingReporterPipReporter)get_requirement   )	CandidateRequirement)Factory)Resultc                      ^  \ rS rSr1 Skr SS\S\S\\   S\	S\
S\
S	\
S
\
S\
S\S\\\S4      4U 4S jjjrS\\   S\
S\4S jrS\S\\   4S jrSrU =r$ )r   '   >   eageronly-if-neededto-satisfy-onlypreparerfinderwheel_cachemake_install_requse_user_siteignore_dependenciesignore_installedignore_requires_pythonforce_reinstallupgrade_strategypy_version_info.c                    > [         TU ]  5         XR                  ;   d   e[        UUUUUU	UUUS9	U l        X`l        Xl        S U l        g )N)	r)   r(   r+   r*   r,   r0   r.   r/   r2   )super__init___allowed_strategiesr!   factoryr-   r1   _result)selfr(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   	__class__s               ^/var/www/html/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/resolver.pyr5   Resolver.__init__*   s^     	#;#;;;;-#'+-#9+

 $7  0)-    	root_reqscheck_supported_wheelsreturnc           
         U R                   R                  U5      n[        U R                   UR                  U R                  U R
                  UR                  S9nS[        R                  ;   a  [        5       nO
[        5       n[        UU5      n SnUR                  UR                  US9=ol        [)        US9n[+        UR,                  R/                  5       S S9 GH6  nUR1                  5       nUc  UR2                  UR4                  :w  av  [6        R8                  " [:        5         UR=                  UR4                  5      nUR?                  [A        U[=        UR2                  5      RB                  5      5        S S S 5        M  U R                   RE                  U5      nUc  S	Ul#        OU R                   RH                  (       a  S
Ul#        OURJ                  URJ                  :w  a  S
Ul#        OURL                  (       d  URN                  (       a  S
Ul#        OuURP                  (       aa  URP                  RR                  (       aF  URP                  RT                  (       a#  [V        RY                  SUR2                  5        GM  S
Ul#        OGM  URP                  nU(       a_  URZ                  (       aN  SR]                  UR2                  URJ                  UUR^                  =(       d    SS9n[V        Ra                  U5        UR?                  U5        GM9     URb                  nU R                   Rd                  Rg                  U5        U H  nS
Ul4        S	Ul5        M     U$ ! [         a7  n	U R                   R!                  [#        SU	5      UR                  5      n
XeS n	A	f[$         a    [&        S ef = f! , (       d  f       GNA= f)N)r7   constraintsr-   r1   user_requestedPIP_RESOLVER_DEBUGi@ )
max_roundsz,ResolutionImpossible[Requirement, Candidate])r?   c                 4    U R                   U R                  :g  $ N)nameproject_name)cs    r;   <lambda>"Resolver.resolve.<locals>.<lambda>s   s    166Q^^3Kr=   )keyFTz%s is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.zThe candidate selected for download or install is a yanked version: {name!r} candidate (version {version} at {link})
Reason for being yanked: {reason}z<none given>)rH   versionlinkreason)6r7   collect_root_requirementsr   rB   r-   r1   rC   osenvironr   r   
RLResolverresolverequirementsr8   r   get_installation_errorr	   r   r   r   sortedmappingvaluesget_install_requirementrH   rI   
contextlibsuppressKeyErrorr   add_named_requirementr   extrasget_dist_to_uninstallshould_reinstallr0   rN   is_editableeditablesource_linkis_fileis_wheelloggerinfo	is_yankedformatyanked_reasonwarningall_requirementsr(    prepare_linked_requirements_morepreparedneeds_more_preparation)r9   r>   r?   	collectedproviderreporterresolver#limit_how_complex_resolution_can_beresulteerrorreq_set	candidateireqreqinstalled_distrO   msgreqss                      r;   rU   Resolver.resolveJ   s/    LL::9E	LL!-- $ 8 8!22$33
  2::-BVBXH"}H<F=

	328/$,$4$4&&3V %5 % F\ !8NO
  NN!!#)K
I 446D|>>Y%;%;;#,,X6%55i6L6LM555 #_Y^^%D%K%K 7  "\\??	JN%(-%--(,%''9+<+<<(,%&&.*A*A )-%&&9+@+@+H+H((11KK5 			  )-%((DD &"%----?	  	  s#))$/C
F ''>>tDCCL).C&  m $ 	LL77CQG%%E   	3(d2	3 76s%   "M$ *AN8$
N5.2N  N58
O	rz   c                    U R                   c   S5       eUR                  (       d  / $ U R                   R                  n[        U[	        UR                  R                  5       5      5      n[        UR                  R                  5       [        R                  " [        US9SS9nU VVs/ s H  u  pVUPM	     snn$ s  snnf )a  Get order for installation of requirements in RequirementSet.

The returned list contains a requirement before another that depends on
it. This helps ensure that the environment is kept consistent as they
get installed one-by-one.

The current implementation creates a topological ordering of the
dependency graph, giving more weight to packages with less
or no dependencies, while breaking any cycles in the graph at
arbitrary points. We make no guarantees about where the cycle
would be broken, other than it *would* be broken.
zmust call resolve() first)weightsT)rM   reverse)r8   rV   graphget_topological_weightssetkeysrX   items	functoolspartial_req_set_item_sorter)r9   rz   r   r   sorted_items_r|   s          r;   get_installation_orderResolver.get_installation_order   s     ||'D)DD'##I"")%W5I5I5N5N5P1QR  &&(!!"6H

 %11LL111s   *B<)r8   r7   r-   r1   rG   )__name__
__module____qualname____firstlineno__r6   r   r   r   r   r   boolstrr   intr5   r   r   r   rU   r   __static_attributes____classcell__)r:   s   @r;   r   r   '   s    H 6:.%. . j)	.
 5. . ". . !%. . . "%S/2. .@p01pKOp	pd2%2	 	!2 2r=   r   r   zDirectedGraph[Optional[str]]requirement_keysr@   c                   ^ ^^^	^
 [        5       m0 m
S[        [           SS4U UUU	U
4S jjm	 [        5       nT  H2  nUc  M  T R                  U5       H  n  M     UR	                  U5        M4     U(       d  O@[        T 5      S-
  nU H  nUT;  a  M  UT
U'   M     U H  nT R                  U5        M     M  T	" S5        [        T
R                  5       5      R                  T5      nU(       a   U5       eT
$ )ag  Assign weights to each node based on how "deep" they are.

This implementation may change at any point in the future without prior
notice.

We first simplify the dependency graph by pruning any leaves and giving them
the highest weight: a package without any dependencies should be installed
first. This is done again and again in the same way, giving ever less weight
to the newly found leaves. The loop stops when no leaves are left: all
remaining packages have at least one dependency left in the graph.

Then we continue with the remaining graph, by taking the length for the
longest path to any node from root, ignoring any paths that contain a single
node twice (i.e. cycles). This is done through a depth-first search through
the graph, while keeping track of the path to the node.

Cycles in the graph result would result in node being revisited while also
being on its own path. In this case, take no action. This helps ensure we
don't get stuck in a cycle.

When assigning weight, the longer path (i.e. larger length) is preferred.

We are only interested in the weights of packages that are in the
requirement_keys.
noder@   Nc                    > U T;   a  g TR                  U 5        TR                  U 5       H  nT" U5        M     TR                  U 5        U T;  a  g TR                  U S5      n[	        U[        T5      5      TU '   g )Nr   )additer_childrenremovegetmaxlen)r   childlast_known_parent_countr   pathr   visitr   s      r;   r   &get_topological_weights.<locals>.visit   st    4< 	((.E%L /D''")++dA"63SY?r=   r   )	r   r   r   r   r   r   r   r   
difference)r   r   leavesrM   _childweightleafr   r   r   r   s   ``      @@@r;   r   r      s    8  #uD(*G@HSM @d @ @, C{--c2 3
 

3  UaD++"GDM 
 DLL + 4 
$K W\\^$//0@AJ%:%>Nr=   itemr   c                 *    [        U S   5      nX   U4$ )a  Key function used to sort install requirements for installation.

Based on the "weight" mapping calculated in ``get_installation_order()``.
The canonical package name is returned as the second member as a tie-
breaker to ensure the result is predictable, which is useful in tests.
r   r
   )r   r   rH   s      r;   r   r   5  s     T!W%D=$r=   )=r\   r   loggingrR   typingr   r   r   r   r   r   r	   pip._vendor.packaging.utilsr   pip._vendor.resolvelibr   r   r   r   rT   pip._vendor.resolvelib.structsr   pip._internal.cacher   pip._internal.exceptionsr   "pip._internal.index.package_finderr    pip._internal.operations.preparer   pip._internal.req.constructorsr   pip._internal.req.req_installr   pip._internal.req.req_setr   pip._internal.resolution.baser   r   ,pip._internal.resolution.resolvelib.providerr   ,pip._internal.resolution.resolvelib.reporterr   r   pip._internal.utils.packagingr   baser   r    r7   r!    pip._vendor.resolvelib.resolversr"   RLResultr   	getLoggerr   rh   r   r   r    r=   r;   <module>r      s       	 H H H 9 X X 9 8 * ; < @ D < 4 R D : ( Ck9c12F 
		8	$r2| r2jV)V=@XV	(3-
Vr
''
((3-$% 38_r=   