
    jQ                    .   S SK Jr  S SKrS SK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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.  \R^                  " \05      r1\	S   r2\
" \S5      r3S%S jr4 S&       S'S jjr5      S(S jr6      S)S jr7 " S S\*5      r8 " S S\85      r9 " S S\85      r: " S S \*5      r; " S! S"\*5      r< " S# S$\*5      r=g)*    )annotationsN)Iterable)TYPE_CHECKINGAnyUnioncast)InvalidRequirement)NormalizedNamecanonicalize_name)Version)FailedToPrepareCandidate	HashErrorInstallationSubprocessErrorInvalidInstalledPackage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>c                J    [         [        [        4n[        X5      (       a  U $ g)z%The runtime version of BaseCandidate.N)r!   r"   r#   
isinstance)	candidatebase_candidate_classess     /root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/candidates.pyas_base_candidater)   0   s+     	"
 )44    c           
        UR                   (       a   S5       eUb>  UR                  (       a-  UR                  (       a  UR                  R                   SU 3nO3UR                  (       a  [	        UR                  5      nOU R
                  n[        U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isolated
constrainthash_optionsconfig_settings)editablereqr2   namestrurlr   r.   r/   r0   r1   r3   original_linklinkextras)r:   templateversionlineireqs        r(   make_install_req_from_linkr@   <   s    
   8"88 x||0E0E ,,##$Bwi0	8<< xx ,,&&""&&** 00D "//DI//DKKr*   c                v   UR                   (       d   S5       eUR                  (       a  UR                   SU R                   3nOU R                  n[        U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 @ )r.   r/   r0   r1   permit_editable_wheelsr2   r3   )r4   r6   r8   r   r.   r/   r0   r1   rC   r2   r3   r;   )r:   r<   
req_stringr?   s       r(   make_install_req_from_editablerE   Z   s     555}} c$((4
XX
$,,&&""&&'>>** 00	D //DKKr*   c           
        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                  S9nXl        U$ )NrB   r,   r-   )r5   r7   r:   canonical_namer8   r=   r   r.   r/   r0   r1   r2   r3   satisfied_by)distr<   r>   r?   s       r(   _make_install_req_from_distrJ   p   s     ||8<< 	%%&c(--*;*;)<=%%&b7 ,,&&""&&** 00D Kr*   c                     \ rS rSr% SrS\S'   Sr  S             SS jjrSS jrSS	 jr	SS
 jr
SS jr\SS j5       r\SS j5       r\SS j5       r\SS j5       rSS jrSS jrS S jrSS jrS!S jrS"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).
r   rI   FNc                    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_preparerI   _hash)selfr:   source_linkr?   factoryr6   r=   s          r(   __init__+_InstallRequirementBackedCandidate.__init__   s7     
'

MMO	!%
r*   c                8    U R                    SU R                   3$ )N r6   r=   rX   s    r(   __str__*_InstallRequirementBackedCandidate.__str__   s    ))Adll^,,r*   c                b    U R                   R                   S[        U R                  5      < S3$ N())	__class____name__r7   rP   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                   $ rO   )rW   hashrg   rP   r`   s    r(   __hash__+_InstallRequirementBackedCandidate.__hash__   s9    ::!::4>>4::67
zzr*   c                x    [        XR                  5      (       a   [        U R                  UR                  5      $ gNF)r%   rg   r   rP   rX   others     r(   __eq__)_InstallRequirementBackedCandidate.__eq__   s)    e^^,,#DJJ<<r*   c                    U R                   $ rO   )rQ   r`   s    r(   rY   ._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)rT   rI   rG   r`   s    r(   project_name/_InstallRequirementBackedCandidate.project_name   s)     ::11DJzzr*   c                    U R                   $ rO   rz   r`   s    r(   r6   '_InstallRequirementBackedCandidate.name   rw   r*   c                j    U R                   c  U R                  R                  U l         U R                   $ rO   rU   rI   r=   r`   s    r(   r=   *_InstallRequirementBackedCandidate.version   '    ==  II--DM}}r*   c                    U R                    SU R                   SU R                  (       a  SOS U R                  R                  (       a  U R                  R
                  OU R                   S3$ )Nr^   z (from z	editable  rf   )r6   r=   is_editablerP   is_file	file_pathr`   s    r(   format_for_error3_InstallRequirementBackedCandidate.format_for_error   sY    yyk4<<. )$($4$4["='+zz'9'9tzz##tzzJ!M	
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.Nr6   r=   )rT   rG   r   rS   rU   r=   r7   listiter_dependenciesiter_provided_extrasr	   r   )rX   rI   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[        U R                  R                  [        5      (       a%  U R                  R                  R                  5       nOU R                  R                  nUc  Sn[        U R                  R                  =(       d    [        U R                  5      UUR                  S9eS nAff = f)Nzdirectly requested)package_namerequirement_chainfailed_step)r   r   rS   r5   r   r%   r/   r   	from_pathr   r6   r7   rP   command_descriptionr   )rX   rI   r   excrequest_chains        r(   rV   +_InstallRequirementBackedCandidate._prepare   s    	--/D, 	((.-  	 JJAE* 	$**//1CDD $

 5 5 ? ? A $

 5 5$ 4*!ZZ__?DJJ"/33 	s!   % 
DADB.C<<Dc              #  8  #    U R                   R                  U R                  R                  5      v   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<     g  N	7fN )rR    make_requires_python_requirementrI   requires_pythonr   make_requirements_from_specr7   rS   )rX   with_requiresrequiresrs       r(   r   4_InstallRequirementBackedCandidate.iter_dependencies  sk      mm<<TYY=V=VWW4A499..0rA}}@@QTTT Ts   BBB
Bc                    U R                   $ rO   )rS   r`   s    r(   get_install_requirement:_InstallRequirementBackedCandidate.get_install_requirement  s    zzr*   )rR   rW   rS   rP   rT   rQ   rU   rI   NN)r:   r   rY   r   r?   r   rZ   r    r6   NormalizedName | Noner=   Version | NonereturnNoner   r7   r   intrr   r   r   boolr   zLink | Noner   r
   r   r   r   r   )rI   r   r   r   r   r   r   zIterable[Requirement | None]r   InstallRequirement | None)rh   
__module____qualname____firstlineno____doc____annotations__is_installedr[   ra   ri   rm   rs   propertyrY   rz   r6   r=   r   r   r   rV   r   r   __static_attributes__r   r*   r(   rL   rL      s     L '+"&&& & !	&
 & $&  & 
&$-A
 ! !   ! !  

:606Ur*   rL   c                  X   ^  \ rS rSrSr  S           SU 4S jjjrSS jrSrU =r$ )	r#   i  Fc           	     t  > UnUR                  Xd5      nUb,  [        R                  SUR                  5        UR                  n[	        XUS9nUR                  U:X  d   eUR                  R
                  (       a  UR                  R                  (       dm  [        UR                  R                  5      n	U	R                  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 ]M  UUUUUUS9  g )NzUsing cached wheel link: %sr=   z != z
 for wheelz for wheel )link_is_in_wheel_cacher:   rY   r?   rZ   r6   r=   )get_wheel_cache_entryloggerdebugr:   r@   is_wheelr   r   filenamer6   r   r=   
persistentr9   cached_wheel_source_linkorigindownload_infor   superr[   )rX   r:   r<   rZ   r6   r=   rY   cache_entryr?   wheel
wheel_namewheel_versionrg   s               r(   r[   LinkCandidate.__init__  s    33KF"LL68H8HI##D)$'JyyD   99dii&7&7$)),,-EJ%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)rR   preparerprepare_linked_requirementrS   )rX   r   s     r(   r   #LinkCandidate._prepare_distributionO  s+    ==))224::t2TTr*   r   r   r:   r   r<   r   rZ   r    r6   r   r=   r   r   r   r   	rh   r   r   r   r   r[   r   r   __classcell__rg   s   @r(   r#   r#     sa    K '+"&/
/
 %/
 	/

 $/
  /
 
/
 /
bU Ur*   r#   c                  X   ^  \ rS rSrSr  S           SU 4S jjjrSS jrSrU =r$ )	r"   iT  Tc           	     <   > [         TU ]  UU[        X5      UUUS9  g )Nr   )r   r[   rE   )rX   r:   r<   rZ   r6   r=   rg   s         r(   r[   EditableCandidate.__init__W  s.     	/? 	 	
r*   c                `    U R                   R                  R                  U R                  5      $ rO   )rR   r   prepare_editable_requirementrS   r`   s    r(   r   'EditableCandidate._prepare_distributionh  s!    }}%%BB4::NNr*   r   r   r   r   r   r   s   @r(   r"   r"   T  s`    K '+"&

 %
 	

 $
  
 

 
"O Or*   r"   c                      \ rS rSrSrSr        SS jrSS jrSS jrSS jr	SS jr
\SS	 j5       r\SS
 j5       r\SS j5       r\SS j5       rSS jrSS jrSS jrSrg)r!   il  TNc                    Xl         [        X5      U l        X0l        S U l        SnUR
                  R                  U R                  U5        g )Nzalready satisfied)rI   rJ   rS   rR   rU   r   prepare_installed_requirement)rX   rI   r<   rZ   skip_reasons        r(   r[   "AlreadyInstalledCandidate.__init__p  sB     	0@
 *66tzz;Or*   c                ,    [        U R                  5      $ rO   )r7   rI   r`   s    r(   ra   !AlreadyInstalledCandidate.__str__  s    499~r*   c                P    U R                   R                   SU R                  < S3$ rd   )rg   rh   rI   r`   s    r(   ri   "AlreadyInstalledCandidate.__repr__  s$    ..))*!DII=::r*   c                    [        U[        5      (       d  [        $ U R                  UR                  :H  =(       a    U R                  UR                  :H  $ rO   )r%   r!   NotImplementedr6   r=   rq   s     r(   rs    AlreadyInstalledCandidate.__eq__  s;    %!:;;!!yyEJJ&H4<<5==+HHr*   c                D    [        U R                  U R                  45      $ rO   )rl   r6   r=   r`   s    r(   rm   "AlreadyInstalledCandidate.__hash__  s    TYY-..r*   c                .    U R                   R                  $ rO   )rI   rG   r`   s    r(   rz   &AlreadyInstalledCandidate.project_name  s    yy'''r*   c                    U R                   $ rO   r}   r`   s    r(   r6   AlreadyInstalledCandidate.name  rw   r*   c                j    U R                   c  U R                  R                  U l         U R                   $ rO   r   r`   s    r(   r=   !AlreadyInstalledCandidate.version  r   r*   c                .    U R                   R                  $ rO   )rI   r4   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*   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	! [         a  n[        U R                   US9S eS nAff = f7f)N)rI   invalid_exc)rI   r   rR   r   r7   rS   r	   r   )rX   r   r   r   s       r(   r   +AlreadyInstalledCandidate.iter_dependencies  sr     	UYY002==DDSVTZZXXX 3X! 	U)tyycJPTT	Us;   	BAA' A%A' $B%A' '
B1BBBc                    g rO   r   r`   s    r(   r   1AlreadyInstalledCandidate.get_install_requirement      r*   )rR   rS   rU   rI   )rI   r   r<   r   rZ   r    r   r   r   )rr   objectr   r   r   r   r   r   r   r   r   )rh   r   r   r   r   rY   r[   ra   ri   rs   rm   r   rz   r6   r=   r   r   r   r   r   r   r*   r(   r!   r!   l  s    LKPP %P 	P
 
P$;I
/ ( ( ! !  
 " "9Ur*   r!   c                      \ rS rSrSrSS.       SS jjrSS jrSS jrSS jrSS	 jr	\
SS
 j5       r\
SS j5       r\
SS j5       rSS jr\
SS j5       r\
SS j5       r\
SS j5       rSS jrS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)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  8   #    U  H  n[        U5      v   M     g 7frO   )r   ).0r   s     r(   	<genexpr>+ExtrasCandidate.__init__.<locals>.<genexpr>  s     Ef 1! 4 4f   N)base	frozensetr;   rS   _comes_from)rX   r  r;   r/   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	{}[{}] {},)r7   r  splitformatjoinr;   )rX   r6   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      $ rO   )rl   r  r;   r`   s    r(   rm   ExtrasCandidate.__hash__  s    TYY,--r*   c                    [        XR                  5      (       a9  U R                  UR                  :H  =(       a    U R                  UR                  :H  $ grp   )r%   rg   r  r;   rq   s     r(   rs   ExtrasCandidate.__eq__  s9    e^^,,99

*Jt{{ell/JJr*   c                .    U R                   R                  $ rO   )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(   r6   ExtrasCandidate.name  s     499114;;??r*   c                .    U R                   R                  $ rO   )r  r=   r`   s    r(   r=   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                  $ rO   )r  r   r`   s    r(   r   ExtrasCandidate.is_installed   r"  r*   c                .    U R                   R                  $ rO   )r  r   r`   s    r(   r   ExtrasCandidate.is_editable      yy$$$r*   c                .    U R                   R                  $ rO   )r  rY   r`   s    r(   rY   ExtrasCandidate.source_link  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  rR   make_requirement_from_candidater;   intersectionrI   r   
differencer(  r   warningr6   r=   r   r   r7   r  )rX   r   rZ   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 rO   r   r`   s    r(   r   'ExtrasCandidate.get_install_requirement(  s     r*   )r  r  r;   )r  BaseCandidater;   zfrozenset[str]r/   r   r   r   r   r   r   r   r   r  r   r   r   )rh   r   r   r   r   r[   ra   ri   rm   rs   r   rz   r6   r=   r   r   r   rY   r   r   r   r   r*   r(   r  r    s    : 15UU U
 .U 
U&EX.
 & & @ @ ! !

 & & % % % %8r*   r  c                      \ rS rSrSrSrSS jrSS jrSS jr\	SS j5       r
\	SS j5       r\	SS	 j5       rSS
 jrSS jrSS jrSrg)RequiresPythonCandidatei/  FNc                    Ub  [        U5      nO[        R                  S S n[        SR	                  S U 5       5      5      U l        g )N   .c              3  8   #    U  H  n[        U5      v   M     g 7frO   )r7   )r  cs     r(   r  3RequiresPythonCandidate.__init__.<locals>.<genexpr>8  s     (FAQr  )r   sysversion_infor   r  rU   )rX   py_version_inforF  s      r(   r[    RequiresPythonCandidate.__init__3  s?    &1/BL++BQ/L(F(F FGr*   c                     SU R                    3$ NzPython rU   r`   s    r(   ra   RequiresPythonCandidate.__str__>  s    ((r*   c                P    U R                   R                   SU R                  < S3$ rd   )rg   rh   rU   r`   s    r(   ri    RequiresPythonCandidate.__repr__A  s%    ..))*!DMM+<A>>r*   c                    [         $ rO   REQUIRES_PYTHON_IDENTIFIERr`   s    r(   rz   $RequiresPythonCandidate.project_nameD      ))r*   c                    [         $ rO   rP  r`   s    r(   r6   RequiresPythonCandidate.nameH  rS  r*   c                    U R                   $ rO   rK  r`   s    r(   r=   RequiresPythonCandidate.versionL  s    }}r*   c                     SU R                    3$ rJ  r   r`   s    r(   r   (RequiresPythonCandidate.format_for_errorP  s    ''r*   c                    gr   r   )rX   r   s     r(   r   )RequiresPythonCandidate.iter_dependenciesS  s    r*   c                    g rO   r   r`   s    r(   r   /RequiresPythonCandidate.get_install_requirementV  r  r*   rK  )rG  ztuple[int, ...] | Noner   r   r   r   r   r   r   )rh   r   r   r   r   rY   r[   ra   ri   r   rz   r6   r=   r   r   r   r   r   r*   r(   r>  r>  /  sg    LKH)? * * * *  (r*   r>  )r&   r   r   zBaseCandidate | NonerO   )r:   r   r<   r   r=   r   r   r   )r:   r   r<   r   r   r   )rI   r   r<   r   r   r   )>
__future__r   loggingrE  collections.abcr   typingr   r   r   r   "pip._vendor.packaging.requirementsr	   pip._vendor.packaging.utilsr
   r   pip._vendor.packaging.versionr   pip._internal.exceptionsr   r   r   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   rZ   r    	getLoggerrh   r   r<  rQ  r)   r@   rE   rJ   rL   r#   r"   r!   r  r>  r   r*   r(   <module>rn     sE   "  
 $ 2 2 A I 1  4 < , = G ; 5 5 			8	$ ".2QR 	 #
   	<
,,
&8,R Rj6U6 6UrO: O0D	 DNyi yx(i (r*   