
    r|CioM                     $   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	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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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*  \(       a  SSK+J,r,  \ RZ                  " \.5      r/\	S   r0\
" \S5      r1S\(S\\0   4S jr2S\S\"S\"4S jr3S\S\"S\"4S jr4S\S\"S\"4S jr5 " S S\(5      r6 " S S\65      r7 " S  S!\65      r8 " S" S#\(5      r9 " S$ S%\(5      r: " S& S'\(5      r;g)(    N)TYPE_CHECKINGAny	FrozenSetIterableOptionalTupleUnioncast)InvalidRequirement)NormalizedNamecanonicalize_name)Version)	HashErrorInstallationSubprocessErrorMetadataInconsistentMetadataInvalid)BaseDistribution)Linklinks_equivalent)Wheel)install_req_from_editableinstall_req_from_line)InstallRequirement)direct_url_from_link)normalize_version_info   )	CandidateRequirementformat_name)Factory)AlreadyInstalledCandidateEditableCandidateLinkCandidatez<Python from Requires-Python>	candidatereturnc                 J    [         [        [        4n[        X5      (       a  U $ g)z%The runtime version of BaseCandidate.N)r!   r"   r#   
isinstance)r$   base_candidate_classess     f/var/www/html/troy/venv/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.pyas_base_candidater*   +   s+     	"
 )44    linktemplatec                    UR                   (       a   S5       eUR                  (       a  [        UR                  5      nOU R                  n[	        UUR
                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9	nUR                  Ul        Xl        UR                  Ul        U$ )Nztemplate is editableuser_supplied
comes_from
use_pep517isolated
constraintglobal_optionshash_optionsconfig_settings)editablereqstrurlr   r0   r1   r2   r3   r4   r5   r6   r7   original_linkr,   extras)r,   r-   lineireqs       r)   make_install_req_from_linkr@   7   s       8"88 ||8<< xx ,,&&&&""&&..** 00
D "//DI//DKKr+   c                 D   UR                   (       d   S5       e[        U R                  UR                  UR                  UR
                  UR                  UR                  UR                  UR                  UR                  UR                  S9
nUR                  Ul        U$ )Nztemplate not editable)	r0   r1   r2   r3   r4   permit_editable_wheelsr5   r6   r7   )r8   r   r;   r0   r1   r2   r3   r4   rB   r5   r6   r7   r=   )r,   r-   r?   s      r)   make_install_req_from_editablerC   P   s     555$,,&&&&""&&'>>..** 00D //DKKr+   distc                    UR                   (       a  [        UR                   5      nORUR                  (       a&  U R                   SUR                  R                   3nOU R                   SU R
                   3n[        UUR                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  S9	nXl        U$ )Nz @ z==r/   )r9   r:   r,   canonical_namer;   versionr   r0   r1   r2   r3   r4   r5   r6   r7   satisfied_by)rD   r-   r>   r?   s       r)   _make_install_req_from_distrI   d   s     ||8<< 	%%&c(--*;*;)<=%%&b7 ,,&&&&""&&..** 00
D Kr+   c                   r   \ rS rSr% Sr\\S'   Sr  S S\S\S\	S	S
S\
\   S\
\   SS4S jjrS\4S jrS\4S jrS\4S jrS\S\4S jr\S\
\   4S j5       r\S\4S j5       r\S\4S j5       r\S\4S j5       rS\4S jrS\4S jrS\SS4S jrS\4S jrS\S\\
\       4S jr!S\
\	   4S jr"Sr#g)!"_InstallRequirementBackedCandidate|   a  A candidate backed by an ``InstallRequirement``.

This represents a package request with the target not being already
in the environment, and needs to be fetched and installed. The backing
``InstallRequirement`` is responsible for most of the leg work; this
class exposes appropriate information to the resolver.

:param link: The link passed to the ``InstallRequirement``. The backing
    ``InstallRequirement`` will use this link to fetch the distribution.
:param source_link: The link this candidate "originates" from. This is
    different from ``link`` when the link is found in the wheel cache.
    ``link`` would point to the wheel cache, while this points to the
    found remote link (e.g. from pypi.org).
rD   FNr,   source_linkr?   factoryr    namerG   r%   c                     Xl         X l        X@l        X0l        XPl        X`l        U R                  5       U l        S U l        g N)	_link_source_link_factory_ireq_name_version_preparerD   _hash)selfr,   rM   r?   rN   rO   rG   s          r)   __init__+_InstallRequirementBackedCandidate.__init__   s7     
'

MMO	$(
r+   c                 8    U R                    SU R                   3$ )N rO   rG   rZ   s    r)   __str__*_InstallRequirementBackedCandidate.__str__   s    ))Adll^,,r+   c                 b    U R                   R                   S[        U R                  5      < S3$ N())	__class____name__r:   rR   r`   s    r)   __repr__+_InstallRequirementBackedCandidate.__repr__   s)    ..))*!C

O+>a@@r+   c                     U R                   b  U R                   $ [        U R                  U R                  45      U l         U R                   $ rQ   )rY   hashrg   rR   r`   s    r)   __hash__+_InstallRequirementBackedCandidate.__hash__   s9    ::!::4>>4::67
zzr+   otherc                 x    [        XR                  5      (       a   [        U R                  UR                  5      $ gNF)r'   rg   r   rR   rZ   ro   s     r)   __eq__)_InstallRequirementBackedCandidate.__eq__   s)    e^^,,#DJJ<<r+   c                     U R                   $ rQ   )rS   r`   s    r)   rM   ._InstallRequirementBackedCandidate.source_link          r+   c                 j    U R                   c  U R                  R                  U l         U R                   $ z:The normalised name of the project the candidate refers to)rV   rD   rF   r`   s    r)   project_name/_InstallRequirementBackedCandidate.project_name   s)     ::11DJzzr+   c                     U R                   $ rQ   rz   r`   s    r)   rO   '_InstallRequirementBackedCandidate.name   rw   r+   c                 j    U R                   c  U R                  R                  U l         U R                   $ rQ   rW   rD   rG   r`   s    r)   rG   *_InstallRequirementBackedCandidate.version   '    ==  II--DM}}r+   c                     U R                    SU R                   SU R                  R                  (       a  U R                  R                  OU R                   S3$ )Nr^   z (from rf   )rO   rG   rR   is_file	file_pathr`   s    r)   format_for_error3_InstallRequirementBackedCandidate.format_for_error   sJ    yyk4<<. )-1ZZ-?-?TZZ))TZZPPQS	
r+   c                     [        S5      e)NzOverride in subclass)NotImplementedErrorr`   s    r)   _prepare_distribution8_InstallRequirementBackedCandidate._prepare_distribution   s    !"899r+   c                 :   U R                   bF  U R                   UR                  :w  a,  [        U R                  SU R                   UR                  5      eU R                  bX  U R                  UR
                  :w  a>  [        U R                  S[        U R                  5      [        UR
                  5      5      e [        UR                  [        UR                  5       5      5      5        g! [         a$  n[        U R                  [        U5      5      eSnAff = f)z:Check for consistency of project name and version of dist.NrO   rG   )rV   rF   r   rU   rW   rG   r:   listiter_dependenciesiter_provided_extrasr   r   )rZ   rD   es      r)   _check_metadata_consistency>_InstallRequirementBackedCandidate._check_metadata_consistency   s    ::!djjD4G4G&G&



##	  ==$$,,)F&

DMM"DLL!	 	6''T-F-F-H(IJK! 	6!$**c!f55	6s   :1C, ,
D6DDc                      U R                  5       nU R                  U5        U$ ! [         a  nU R                  Ul        e S nAf[         a  nSUl        e S nAff = f)NzSee above for output.)r   r   rU   r9   r   contextr   )rZ   rD   r   excs       r)   rX   +_InstallRequirementBackedCandidate._prepare   s_    	--/D 	((.  	 JJAE* 	1CK	s    % 
AAAAAwith_requiresc              #   8  #    U(       a  U R                   R                  5       OSnU H:  nU R                  R                  [	        U5      U R
                  5       S h  vN   M<     U R                  R                  U R                   R                  5      v   g  N:7fN )rD   r   rT   make_requirements_from_specr:   rU    make_requires_python_requirementrequires_python)rZ   r   requiresrs       r)   r   4_InstallRequirementBackedCandidate.iter_dependencies   sl     4A499..0rA}}@@QTTT mm<<TYY=V=VWW Us   ABB;Bc                     U R                   $ rQ   )rU   r`   s    r)   get_install_requirement:_InstallRequirementBackedCandidate.get_install_requirement   s    zzr+   )rT   rY   rU   rR   rV   rS   rW   rD   NN)$rh   
__module____qualname____firstlineno____doc__r   __annotations__is_installedr   r   r   r   r   r[   r:   ra   ri   intrm   r   boolrs   propertyrM   rz   rO   rG   r   r   r   rX   r   r   r   r   __static_attributes__r   r+   r)   rK   rK   |   s    L *.%))) ) !	)
 ) ~&) '") 
)$- -A# A# C D 
 !Xd^ ! ! n   !c ! !   

# 
:'7 :60@ 6T 60* "Xt X+AV8W X2D)E r+   rK   c                   j   ^  \ rS rSrSr  SS\S\SSS\\   S	\\	   S
S4U 4S jjjr
S
\4S jrSrU =r$ )r#   i  FNr,   r-   rN   r    rO   rG   r%   c           	        > UnUR                  Xd5      nUb,  [        R                  SUR                  5        UR                  n[	        X5      nUR                  U:X  d   eUR                  R
                  (       a  UR                  R                  (       dv  [        UR                  R                  5      n	[        U	R                  5      n
XJ:X  d   U< SU
< S35       eUb+  [        U	R                  5      nX[:X  d   U< SU< SU 35       eUb  UR                  R
                  (       d   eUR                  R                  (       d   eUR                  (       a  UR                  UR                  L a  Xhl        UR                   b  UR                   Ul        O[%        XgR                  S9Ul        [&        TU ]Q  UUUUUUS9  g )NzUsing cached wheel link: %sz != z
 for wheelz for wheel )link_is_in_wheel_cacher,   rM   r?   rN   rO   rG   )get_wheel_cache_entryloggerdebugr,   r@   is_wheelr   r   filenamer   rO   r   rG   
persistentr<   cached_wheel_source_linkorigindownload_infor   superr[   )rZ   r,   r-   rN   rO   rG   rM   cache_entryr?   wheel
wheel_namewheel_versionrg   s               r)   r[   LinkCandidate.__init__  s    33KF"LL68H8HI##D)$9yyD   99dii&7&7$)),,-E*5::6J%N$j^:'NN%" ' 6,H[]$5[GH, "99%%%%99$$$$%%(--8;Q;Q*Q0;-!!-%0%7%7" &:8N8N&" 	# 	 	
r+   c                 b    U R                   R                  nUR                  U R                  SS9$ )NT)parallel_builds)rT   preparerprepare_linked_requirementrU   )rZ   r   s     r)   r   #LinkCandidate._prepare_distribution8  s+    ==))224::t2TTr+   r   r   rh   r   r   r   is_editabler   r   r   r   r   r[   r   r   r   __classcell__rg   s   @r)   r#   r#     st    K *.%)/
/
 %/
 	/

 ~&/
 '"/
 
/
 /
bU'7 U Ur+   r#   c                   j   ^  \ rS rSrSr  SS\S\SSS\\   S	\\	   S
S4U 4S jjjr
S
\4S jrSrU =r$ )r"   i=  TNr,   r-   rN   r    rO   rG   r%   c           	      <   > [         TU ]  UU[        X5      UUUS9  g )Nr   )r   r[   rC   )rZ   r,   r-   rN   rO   rG   rg   s         r)   r[   EditableCandidate.__init__@  s.     	/? 	 	
r+   c                 `    U R                   R                  R                  U R                  5      $ rQ   )rT   r   prepare_editable_requirementrU   r`   s    r)   r   'EditableCandidate._prepare_distributionQ  s!    }}%%BB4::NNr+   r   r   r   r   s   @r)   r"   r"   =  ss    K *.%)

 %
 	

 ~&
 '"
 

 
"O'7 O Or+   r"   c                      \ rS rSrSrSrS\S\SSSS4S	 jrS\	4S
 jr
S\	4S jrS\S\4S jrS\4S jr\S\4S j5       r\S\	4S j5       r\S\4S j5       r\S\4S j5       rS\	4S jrS\S\\\      4S jrS\\   4S jrSrg)r!   iU  TNrD   r-   rN   r    r%   c                     Xl         [        X5      U l        X0l        S U l        SnUR
                  R                  U R                  U5        g )Nzalready satisfied)rD   rI   rU   rT   rW   r   prepare_installed_requirement)rZ   rD   r-   rN   skip_reasons        r)   r[   "AlreadyInstalledCandidate.__init__Y  sB     	0@
 *66tzz;Or+   c                 ,    [        U R                  5      $ rQ   )r:   rD   r`   s    r)   ra   !AlreadyInstalledCandidate.__str__k  s    499~r+   c                 P    U R                   R                   SU R                  < S3$ rd   )rg   rh   rD   r`   s    r)   ri   "AlreadyInstalledCandidate.__repr__n  s$    ..))*!DII=::r+   ro   c                     [        U[        5      (       d  [        $ U R                  UR                  :H  =(       a    U R                  UR                  :H  $ rQ   )r'   r!   NotImplementedrO   rG   rr   s     r)   rs    AlreadyInstalledCandidate.__eq__q  s;    %!:;;!!yyEJJ&H4<<5==+HHr+   c                 D    [        U R                  U R                  45      $ rQ   )rl   rO   rG   r`   s    r)   rm   "AlreadyInstalledCandidate.__hash__v  s    TYY-..r+   c                 .    U R                   R                  $ rQ   )rD   rF   r`   s    r)   rz   &AlreadyInstalledCandidate.project_namey  s    yy'''r+   c                     U R                   $ rQ   r}   r`   s    r)   rO   AlreadyInstalledCandidate.name}  rw   r+   c                 j    U R                   c  U R                  R                  U l         U R                   $ rQ   r   r`   s    r)   rG   !AlreadyInstalledCandidate.version  r   r+   c                 .    U R                   R                  $ rQ   )rD   r8   r`   s    r)   r   %AlreadyInstalledCandidate.is_editable  s    yy!!!r+   c                 :    U R                    SU R                   S3$ )Nr^   z (Installed)r_   r`   s    r)   r   *AlreadyInstalledCandidate.format_for_error  s    ))Adll^<88r+   r   c              #      #    U(       d  g U R                   R                  5        H:  nU R                  R                  [	        U5      U R
                  5       S h  vN   M<     g  N	7frQ   )rD   r   rT   r   r:   rU   )rZ   r   r   s      r)   r   +AlreadyInstalledCandidate.iter_dependencies  sG     ,,.A}}@@QTTT /Ts   AA&A$
A&c                     g rQ   r   r`   s    r)   r   1AlreadyInstalledCandidate.get_install_requirement      r+   )rT   rU   rW   rD   )rh   r   r   r   r   rM   r   r   r[   r:   ra   ri   objectr   rs   r   rm   r   r   rz   rO   r   rG   r   r   r   r   r   r   r   r   r   r+   r)   r!   r!   U  s    LKPP %P 	P
 
P$ ;# ;IF It I
/# / (n ( ( !c ! !   
 "T " "9# 9Ut U+AV8W U2D)E r+   r!   c            	       X   \ rS rSrSrSS.S\S\\   S\\	   SS4S	 jjr
S\4S
 jrS\4S jrS\4S jrS\S\4S jr\S\4S j5       r\S\4S j5       r\S\4S j5       rS\4S jr\S\4S j5       r\S\4S j5       r\S\\   4S j5       rS\S\\\      4S jrS\\	   4S jr Sr!g)ExtrasCandidatei  a  A candidate that has 'extras', indicating additional dependencies.

Requirements can be for a project with dependencies, something like
foo[extra].  The extras don't affect the project/version being installed
directly, but indicate that we need additional dependencies. We model that
by having an artificial ExtrasCandidate that wraps the "base" candidate.

The ExtrasCandidate differs from the base in the following ways:

1. It has a unique name, of the form foo[extra]. This causes the resolver
   to treat it as a separate node in the dependency graph.
2. When we're getting the candidate's dependencies,
   a) We specify that we want the extra dependencies as well.
   b) We add a dependency on the base candidate.
      See below for why this is needed.
3. We return None for the underlying InstallRequirement, as the base
   candidate will provide it, and we don't want to end up with duplicates.

The dependency on the base candidate is needed so that the resolver can't
decide that it should recommend foo[extra1] version 1.0 and foo[extra2]
version 2.0. Having those candidates depend on foo=1.0 and foo=2.0
respectively forces the resolver to recognise that this is a conflict.
N)r1   baser=   r1   r%   c                    Xl         [        S U 5       5      U l        Ub  X0l        gU R                   R                  U l        g)a  
:param comes_from: the InstallRequirement that led to this candidate if it
    differs from the base's InstallRequirement. This will often be the
    case in the sense that this candidate's requirement has the extras
    while the base's does not. Unlike the InstallRequirement backed
    candidates, this requirement is used solely for reporting purposes,
    it does not do any leg work.
c              3   6   #    U H  n[        U5      v   M     g 7frQ   )r   ).0r   s     r)   	<genexpr>+ExtrasCandidate.__init__.<locals>.<genexpr>  s     Ef 1! 4 4f   N)r   	frozensetr=   rU   _comes_from)rZ   r   r=   r1   s       r)   r[   ExtrasCandidate.__init__  s5     	EfEE)3)?:TYY__r+   c                     [        U R                  5      R                  SS5      u  pSR                  USR	                  U R
                  5      U5      $ )Nr^   r   z	{}[{}] {},)r:   r   splitformatjoinr=   )rZ   rO   rests      r)   ra   ExtrasCandidate.__str__  s@    ^))#q1
!!$(=tDDr+   c                 l    U R                   R                   SU R                  < SU R                  < S3$ )Nz(base=z	, extras=rf   )rg   rh   r   r=   r`   s    r)   ri   ExtrasCandidate.__repr__  s/    ..))*&Yt{{oUVWWr+   c                 D    [        U R                  U R                  45      $ rQ   )rl   r   r=   r`   s    r)   rm   ExtrasCandidate.__hash__  s    TYY,--r+   ro   c                     [        XR                  5      (       a9  U R                  UR                  :H  =(       a    U R                  UR                  :H  $ grq   )r'   rg   r   r=   rr   s     r)   rs   ExtrasCandidate.__eq__  s9    e^^,,99

*Jt{{ell/JJr+   c                 .    U R                   R                  $ rQ   )r   rz   r`   s    r)   rz   ExtrasCandidate.project_name      yy%%%r+   c                 V    [        U R                  R                  U R                  5      $ ry   )r   r   rz   r=   r`   s    r)   rO   ExtrasCandidate.name  s     499114;;??r+   c                 .    U R                   R                  $ rQ   )r   rG   r`   s    r)   rG   ExtrasCandidate.version  s    yy   r+   c                     SR                  U R                  R                  5       SR                  [	        U R
                  5      5      5      $ )Nz{} [{}]z, )r   r   r   r   sortedr=   r`   s    r)   r    ExtrasCandidate.format_for_error  s9    II&&($))F4;;4G*H
 	
r+   c                 .    U R                   R                  $ rQ   )r   r   r`   s    r)   r   ExtrasCandidate.is_installed  r
  r+   c                 .    U R                   R                  $ rQ   )r   r   r`   s    r)   r   ExtrasCandidate.is_editable      yy$$$r+   c                 .    U R                   R                  $ rQ   )r   rM   r`   s    r)   rM   ExtrasCandidate.source_link  r  r+   r   c              #     #    U R                   R                  nUR                  U R                   5      v   U(       d  g U R                  R	                  U R                   R
                  R                  5       5      nU R                  R                  U R                   R
                  R                  5       5      n[        U5       H9  n[        R                  SU R                   R                  U R                  U5        M;     U R                   R
                  R                  U5       H1  nUR                  [        U5      U R                   U5       S h  vN   M3     g  N	7f)Nz%%s %s does not provide the extra '%s')r   rT   make_requirement_from_candidater=   intersectionrD   r   
differencer  r   warningrO   rG   r   r   r:   r   )rZ   r   rN   valid_extrasinvalid_extrasextrar   s          r)   r   !ExtrasCandidate.iter_dependencies  s     ))$$ 55dii@@ {{//		0S0S0UV//		0S0S0UVN+ENN7			 , 11,?A::A     @s   EEE
Ec                     g rQ   r   r`   s    r)   r   'ExtrasCandidate.get_install_requirement  s     r+   )r   r   r=   )"rh   r   r   r   r   BaseCandidater   r:   r   r   r[   ra   ri   r   rm   r   r   rs   r   r   rz   rO   r   rG   r   r   r   r   rM   r   r   r   r   r   r   r+   r)   r   r     se   : 48UU #U
 /0U 
U&E EX# X.# .C D 
 &n & & @c @ @ ! ! !
# 

 &d & & %T % % %Xd^ % %t +AV8W 82D)E r+   r   c                       \ rS rSrSrSrS\\\S4      SS4S jr	S\
4S jr\S\4S	 j5       r\S\
4S
 j5       r\S\4S j5       rS\
4S jrS\S\\\      4S jrS\\   4S jrSrg)RequiresPythonCandidatei  FNpy_version_info.r%   c                     Ub  [        U5      nO[        R                  S S n[        SR	                  S U 5       5      5      U l        g )N   .c              3   6   #    U H  n[        U5      v   M     g 7frQ   )r:   )r   cs     r)   r   3RequiresPythonCandidate.__init__.<locals>.<genexpr>  s     (FAQr   )r   sysversion_infor   r   rW   )rZ   r'  r/  s      r)   r[    RequiresPythonCandidate.__init__  s?    &1/BL++BQ/L(F(F FGr+   c                      SU R                    3$ NzPython rW   r`   s    r)   ra   RequiresPythonCandidate.__str__#  s    ((r+   c                     [         $ rQ   REQUIRES_PYTHON_IDENTIFIERr`   s    r)   rz   $RequiresPythonCandidate.project_name&      ))r+   c                     [         $ rQ   r6  r`   s    r)   rO   RequiresPythonCandidate.name*  r9  r+   c                     U R                   $ rQ   r3  r`   s    r)   rG   RequiresPythonCandidate.version.  s    }}r+   c                      SU R                    3$ r2  )rG   r`   s    r)   r   (RequiresPythonCandidate.format_for_error2  s    ''r+   r   c                     gr   r   )rZ   r   s     r)   r   )RequiresPythonCandidate.iter_dependencies5  s    r+   c                     g rQ   r   r`   s    r)   r   /RequiresPythonCandidate.get_install_requirement8  r   r+   r3  )rh   r   r   r   r   rM   r   r   r   r[   r:   ra   r   r   rz   rO   r   rG   r   r   r   r   r   r   r   r   r   r+   r)   r&  r&    s    LKHsCx(A Hd H) ) *n * * *c * *   (# (t +AV8W 2D)E r+   r&  )<loggingr.  typingr   r   r   r   r   r   r	   r
   "pip._vendor.packaging.requirementsr   pip._vendor.packaging.utilsr   r   pip._vendor.packaging.versionr   pip._internal.exceptionsr   r   r   r   pip._internal.metadatar   pip._internal.models.linkr   r   pip._internal.models.wheelr   pip._internal.req.constructorsr   r   pip._internal.req.req_installr   &pip._internal.utils.direct_url_helpersr   pip._internal.utils.miscr   r   r   r   r   rN   r    	getLoggerrh   r   r$  r7  r*   r@   rC   rI   rK   r#   r"   r!   r   r&  r   r+   r)   <module>rR     sD    
 X X X A I 1  4 < , = G ; 5 5 			8	$ ".2QR 	 	x/F 	
,2
,(
&80E EP6U6 6UrO: O0@	 @Fyi yx%i %r+   