
    q"h^              	          S r SSKrSSKrSSKJr  SSKJr  SSKJrJ	r	J
r
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JrJrJr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'J(r(  SSK)J*r*  SSK+J,r,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  SSK4J5r5  SSK6J7r7  SSK8J9r9  \Rt                  " \;5      r<\\\=   \
\'   4   r> SS\S\\?\?\?4   S\@SS4S jjrA " S S\,5      rBg) ay  Dependency Resolution

The dependency resolution in pip is performed as follows:

for top-level requirements:
    a. only one spec allowed per project, regardless of conflicts or not.
       otherwise a "double requirement" exception is raised
    b. they override sub-dependency requirements.
for sub-dependencies
    a. "first found, wins" (where the order is breadth first)
    N)defaultdict)chain)DefaultDictIterableListOptionalSetTuple)
specifiers)Requirement)
WheelCache)BestVersionAlreadyInstalledDistributionNotFound	HashError
HashErrorsInstallationErrorNoneMetadataErrorUnsupportedPythonVersion)PackageFinder)BaseDistribution)Link)Wheel)RequirementPreparer)InstallRequirementcheck_invalid_constraint_type)RequirementSet)BaseResolverInstallRequirementProvider)compatibility_tags)get_supported)direct_url_from_link)
indent_log)normalize_version_info)check_requires_pythondistversion_infoignore_requires_pythonreturnc                     [        U R                  5      n [	        UUS9nU(       a  gSR                  [        [         U5      5      nU(       a#  [        R                  SU R                  UU5        g[        SU R                  < SU SU< 35      e! [         a  n[        U [        U5      5      eSnAff = f! [
        R                   a+  n[        R                  SU R                  U5         SnAgSnAff = f)	a  
Check whether the given Python version is compatible with a distribution's
"Requires-Python" value.

:param version_info: A 3-tuple of ints representing the Python
    major-minor-micro version to check.
:param ignore_requires_python: Whether to ignore the "Requires-Python"
    value if the given Python version isn't compatible.

:raises UnsupportedPythonVersion: When the given Python version isn't
    compatible.
N)r&   z-Package %r has an invalid Requires-Python: %s.zBIgnoring failed Requires-Python check for package %r: %s not in %rzPackage z requires a different Python: z not in )strrequires_pythonFileNotFoundErrorr   r$   r   InvalidSpecifierloggerwarningraw_namejoinmapdebugr   )r%   r&   r'   r,   eis_compatibleexcversions           Z/var/www/html/env/lib/python3.13/site-packages/pip/_internal/resolution/legacy/resolver.py_check_dist_requires_pythonr:   7   s    (.d223	-%
 hhs3-.GPMM		
 	
"
4==##A)8O.	0 5  .c!f--. && ;T]]C	
 		s.   B 
B: 
B7B22B7:C9!C44C9c                     ^  \ rS rSrSr1 Skr S'S\S\S\\	   S\
S	\S
\S\S\S\S\S\\\S4      SS4U 4S jjjrS\\   S\S\4S jr  S(S\S\S\\   S\\\      S\\\   \\   4   4
S jjrS\S\4S jrS\SS4S jrS\S\\   4S jrS\S\\   4S  jrS\SS4S! jrS\S\4S" jrS\S\S\\   4S# jrS$\S\\   4S% jrS&r U =r!$ ))Resolverm   zResolves which packages need to be installed/uninstalled to perform     the requested operation without breaking the requirements of any package.
    >   eageronly-if-neededto-satisfy-onlyNpreparerfinderwheel_cachemake_install_requse_user_siteignore_dependenciesignore_installedr'   force_reinstallupgrade_strategypy_version_info.r(   c                 4  > [         TU ]  5         XR                  ;   d   eUc  [        R                  S S nO[        U5      nXl        Xl        X l        X0l	        Xl
        Xl        X`l        Xpl        Xl        XPl        X@l        [#        [$        5      U l        g )N   )super__init___allowed_strategiessysr&   r#   _py_version_inforA   rB   rC   rI   rH   rF   rG   r'   rE   _make_install_reqr   list_discovered_dependencies)selfrA   rB   rC   rD   rE   rF   rG   r'   rH   rI   rJ   	__class__s               r9   rN   Resolver.__init__t   s     	#;#;;;;"!..r2O4_EO / & 0.#6  0&<#*!1@KD@Q%    	root_reqscheck_supported_wheelsc                    [        US9nU H0  nUR                  (       a  [        U5        U R                  X45        M2     / n[	        5       n[        UR                  U5       H$  n UR                  U R                  X45      5        M&     U(       a  UeU$ ! [         a"  nXGl
        UR                  U5         SnAMZ  SnAff = f)ay  Resolve what operations need to be done

As a side-effect of this method, the packages (and their dependencies)
are downloaded, unpacked and prepared for installation. This
preparation is done by ``pip.operations.prepare``.

Once PyPI has static dependency metadata available, it would be
possible to move the preparation to become a step separated from
dependency resolution.
)rZ   N)r   
constraintr   _add_requirement_to_setr   r   all_requirementsextend_resolve_oner   reqappend)rU   rY   rZ   requirement_setra   discovered_reqshash_errorsr7   s           r9   resolveResolver.resolve   s     )@VWC~~-c2((>  57 l99?KC(&&t'8'8'NO L   (""3''(s   & B
CB<<Crc   install_reqparent_req_nameextras_requestedc           	         UR                  U5      (       d/  [        R                  SUR                  UR                  5        / S4$ UR
                  (       a  UR
                  R                  (       as  [        UR
                  R                  5      n[        R                  " 5       nUR                  (       a.  UR                  U5      (       d  [        UR                   S35      eUR                  (       a
  Ub   S5       eUR                  (       d  UR                  U5        U/S4$  UR!                  UR                  5      nUSL =(       a    U=(       a    UR$                  (       + =(       as    UR&                  UR&                  :H  =(       aS    UR(                  =(       a@    UR(                  =(       a-    UR(                  R*                  UR(                  R*                  :g  nU(       a   [        SU SU SUR                  < S35      eU(       d  UR-                  U5        U/U4$ UR$                  (       d  UR$                  (       d  / U4$ UR
                  =(       aE    UR
                  =(       a-    UR
                  R.                  UR
                  R.                  :H  (       + n	U	(       a  [        S	UR                   S
35      eSUl        UR                  (       a  SUl        [1        [3        [5        UR&                  5      [5        UR&                  5      -  5      5      Ul        [        R7                  SUUR&                  5        U/U4$ ! ["         a    Sn GNf = f)a  Add install_req as a requirement to install.

:param parent_req_name: The name of the requirement that needed this
    added. The name is used because when multiple unnamed requirements
    resolve to the same name, we could otherwise end up with dependency
    links that point outside the Requirements set. parent_req must
    already be added. Note that None implies that this is a user
    supplied requirement, vs an inferred one.
:param extras_requested: an iterable of extras used to evaluate the
    environment markers.
:return: Additional requirements to scan. That is either [] if
    the requirement is not applicable, or [install_req] if the
    requirement is applicable and has just been added.
z6Ignoring %s: markers '%s' don't match your environmentNz+ is not a supported wheel on this platform.z+a user supplied req shouldn't have a parentzDouble requirement given: z (already in z, name=)z#Could not satisfy constraints for 'zC': installation from path or url cannot be constrained to a versionFTzSetting %s extras to: %s)match_markersr/   infonamemarkerslinkis_wheelr   filenamer   r    rZ   	supportedr   user_suppliedadd_unnamed_requirementget_requirementKeyErrorr\   extrasra   	specifieradd_named_requirementpathtuplesortedsetr4   )
rU   rc   rh   ri   rj   wheeltagsexisting_reqhas_conflicting_requirementdoes_not_satisfy_constraints
             r9   r]    Resolver._add_requirement_to_set   s   , (()9::KKH  ##
 t8O  0 0 9 9+**334E%335D55eood>S>S'~~&&QR  ))_-D	98	9D
 33K@=$&&	 //0@0@A  t# HH +++H ##{'9'99H   	H
 H   **koo.G.GG 	$ '#,[M :+nGK4D4D3GqJ  11+>=+-- !!)@)@|##&1&6&6 '
Q+"2"2"7"7<;L;L;Q;Q"Q<
# '#5k6F6F5G H+ +  #( $$)-L&#3|**+c+2D2D.EEF
 	&	
 ~|++q  	 L	 s   (M MMra   c                     U R                   S:X  a  gU R                   S:X  a  gU R                   S:X  d   eUR                  =(       d    UR                  $ )Nr@   Fr>   Tr?   )rI   ru   r\   rU   ra   s     r9   _is_upgrade_allowedResolver._is_upgrade_allowed2  sO      $55""g-((,<<<<$$66rX   c                     UR                   c   eU R                  (       a  UR                   R                  (       a  SUl        SUl         g)z$
Set a requirement to be installed.
NT)satisfied_byrE   in_usersiteshould_reinstallr   s     r9   _set_req_to_reinstallResolver._set_req_to_reinstall;  s=     +++!!S%5%5%A%A#'C rX   req_to_installc                    U R                   (       a  gUR                  U R                  5        UR                  (       d  gU R                  (       a  U R                  U5        gU R                  U5      (       d  U R                  S:X  a  ggUR                  (       d   U R                  R                  USS9  U R                  U5        g! [         a     g[         a     N)f = f)a  Check if req_to_install should be skipped.

This will check if the req is installed, and whether we should upgrade
or reinstall it, taking into account all the relevant user options.

After calling this req_to_install will only have satisfied_by set to
None if the req_to_install is to be upgraded/reinstalled etc. Any
other value will be a dist recording the current thing installed that
satisfies the requirement.

Note that for vcs urls and the like we can't assess skipping in this
routine - we simply identify that we need to pull the thing down,
then later on it is pulled down and introspected to assess upgrade/
reinstalls etc.

:return: A text reason for why it was skipped, or None.
Nr?   z#already satisfied, skipping upgradezalready satisfiedT)upgradezalready up-to-date)rG   check_if_existsrE   r   rH   r   r   rI   rq   rB   find_requirementr   r   )rU   r   s     r9   _check_skip_installedResolver._check_skip_installedF  s    (   &&t'9'9:**&&~6''77$$(88<&
 ""	,,^T,J 	"">2 / ,+'  	s   C	 	
C!	C! C!c                    U R                  U5      nU R                  R                  X5      nU(       d  g UR                  nUR                  (       a2  UR
                  =(       d    SnSU SU 3n[        R                  U5        U$ )Nz<none given>zDThe candidate selected for download or install is a yanked version: z
Reason for being yanked: )r   rB   r   rq   	is_yankedyanked_reasonr/   r0   )rU   ra   r   best_candidaterq   reasonmsgs          r9   _find_requirement_linkResolver._find_requirement_link|  s    **3/55cC "">>''9>F
##1"2 3,,285	  NN3rX   c                    UR                   c  U R                  U5      Ul         U R                  b  U R                  R                  (       a  gUR                   c   S5       eU R                  R                  UR                   UR                  [        5       S9nUb  [        R                  SUR                   5        UR                   UR                  L a"  UR                  (       a  UR                   Ul        UR                  b  UR                  Ul        O#[        UR                   UR                  S9Ul        UR                   Ul         gg)a  Ensure that if a link can be found for this, that it is found.

Note that req.link may still be None - if the requirement is already
installed and not needed to be upgraded based on the return value of
_is_upgrade_allowed().

If preparer.require_hashes is True, don't use the wheel cache, because
cached wheels, always built locally, have different hashes than the
files downloaded from the index server and thus throw false hash
mismatches. Furthermore, cached wheels at present have undeterministic
contents due to file modification times.
Nz1_find_requirement_link unexpectedly returned None)rq   package_namesupported_tagszUsing cached wheel link: %s)link_is_in_wheel_cache)rq   r   rC   rA   require_hashesget_cache_entryro   r    r/   r4   original_link
persistentcached_wheel_source_linkorigindownload_infor!   )rU   ra   cache_entrys      r9   _populate_linkResolver._populate_link  s    882237CH#t}}'C'Cxx#X%XX#&&66(? 7 

 "LL68H8HIxx3,,,1G1G/2xx,!!-$/$6$6! %9HH[5K5K%! #''CH #rX   c                    UR                   (       a  U R                  R                  U5      $ UR                  b   eU R	                  U5      nUR                  (       a  U R                  R                  X5      $ U R                  U5        U R                  R                  U5      nU R                  (       d  UR                  U R                  5        UR                  (       a  U R                  S:g  =(       d?    U R                  =(       d,    U R                  =(       d    UR                  R                  S:H  nU(       a  U R                  U5        U$ [         R#                  SU5        U$ )zzTakes a InstallRequirement and returns a single AbstractDist         representing a prepared variant of the same.
        r@   filez<Requirement already satisfied (use --upgrade to upgrade): %s)editablerA   prepare_editable_requirementr   r   prepare_installed_requirementr   prepare_linked_requirementrG   r   rE   rI   rH   rq   schemer   r/   rn   )rU   ra   skip_reasonr%   should_modifys        r9   _get_dist_forResolver._get_dist_for  s*    <<====cBB '''005==>>sPP 	C }}77< $$ 2 23%%):: -''-((- 88??f,	  **3/ 	 R rX   c                 "  ^ ^^^	 TR                   (       d  TR                  (       a  / $ STl        T R                  T5      n[        UT R                  T R
                  S9  / m	S[        S[        [           SS4U	UUU 4S jjn[        5          TR                  c   eTR                  TR                  5      (       d$  TR                  (       d   eT R                  TTSS9  T R                  (       Gd  TR                  (       a/  [         R#                  S	S
R%                  TR                  5      5        ['        [)        TR                  5      [)        UR+                  5       5      -
  5      nU H/  n[         R-                  SUR.                  UR0                  U5        M1     ['        [)        UR+                  5       5      [)        TR                  5      -  5      nUR3                  U5       H	  nU" XS9  M     SSS5        T	$ ! , (       d  f       T	$ = f)zhPrepare a single requirements file.

:return: A list of additional InstallRequirements to also install.
T)r&   r'   subreqrj   r(   Nc                    > T	R                  [        U 5      T5      nTR                  nT	R                  TUUUS9u  pEU(       a%  U(       a  T	R                  U   R                  U5        TR                  U5        g )N)ri   rj   )rR   r+   ro   r]   rT   rb   r_   )
r   rj   sub_install_reqri   to_scan_againadd_to_parent	more_reqsr   rc   rU   s
         r9   add_req&Resolver._resolve_one.<locals>.add_req  sy     #44S[.QO,11O+/+G+G /!1	 ,H ,(M =--o>EEmT]+rX   )ri   z!Installing extra requirements: %r,z%%s %s does not provide the extra '%s')rj   )r\   preparedr   r:   rQ   r'   r   r   r+   r"   ro   has_requirementru   r]   rF   ry   r/   r4   r2   r~   r   iter_provided_extrasr0   r1   r8   iter_dependencies)
rU   rc   r   r%   r   missing_requestedmissingavailable_requestedr   r   s
   ```      @r9   r`   Resolver._resolve_one  s    $$(?(?I"& !!.1 	$..#'#>#>	
 /1		,K 	,8C= 	,T 	, 	,  \ "&&222"22>3F3FGG &3333,,#^T -  +++!((LL;!6!67 %+--.T5N5N5P1QQ%!  1GNN?	  1 '-1134s>;P;P7QQ'# #445HIFFI JC H I \H s   E)G??
Hreq_setc                    ^ ^^^ / m[        5       mS[        SS4UUUU 4S jjmUR                  R                  5        H  nT" U5        M     T$ )zCreate the installation order.

The installation order is topological - requirements are installed
before the requiring thing. We break cycles at an arbitrary point,
and make no other guarantees.
ra   r(   Nc                    > U R                   (       d  U T;   a  g U R                  (       a  g TR                  U 5        TR                  U R                      H  nT" U5        M     TR                  U 5        g N)r   r\   addrT   ro   rb   )ra   deporderordered_reqsschedulerU   s     r9   r   1Resolver.get_installation_order.<locals>.scheduleI  sZ    3,#6~~S!44SXX> ?LLrX   )r   r   requirementsvalues)rU   r   rh   r   r   r   s   `  @@@r9   get_installation_orderResolver.get_installation_order:  sR     03	, 	 	 	 #//668K[! 9rX   )rT   rR   rQ   rB   rH   rF   rG   r'   rA   rI   rE   rC   r   )NN)"__name__
__module____qualname____firstlineno____doc__rO   r   r   r   r   r   boolr+   r
   intrN   r   r   r   rf   r   r]   r   r   r   r   r   r   r   r   r`   r   __static_attributes____classcell__)rV   s   @r9   r<   r<   m   s    I 6:$R%$R $R j)	$R
 5$R $R "$R $R !%$R $R $R "%S/2$R 
$R $RL#01#KO#	#R *.48q,'q, (q, "#	q,
 #8C=1q, 
t&'2D)EE	Fq,f7'9 7d 7	 ); 	  	 404	#4l*< $ ,%("4 %( %(N,!3 ,8H ,\Q'Q +Q 
 	!	Qf%	 	! rX   r<   )F)Cr   loggingrP   collectionsr   	itertoolsr   typingr   r   r   r   r	   r
   pip._vendor.packagingr   "pip._vendor.packaging.requirementsr   pip._internal.cacher   pip._internal.exceptionsr   r   r   r   r   r   r   "pip._internal.index.package_finderr   pip._internal.metadatar   pip._internal.models.linkr   pip._internal.models.wheelr    pip._internal.operations.preparer   pip._internal.req.req_installr   r   pip._internal.req.req_setr   pip._internal.resolution.baser   r   pip._internal.utilsr   &pip._internal.utils.compatibility_tagsr    &pip._internal.utils.direct_url_helpersr!   pip._internal.utils.loggingr"   pip._internal.utils.miscr#   pip._internal.utils.packagingr$   	getLoggerr   r/   r+   DiscoveredDependenciesr   r   r:   r<    rX   r9   <module>r      s   
  
 #  D D , : *   = 3 * , @ 5 R 2 @ G 2 ; ?			8	$$Xc]D9K4L%LM  $)3
3S#&3 !3 
	3lh| hrX   