
    )iO                    &   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 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     n/var/www/html/land-doc-ocr/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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reqstrurlr   r-   r.   r/   r0   r1   r2   original_linklinkextras)r8   templatelineireqs       r(   make_install_req_from_linkr=   <   s       8"88 ||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.   r/   r0   permit_editable_wheelsr1   r2   )r3   namer6   r   r-   r.   r/   r0   r@   r1   r2   r9   )r8   r:   
req_stringr<   s       r(   make_install_req_from_editablerC   S   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$ )Nr?   z==r,   )r4   r5   r8   canonical_namer6   versionr   r-   r.   r/   r0   r1   r2   satisfied_by)distr:   r;   r<   s       r(   _make_install_req_from_distrI   i   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   rH   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_preparerH   _hash)selfr8   source_linkr<   factoryrA   rF   s          r(   __init__+_InstallRequirementBackedCandidate.__init__   s7     
'

MMO	!%
r*   c                8    U R                    SU R                   3$ )N rA   rF   rW   s    r(   __str__*_InstallRequirementBackedCandidate.__str__   s    ))Adll^,,r*   c                b    U R                   R                   S[        U R                  5      < S3$ N())	__class____name__r5   rO   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                   $ rN   )rV   hashrf   rO   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%   rf   r   rO   rW   others     r(   __eq__)_InstallRequirementBackedCandidate.__eq__   s)    e^^,,#DJJ<<r*   c                    U R                   $ rN   )rP   r_   s    r(   rX   ._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)rS   rH   rE   r_   s    r(   project_name/_InstallRequirementBackedCandidate.project_name   s)     ::11DJzzr*   c                    U R                   $ rN   ry   r_   s    r(   rA   '_InstallRequirementBackedCandidate.name   rv   r*   c                j    U R                   c  U R                  R                  U l         U R                   $ rN   rT   rH   rF   r_   s    r(   rF   *_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 re   )rA   rF   rO   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.NrA   rF   )rS   rE   r   rR   rT   rF   r5   listiter_dependenciesiter_provided_extrasr	   r   )rW   rH   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   rR   r4   r   r%   r.   r   	from_pathr   rA   r5   rO   command_descriptionr   )rW   rH   r   excrequest_chains        r(   rU   +_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 )rQ    make_requires_python_requirementrH   requires_pythonr   make_requirements_from_specr5   rR   )rW   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                   $ rN   )rR   r_   s    r(   get_install_requirement:_InstallRequirementBackedCandidate.get_install_requirement  s    zzr*   )rQ   rV   rR   rO   rS   rP   rT   rH   NN)r8   r   rX   r   r<   r   rY   r    rA   NormalizedName | NonerF   Version | NonereturnNoner   r5   r   intrq   r   r   boolr   zLink | Noner   r
   r   r   r   r   )rH   r   r   r   r   r   r   zIterable[Requirement | None]r   InstallRequirement | None)rg   
__module____qualname____firstlineno____doc____annotations__is_installedrZ   r`   rh   rl   rr   propertyrX   ry   rA   rF   r   r   r   rU   r   r   __static_attributes__r   r*   r(   rK   rK      s     L '+"&&& & !	&
 & $&  & 
&$-A
 ! !   ! !  

:606Ur*   rK   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           	     v  > 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                  (       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: %sz != z
 for wheelz for wheel )link_is_in_wheel_cacher8   rX   r<   rY   rA   rF   )get_wheel_cache_entryloggerdebugr8   r=   is_wheelr   r   filenamerA   r   rF   
persistentr7   cached_wheel_source_linkorigindownload_infor   superrZ   )rW   r8   r:   rY   rA   rF   rX   cache_entryr<   wheel
wheel_namewheel_versionrf   s               r(   rZ   LinkCandidate.__init__  s    33KF"LL68H8HI##D)$9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)rQ   preparerprepare_linked_requirementrR   )rW   r   s     r(   r   #LinkCandidate._prepare_distributionG  s+    ==))224::t2TTr*   r   r   r8   r   r:   r   rY   r    rA   r   rF   r   r   r   r   	rg   r   r   r   is_editablerZ   r   r   __classcell__rf   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"   iL  Tc           	     <   > [         TU ]  UU[        X5      UUUS9  g )Nr   )r   rZ   rC   )rW   r8   r:   rY   rA   rF   rf   s         r(   rZ   EditableCandidate.__init__O  s.     	/? 	 	
r*   c                `    U R                   R                  R                  U R                  5      $ rN   )rQ   r   prepare_editable_requirementrR   r_   s    r(   r   'EditableCandidate._prepare_distribution`  s!    }}%%BB4::NNr*   r   r   r   r   r   r   s   @r(   r"   r"   L  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!   id  TNc                    Xl         [        X5      U l        X0l        S U l        SnUR
                  R                  U R                  U5        g )Nzalready satisfied)rH   rI   rR   rQ   rT   r   prepare_installed_requirement)rW   rH   r:   rY   skip_reasons        r(   rZ   "AlreadyInstalledCandidate.__init__h  sB     	0@
 *66tzz;Or*   c                ,    [        U R                  5      $ rN   )r5   rH   r_   s    r(   r`   !AlreadyInstalledCandidate.__str__z  s    499~r*   c                P    U R                   R                   SU R                  < S3$ rc   )rf   rg   rH   r_   s    r(   rh   "AlreadyInstalledCandidate.__repr__}  s$    ..))*!DII=::r*   c                    [        U[        5      (       d  [        $ U R                  UR                  :H  =(       a    U R                  UR                  :H  $ rN   )r%   r!   NotImplementedrA   rF   rp   s     r(   rr    AlreadyInstalledCandidate.__eq__  s;    %!:;;!!yyEJJ&H4<<5==+HHr*   c                D    [        U R                  U R                  45      $ rN   )rk   rA   rF   r_   s    r(   rl   "AlreadyInstalledCandidate.__hash__  s    TYY-..r*   c                .    U R                   R                  $ rN   )rH   rE   r_   s    r(   ry   &AlreadyInstalledCandidate.project_name  s    yy'''r*   c                    U R                   $ rN   r|   r_   s    r(   rA   AlreadyInstalledCandidate.name  rv   r*   c                j    U R                   c  U R                  R                  U l         U R                   $ rN   r   r_   s    r(   rF   !AlreadyInstalledCandidate.version  r   r*   c                .    U R                   R                  $ rN   )rH   r3   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)rH   invalid_exc)rH   r   rQ   r   r5   rR   r	   r   )rW   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 rN   r   r_   s    r(   r   1AlreadyInstalledCandidate.get_install_requirement      r*   )rQ   rR   rT   rH   )rH   r   r:   r   rY   r    r   r   r   )rq   objectr   r   r   r   r   r   r   r   r   )rg   r   r   r   r   rX   rZ   r`   rh   rr   rl   r   ry   rA   rF   r   r   r   r   r   r   r*   r(   r!   r!   d  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rN   )r   ).0r   s     r(   	<genexpr>+ExtrasCandidate.__init__.<locals>.<genexpr>  s     Ef 1! 4 4f   N)base	frozensetr9   rR   _comes_from)rW   r  r9   r.   s       r(   rZ   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	{}[{}] {},)r5   r  splitformatjoinr9   )rW   rA   rests      r(   r`   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=re   )rf   rg   r  r9   r_   s    r(   rh   ExtrasCandidate.__repr__  s/    ..))*&Yt{{oUVWWr*   c                D    [        U R                  U R                  45      $ rN   )rk   r  r9   r_   s    r(   rl   ExtrasCandidate.__hash__  s    TYY,--r*   c                    [        XR                  5      (       a9  U R                  UR                  :H  =(       a    U R                  UR                  :H  $ gro   )r%   rf   r  r9   rp   s     r(   rr   ExtrasCandidate.__eq__  s9    e^^,,99

*Jt{{ell/JJr*   c                .    U R                   R                  $ rN   )r  ry   r_   s    r(   ry   ExtrasCandidate.project_name      yy%%%r*   c                V    [        U R                  R                  U R                  5      $ rx   )r   r  ry   r9   r_   s    r(   rA   ExtrasCandidate.name  s     499114;;??r*   c                .    U R                   R                  $ rN   )r  rF   r_   s    r(   rF   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  sortedr9   r_   s    r(   r    ExtrasCandidate.format_for_error  s9    II&&($))F4;;4G*H
 	
r*   c                .    U R                   R                  $ rN   )r  r   r_   s    r(   r   ExtrasCandidate.is_installed  r  r*   c                .    U R                   R                  $ rN   )r  r   r_   s    r(   r   ExtrasCandidate.is_editable      yy$$$r*   c                .    U R                   R                  $ rN   )r  rX   r_   s    r(   rX   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  rQ   make_requirement_from_candidater9   intersectionrH   r   
differencer%  r   warningrA   rF   r   r   r5   r  )rW   r   rY   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 rN   r   r_   s    r(   r   'ExtrasCandidate.get_install_requirement   s     r*   )r  r  r9   )r  BaseCandidater9   zfrozenset[str]r.   r   r   r   r   r   r   r   r   r  r   r   r   )rg   r   r   r   r   rZ   r`   rh   rl   rr   r   ry   rA   rF   r   r   r   rX   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rN   )r5   )r  cs     r(   r	  3RequiresPythonCandidate.__init__.<locals>.<genexpr>0  s     (FAQr  )r   sysversion_infor   r  rT   )rW   py_version_inforC  s      r(   rZ    RequiresPythonCandidate.__init__+  s?    &1/BL++BQ/L(F(F FGr*   c                     SU R                    3$ NzPython rT   r_   s    r(   r`   RequiresPythonCandidate.__str__6  s    ((r*   c                P    U R                   R                   SU R                  < S3$ rc   )rf   rg   rT   r_   s    r(   rh    RequiresPythonCandidate.__repr__9  s%    ..))*!DMM+<A>>r*   c                    [         $ rN   REQUIRES_PYTHON_IDENTIFIERr_   s    r(   ry   $RequiresPythonCandidate.project_name<      ))r*   c                    [         $ rN   rM  r_   s    r(   rA   RequiresPythonCandidate.name@  rP  r*   c                    U R                   $ rN   rH  r_   s    r(   rF   RequiresPythonCandidate.versionD  s    }}r*   c                     SU R                    3$ rG  )rF   r_   s    r(   r   (RequiresPythonCandidate.format_for_errorH  s    ''r*   c                    gr   r   )rW   r   s     r(   r   )RequiresPythonCandidate.iter_dependenciesK  s    r*   c                    g rN   r   r_   s    r(   r   /RequiresPythonCandidate.get_install_requirementN  r  r*   rH  )rD  ztuple[int, ...] | Noner   r   r   r   r   r   r   )rg   r   r   r   r   rX   rZ   r`   rh   r   ry   rA   rF   r   r   r   r   r   r*   r(   r;  r;  '  sg    LKH)? * * * *  (r*   r;  )r&   r   r   zBaseCandidate | None)r8   r   r:   r   r   r   )rH   r   r:   r   r   r   )>
__future__r   loggingrB  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   rY   r    	getLoggerrg   r   r9  rN  r)   r=   rC   rI   rK   r#   r"   r!   r  r;  r   r*   r(   <module>rk     s4   "  
 $ 2 2 A I 1  4 < , = G ; 5 5 			8	$ ".2QR 	
,.
,,
&8,Q Qh6U6 6UrO: O0D	 DNyi yx(i (r*   