
    q"h.              	       $   S r SSKrSSKrSSK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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  SS	KJr  SS
KJrJrJ r 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,  SSK-J.r.  SSK/J0r0  SSK1J2r2  SSK3J4r4  SSK5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  SSK?J@r@  SSKAJBrB  \	(       a  SSKCJDrD  / SQrE\6" \F5      rG\\S   \\H\I4   4   rJ\\H\H\H\\\H   \J4   rK S9S\*S\\H\H\H4   S \LS!\L4S" jjrM " S# S$\R                  5      rO " S% S&5      rPS'\\&   S(\\:   S)\IS!\\&   4S* jrQ\ " S+ S,5      5       rR\" S-S.9 " S/ S05      5       rS " S1 S25      rT " S3 S45      rUS5\IS6\IS!\H4S7 jrVS5\IS6\IS!\\I   4S8 jrWg):z!Routines related to PyPI, indexes    N)	dataclass)	TYPE_CHECKINGDict	FrozenSetIterableListOptionalSetTupleUnion)
specifiers)Tag)canonicalize_name)InvalidVersion_BaseVersion)parse)BestVersionAlreadyInstalledDistributionNotFoundInvalidWheelFilenameUnsupportedWheel)LinkCollectorparse_links)InstallationCandidate)FormatControl)Link)SearchScope)SelectionPreferences)TargetPython)Wheel)InstallRequirement)	getLogger)WHEEL_EXTENSION)Hashes)
indent_log)build_netloc)check_requires_python)SUPPORTED_EXTENSIONS)	TypeGuard)r   BestCandidateResultPackageFinder linkversion_infoignore_requires_pythonreturnc                     [        U R                  US9nU(       dk  SR                  [        [        U5      5      nU(       d#  [
        R                  SUU R                  U 5        g[
        R                  SUU R                  U 5        g! [        R                   a$    [
        R                  SU R                  U 5         gf = f)aE  
Return whether the given Python version is compatible with a link'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.
)r-   .z4Link requires a different Python (%s not in: %r): %sFzBIgnoring failed Requires-Python check (%s not in: %r) for link: %sz2Ignoring invalid Requires-Python (%r) for link: %sT)
r&   requires_pythonjoinmapstrloggerverbosedebugr   InvalidSpecifier)r,   r-   r.   is_compatibleversions        T/var/www/html/env/lib/python3.13/site-packages/pip/_internal/index/package_finder.py_check_link_requires_pythonr=   >   s    -  %
 hhs356G)J((	 LLT$$	 3 && 
@  	
0 3
s   B	 	5C Cc                      \ rS rSr\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r\R
                  " 5       r	\R
                  " 5       r
\R
                  " 5       r\R
                  " 5       rSrg)LinkTypem   r+   N)__name__
__module____qualname____firstlineno__enumauto	candidatedifferent_projectyankedformat_unsupportedformat_invalidplatform_mismatchrequires_python_mismatch__static_attributes__r+       r<   r?   r?   m   sS    		I		YY[FYY[N		#yy{rO   r?   c                       \ rS rSrSr\R                  " S5      r SS\S\S\	\   S\
S	\S
\\   SS4S jjrS\S\\\4   4S jrSrg)LinkEvaluatorw   z<
Responsible for evaluating links for a particular project.
z-py([123]\.?[0-9]?)$Nproject_namecanonical_nameformatstarget_pythonallow_yankedr.   r/   c                 V    Uc  SnXPl         X l        X`l        X0l        X@l        Xl        g)aU  
:param project_name: The user supplied package name.
:param canonical_name: The canonical package name.
:param formats: The formats allowed for this package. Should be a set
    with 'binary' or 'source' or both in it.
:param target_python: The target Python interpreter to use when
    evaluating link compatibility. This is used, for example, to
    check wheel compatibility, as well as when checking the Python
    version, e.g. the Python version embedded in a link filename
    (or egg fragment) and against an HTML link's optional PEP 503
    "data-requires-python" attribute.
:param allow_yanked: Whether files marked as yanked (in the sense
    of PEP 592) are permitted to be candidates for install.
:param ignore_requires_python: Whether to ignore incompatible
    PEP 503 "data-requires-python" values in HTML links. Defaults
    to False.
NF)_allow_yanked_canonical_name_ignore_requires_python_formats_target_pythonrS   )selfrS   rT   rU   rV   rW   r.   s          r<   __init__LinkEvaluator.__init__   s3    4 ")%*")-'=$+(rO   r,   c                    SnUR                   (       a;  U R                  (       d*  UR                  =(       d    Sn[        R                  SU 34$ UR
                  (       a  UR
                  nUR                  nGOUR                  5       u  pEU(       d  [        R                  S4$ U[        ;  a  [        R                  SU 34$ SU R                  ;  a+  U[        :X  a!  SU R                   3n[        R                  U4$ SUR                  ;   a  US	:X  a  [        R                  S
4$ U[        :X  a   [        UR                  5      n[%        UR&                  5      U R(                  :w  a"  SU R                   S3n[        R*                  U4$ U R,                  R/                  5       nUR1                  U5      (       d7  SR3                  UR5                  5       5      nSU S3n[        R6                  U4$ UR8                  nSU R                  ;  a+  U[        :w  a!  SU R                   3n[        R                  U4$ U(       d  [;        UU R(                  5      nU(       d!  SU R                   3n[        R"                  U4$ U R<                  R?                  U5      n	U	(       aO  USU	RA                  5        nU	RC                  S5      n
XR,                  RD                  :w  a  [        R6                  S4$ [G        UU R,                  RH                  U RJ                  S9nU(       d#  U SURL                   3n[        RN                  U4$ [P        RS                  SX5        [        RT                  U4$ ! [          a    [        R"                  S4s $ f = f)au  
Determine whether a link is a candidate for installation.

:return: A tuple (result, detail), where *result* is an enum
    representing whether the evaluation found a candidate, or the reason
    why one is not found. If a candidate is found, *detail* will be the
    candidate's version string; if one is not found, it contains the
    reason the link fails to qualify.
Nz<none given>zyanked for reason: z
not a filezunsupported archive format: binaryzNo binaries permitted for macosx10z.zipzmacosx10 onezinvalid wheel filenamezwrong project name (not ), znone of the wheel's tags (zB) are compatible (run pip debug --verbose to show compatible tags)sourcezNo sources permitted for zMissing project version for    zPython version is incorrect)r-   r.   z Requires-Python zFound link %s, version: %s)+	is_yankedrY   yanked_reasonr?   rI   egg_fragmentextsplitextrJ   r'   r\   r"   rS   pathr   filenamer   rK   r   namerZ   rH   r]   get_unsorted_tags	supportedr3   get_formatted_file_tagsrL   r;   _extract_version_from_fragment_py_version_researchstartgroup
py_versionr=   py_version_infor[   r2   rM   r6   r8   rG   )r^   r,   r;   reasonegg_infork   wheelsupported_tags	file_tagsmatchrx   supports_pythons               r<   evaluate_linkLinkEvaluator.evaluate_link   sB    >>$"4"4''9>FOO':6(%CDD((H((C MMOMH 33\BB..//23%8  t}},1G5d6G6G5HI 33V<<TYY&3&= 33^DDo%!$--0E %UZZ0D4H4HH78I8I7J!LF$66??!%!4!4!F!F!H~66 !%		%*G*G*I JI4YK @L M  %66??-- 4==(SO-C01B1B0CDF//884$$G 3D4E4E3FGF++V44##**73o.GQJ00;;;..1 
 6,,<<#'#?#?

 y 1$2F2F1GHF55v>>14A""G,,s ,  //0 s   2M+ +N
	N
)rY   rZ   r\   r[   r]   rS   N)rA   rB   rC   rD   __doc__recompilert   r5   r   r   boolr	   r_   r   r   r?   r   rN   r+   rO   r<   rQ   rQ   w   s     ZZ 78N 26#)#) #) 3	#)
 $#) #) !)#) 
#)J\-$ \-53+? \-rO   rQ   
candidateshashesrS   c           
      v   U(       d+  [         R                  S[        U 5      U5        [        U 5      $ / n/ nSnU  H_  nUR                  nUR
                  (       d  O-UR                  US9(       a  US-  nOUR                  U5        MN  UR                  U5        Ma     U(       a  UnO[        U 5      n[        U5      [        U 5      :X  a  Sn	O1SR                  [        U5      SR                  S U 5       5      5      n	[         R                  S	[        U 5      UUR                  U[        U5      U-
  U	5        U$ )
a  
Filter out candidates whose hashes aren't allowed, and return a new
list of candidates.

If at least one candidate has an allowed hash, then all candidates with
either an allowed hash or no hash specified are returned.  Otherwise,
the given candidates are returned.

Including the candidates with no hash specified when there is a match
allows a warning to be logged if there is a more preferred candidate
with no hash specified.  Returning all candidates in the case of no
matches lets pip report the hash of the candidate that would otherwise
have been installed (e.g. permitting the user to more easily update
their requirements file with the desired hash).
zJGiven no hashes to check %s links for project %r: discarding no candidatesr   )r   rg   zdiscarding no candidateszdiscarding {} non-matches:
  {}z
  c              3   L   #    U  H  n[        UR                  5      v   M     g 7fr   )r5   r,   ).0rG   s     r<   	<genexpr>*filter_unallowed_hashes.<locals>.<genexpr>?  s     I[	INN++[s   "$zPChecked %s links for project %r against %s hashes (%s matches, %s no digest): %s)r6   r8   lenlistr,   has_hashis_hash_allowedappendformatr3   digest_count)
r   r   rS   matches_or_no_digestnon_matchesmatch_countrG   r,   filtereddiscard_messages
             r<   filter_unallowed_hashesr     s,   ( '
O		
 JKK	~~}}!!!01Ky)##I.   ' 
#
8}J'4<CCKKI[II

 LL	)J !K/	 OrO   c                   6    \ rS rSr% SrSr\\S'   Sr\\S'   Sr	g)CandidatePreferencesiP  z_
Encapsulates some of the preferences for filtering and sorting
InstallationCandidate objects.
Fprefer_binaryallow_all_prereleasesr+   N)
rA   rB   rC   rD   r   r   r   __annotations__r   rN   r+   rO   r<   r   r   P  s    
  M4"'4'rO   r   T)frozenc                   T    \ rS rSr% Sr\\   \S'   \\   \S'   \\   \S'   S	S jr	Sr
g)
r)   i[  a  A collection of candidates, returned by `PackageFinder.find_best_candidate`.

This class is only intended to be instantiated by CandidateEvaluator's
`compute_best_candidate()` method.

:param all_candidates: A sequence of all available candidates found.
:param applicable_candidates: The applicable candidates.
:param best_candidate: The most preferred candidate found, or None
    if no applicable candidates were found.
all_candidatesapplicable_candidatesbest_candidateNc                     [        U R                  5      [        U R                  5      ::  d   eU R                  c  U R                  (       a   eg U R                  U R                  ;   d   eg r   )setr   r   r   r^   s    r<   __post_init__!BestCandidateResult.__post_init__l  s^    4--.#d6I6I2JJJJ&11111&&$*D*DDDDrO   r+   r/   N)rA   rB   rC   rD   r   r   r   r   r	   r   rN   r+   rO   r<   r)   r)   [  s3    	 .// 566233ErO   r)   c                   2   \ rS rSrSr\     SS\S\\   S\	S\	S\\
R                     S	\\   S
S 4S jj5       r   SS\S\\   S\
R                  S\	S\	S	\\   S
S4S jjrS\\   S
\\   4S jrS\S
\4S jrS\\   S
\\   4S jrS\\   S
\4S jrSrg)CandidateEvaluatoriu  za
Responsible for filtering and sorting candidates for installation based
on what tags are valid.
NrS   rV   r   r   	specifierr   r/   c           	          Uc
  [        5       nUc  [        R                  " 5       nUR                  5       nU " UUUUUUS9$ )a  Create a CandidateEvaluator object.

:param target_python: The target Python interpreter to use when
    checking compatibility. If None (the default), a TargetPython
    object will be constructed from the running Python.
:param specifier: An optional object implementing `filter`
    (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable
    versions.
:param hashes: An optional collection of allowed hashes.
)rS   r}   r   r   r   r   )r   r   SpecifierSetget_sorted_tags)clsrS   rV   r   r   r   r   r}   s           r<   createCandidateEvaluator.create{  sR    (  (NM"//1I&668%)'"7
 	
rO   r}   c                     XPl         X`l        X@l        Xl        X0l        X l        [        U5       VVs0 s H  u  pxX_M	     snnU l        gs  snnf )z{
:param supported_tags: The PEP 425 tags supported by the target
    Python in order of preference (most preferred first).
N)_allow_all_prereleases_hashes_prefer_binary_project_name
_specifier_supported_tags	enumerate_wheel_tag_preferences)	r^   rS   r}   r   r   r   r   idxtags	            r<   r_   CandidateEvaluator.__init__  sS     '<#+)#-
 &/~%>'
%>CH%>'
# '
s   Ar   c                    U R                   =(       d    SnU R                  nU Vs/ s H  oD[        UR                  5      4PM     nn[	        UR                  S U 5       US95      nU VVs/ s H  u  pGXv;   d  M  UPM     nnn[        UU R                  U R                  S9n	[        XR                  S9$ s  snf s  snnf )z=
Return the applicable candidates from a list of candidates.
Nc              3   *   #    U  H	  u  pUv   M     g 7fr   r+   )r   _vs      r<   r   ?CandidateEvaluator.get_applicable_candidates.<locals>.<genexpr>  s     76tq6s   )prereleases)r   r   rS   key)r   r   r5   r;   r   filterr   r   r   sorted	_sort_key)
r^   r   allow_prereleasesr   ccandidates_and_versionsversionsr   r   filtered_applicable_candidatess
             r<   get_applicable_candidates,CandidateEvaluator.get_applicable_candidates  s     !77?4OO	 AK"K
1s199~#6
"K767-  
 0G X/Ftq!-/F X)@,<<++*
& 4..II #L !Ys    B7-B<<B<rG   c                    U R                   n[        U5      nSnSnUR                  nUR                  (       aR  [	        UR
                  5      n UR                  X R                  5      * nU R                  (       a  SnUR                  nOU* n[        UR                  U R                  5      5      n	S[        UR                  5      -  n
U	U
UUR                   UU4$ ! [         a    [        UR
                   S35      ef = f)ay  
Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference.

Returns a tuple such that tuples sorting as greater using Python's
default comparison operator are more preferred.

The preference is as follows:

First and foremost, candidates with allowed (matching) hashes are
always preferred over candidates without matching hashes. This is
because e.g. if the only candidate with an allowed hash is yanked,
we still want to use that candidate.

Second, excepting hash considerations, candidates that have been
yanked (in the sense of PEP 592) are always less preferred than
candidates that haven't been yanked. Then:

If not finding wheels, they are sorted by version only.
If finding wheels, then the sort order is by version, then:
  1. existing installs
  2. wheels ordered via Wheel.support_index_min(self._supported_tags)
  3. source archives
If prefer_binary was set, then all wheels are sorted above sources.

Note: it was considered to embed this logic into the Link
      comparison operators, but then different sdist links
      with the same version, would have to be considered equal
r+   r   z@ is not a supported wheel for this platform. It can't be sorted.rg   )r   r   r,   is_wheelr   rn   find_most_preferred_tagr   
ValueErrorr   r   	build_tagintr   r   rh   r;   )r^   rG   
valid_tagssupport_numr   binary_preferencer,   r|   prihas_allowed_hash
yank_values              r<   r   CandidateEvaluator._sort_key  s   < ))
*o 	~~==$--(E
11"$?$? ""$%!I.Ct33DLLAB#dnn--

 	
  &~~& '' ' s   C #C?c                 <    U(       d  g[        XR                  S9nU$ )za
Return the best candidate per the instance's sort order, or None if
no candidate is acceptable.
Nr   )maxr   )r^   r   r   s      r<   sort_best_candidate&CandidateEvaluator.sort_best_candidate  s     Z^^<rO   c                 \    U R                  U5      nU R                  U5      n[        UUUS9$ )z6
Compute and return a `BestCandidateResult` instance.
)r   r   )r   r   r)   )r^   r   r   r   s       r<   compute_best_candidate)CandidateEvaluator.compute_best_candidate*  s<     !% > >z J112GH""7)
 	
rO   )r   r   r   r   r   r   r   )NFFNN)FFN)rA   rB   rC   rD   r   classmethodr5   r	   r   r   r   BaseSpecifierr#   r   r   r   r_   r   r   CandidateSortingKeyr   r   r)   r   rN   r+   rO   r<   r   r   u  sf   
  15#&+8<#'!
!
  -!
 	!

  $!
 J445!
  !
 
!
 !
P $&+#'

 S	
 ++	

 
  $
  
 

4!J./!J 
#	$!JF?
#8 ?
=P ?
B./ 
'	(
./
 

rO   r   c                   R   \ rS rSrSr   S3S\S\S\S\\	   S\\
   S	\\   S
S4S jjr\ S4S\S\S\\   S
S 4S jj5       r\S
\4S j5       r\S
\4S j5       r\R&                  S\S
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5       r\S
\\   4S j5       r\S
\\   4S j5       r\S
\4S j5       rS5S jr\S
\4S j5       rS5S jr S
\\   4S jr!S\S
\"4S jr#S\\$   S
\\$   4S  jr%S!\$S"\&S#\S
S4S$ jr'S%\"S!\$S
\\(   4S& jr)S%\"S\\$   S
\\(   4S' jr*S(\$S%\"S
\\(   4S) jr+S\S
\\(   4S* jr,  S6S\S+\\-R\                     S,\\/   S
\04S- jjr1  S6S\S+\\-R\                     S,\\/   S
\24S. jjr3S/\4S0\S
\\(   4S1 jr5S2r6g)7r*   i<  zThis finds packages.

This is meant to match easy_install's technique for looking for
packages, by reading pages and looking for appropriate links.
Nlink_collectorrV   rW   format_controlcandidate_prefsr.   r/   c                     Uc
  [        5       nU=(       d    [        [        5       [        5       5      nX0l        XPl        X`l        Xl        X l        X@l        [        5       U l	        0 U l
        0 U l        g)aS  
This constructor is primarily meant to be used by the create() class
method and from tests.

:param format_control: A FormatControl object, used to control
    the selection of source packages / binary packages when consulting
    the index and links.
:param candidate_prefs: Options to use when creating a
    CandidateEvaluator object.
N)r   r   r   rY   _candidate_prefsr[   _link_collectorr]   r   _logged_links_all_candidates_best_candidates)r^   r   rV   rW   r   r   r.   s          r<   r_   PackageFinder.__init__C  sq    & "24O'F=+F) /'=$-+, ?Be HJ  	rO   selection_prefsc           	          Uc
  [        5       n[        UR                  UR                  S9nU " UUUUR                  UR
                  UR                  S9$ )a6  Create a PackageFinder.

:param selection_prefs: The candidate selection preferences, as a
    SelectionPreferences object.
:param target_python: The target Python interpreter to use when
    checking compatibility. If None (the default), a TargetPython
    object will be constructed from the running Python.
)r   r   )r   r   rV   rW   r   r.   )r   r   r   r   rW   r   r.   )r   r   r   rV   r   s        r<   r   PackageFinder.createq  s`      (NM.)77"1"G"G

 +)'(55*99#2#I#I
 	
rO   c                     U R                   $ r   )r]   r   s    r<   rV   PackageFinder.target_python  s    """rO   c                 .    U R                   R                  $ r   r   search_scoper   s    r<   r   PackageFinder.search_scope  s    ##000rO   r   c                 $    XR                   l        g r   r   )r^   r   s     r<   r   r     s    ,8)rO   c                 .    U R                   R                  $ r   )r   
find_linksr   s    r<   r  PackageFinder.find_links  s    ##...rO   c                 .    U R                   R                  $ r   )r   
index_urlsr   s    r<   r  PackageFinder.index_urls  s      +++rO   c                 B    U R                   R                  R                  $ r   )r   session	pip_proxyr   s    r<   proxyPackageFinder.proxy  s    ##++555rO   c              #   n   #    U R                   R                  R                   H  n[        U6 v   M     g 7fr   )r   r  pip_trusted_originsr%   )r^   	host_ports     r<   trusted_hostsPackageFinder.trusted_hosts  s-     --55III	** Js   35c                 t    U R                   R                  R                  n[        U[        5      (       a  U$ S $ r   )r   r  verify
isinstancer5   )r^   r  s     r<   custom_certPackageFinder.custom_cert  s2    
 %%--44#FC00v:d:rO   c                 ~    U R                   R                  R                  n[        U[        5      (       a   S5       eU$ )Nz"pip only supports PEM client certs)r   r  certr  tuple)r^   r  s     r<   client_certPackageFinder.client_cert  s7    ##++00dE**P,PP*rO   c                 .    U R                   R                  $ r   r   r   r   s    r<   r   #PackageFinder.allow_all_prereleases  s    $$:::rO   c                 &    SU R                   l        g NTr  r   s    r<   set_allow_all_prereleases'PackageFinder.set_allow_all_prereleases  s    6:3rO   c                 .    U R                   R                  $ r   r   r   r   s    r<   r   PackageFinder.prefer_binary  s    $$222rO   c                 &    SU R                   l        g r  r"  r   s    r<   set_prefer_binaryPackageFinder.set_prefer_binary  s    .2+rO   c                     U R                    VVVs1 s H  u  pnU[        R                  :X  d  M  UiM      nnnn[        U5      $ s  snnnf r   )r   r?   rM   r   )r^   r   resultdetailreasonss        r<   requires_python_skipped_reasons-PackageFinder.requires_python_skipped_reasons  sN     &*%7%7
%7!6::: %7 	 

 g
s
   AArS   c           	          [        U5      nU R                  R                  U5      n[        UUUU R                  U R
                  U R                  S9$ )N)rS   rT   rU   rV   rW   r.   )r   r   get_allowed_formatsrQ   r]   rY   r[   )r^   rS   rT   rU   s       r<   make_link_evaluator!PackageFinder.make_link_evaluator  sS    *<8%%99.I%)--++#'#?#?
 	
rO   linksc                     / / p2[        5       nU HP  nXT;  d  M
  UR                  U5        UR                  (       a  UR                  U5        M?  UR                  U5        MR     X2-   $ )zi
Returns elements of links in order, non-egg links first, egg links
second, while eliminating duplicates
)r   addrj   r   )r^   r1  eggsno_eggsseenr,   s         r<   _sort_linksPackageFinder._sort_links  sX    
 Bg%D$$KK%NN4(  ~rO   r,   r(  r)  c                     XU4nX@R                   ;  a2  [        R                  SX15        U R                   R                  U5        g g )NzSkipping link: %s: %s)r   r6   r8   r3  )r^   r,   r(  r)  entrys        r<   _log_skipped_linkPackageFinder._log_skipped_link  sB    v&*** LL0&?""5)	 +rO   link_evaluatorc                     UR                  U5      u  p4U[        R                  :w  a  U R                  X#U5        g [	        UR
                  UUS9$ ! [         a     gf = f)zw
If the link is a candidate for install, convert it to an
InstallationCandidate and return it. Otherwise, return None.
N)ro   r,   r;   )r   r?   rG   r;  r   rS   r   )r^   r=  r,   r(  r)  s        r<   get_install_candidate#PackageFinder.get_install_candidate  sl     (55d;X'''""48	(#00 
  		s   A 
AAc                     / nU R                  U5       H*  nU R                  X5      nUc  M  UR                  U5        M,     U$ )zE
Convert links that are candidates to InstallationCandidate objects.
)r7  r?  r   )r^   r=  r1  r   r,   rG   s         r<   evaluate_linksPackageFinder.evaluate_links  sJ     
$$U+D22>HI$!!), ,
 rO   project_urlc                    [         R                  SU5        U R                  R                  U5      nUc  / $ [	        [        U5      5      n[        5          U R                  UUS9nS S S 5        U$ ! , (       d  f       W$ = f)Nz-Fetching project page and analyzing links: %s)r1  )r6   r8   r   fetch_responser   r   r$   rB  )r^   rD  r=  index_response
page_linkspackage_linkss         r<   process_project_url!PackageFinder.process_project_url  s     	;	
 --<<[I!I+n56
\ //  0 M   \ s   A00
A?c                    XR                   ;   a  U R                   U   $ U R                  U5      nU R                  R                  U[        R
                  " U R                  US9S9n[        R                  R                  S U 5       5      n[        U5      n[        R                  R                  S U 5       5      nU R                  U[        USS95      n[        R                  [        R                   5      (       az  U(       as  / nU HF  n	U	R"                  R$                  (       d   e UR'                  U	R"                  R(                  5        MH     [        R-                  SSR/                  U5      5        Xu-   U R                   U'   U R                   U   $ ! [*         a)    UR'                  U	R"                  R$                  5         M  f = f)	zFind all available InstallationCandidate for project_name

This checks index_urls and find_links.
All versions found are returned as an InstallationCandidate list.

See LinkEvaluator.evaluate_link() for details on which files
are accepted.
)r=  )rS   candidates_from_pagec              3   `   #    U  H$  nU  H  nUc  M  UR                  5       v   M     M&     g 7fr   )page_candidatesr   sourcesrf   s      r<   r   4PackageFinder.find_all_candidates.<locals>.<genexpr>E  s5      ;
,! %F""$$! %,   ..c              3   `   #    U  H$  nU  H  nUc  M  UR                  5       v   M     M&     g 7fr   )
file_linksrP  s      r<   r   rR  M  s5      6
,!  F!  ,rS  T)reversezLocal files found: %sre   )r   r/  r   collect_sources	functoolspartialrJ  	itertoolschainfrom_iterabler   rB  r   r6   isEnabledForloggingDEBUGr,   urlr   	file_path	Exceptionr8   r3   )
r^   rS   r=  collected_sourcespage_candidates_itrO  file_links_itfile_candidatespathsrG   s
             r<   find_all_candidates!PackageFinder.find_all_candidates/  s    ///''5511,? 00@@%!*!2!2((-" A 
 '__:: ;
,;
 
 12!55 6
,6
 
 --=$/

 w}}--/E,	 ~~))))5LL!9!9: - LL0$))E2BC .=-N\*##L11 ! 5LL!3!345s   ,%F/GGr   r   c           	          U R                   n[        R                  UU R                  UR                  UR
                  UUS9$ )z*Create a CandidateEvaluator object to use.)rS   rV   r   r   r   r   )r   r   r   r]   r   r   )r^   rS   r   r   r   s        r<   make_candidate_evaluator&PackageFinder.make_candidate_evaluatorh  sK     //!((%--)77"1"G"G ) 
 	
rO   c                     XU4U R                   ;   a  U R                   XU4   $ U R                  U5      nU R                  UUUS9nUR                  U5      U R                   XU4'   U R                   XU4   $ )zFind matches for the given project and specifier.

:param specifier: An optional object implementing `filter`
    (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable
    versions.

:return: A `BestCandidateResult` instance.
)rS   r   r   )r   rh  rk  r   )r^   rS   r   r   r   candidate_evaluators         r<   find_best_candidate!PackageFinder.find_best_candidatey  s     V,0E0EE((&)HII--l;
";;% < 
  66zB 	lv=> $$\f%DEErO   requpgradec                 8  ^^	 UR                   nUc   S5       eUR                  SS9nU R                  UUR                  US9nUR                  mSm	UR
                  b  UR
                  R                  m	S[        [           S[        4S jnT	c8  Tc5  [        R                  S	UU" UR                  5      5        [        S
U 35      eS[        [           SS4UU	4S jjnU(       dI  T	bF  U" T5      (       a"  [        R                  ST	TR                  5        g[        R                  ST	5        gU" T5      (       a3  [        R                  STR                  U" UR                   5      5        T$ [        R                  ST	U" UR                   5      5        ["        e)zTry to find a Link matching req

Expects req, an InstallRequirement and upgrade, a boolean
Returns a InstallationCandidate if found,
Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise
Nz&find_requirement() called with no nameF)trust_internet)r   r   	cand_iterr/   c           
          SR                  [        U  Vs1 s H  n[        UR                  5      iM     sn[        S95      =(       d    S$ s  snf )Nre   r   none)r3   r   r5   r;   parse_version)ru  r   s     r<   _format_versions8PackageFinder.find_requirement.<locals>._format_versions  sI     		1:;AQYY;)   <s   AzNCould not find a version that satisfies the requirement %s (from versions: %s)z#No matching distribution found for rG   z TypeGuard[InstallationCandidate]c                 2   > Tc  gTc  gTR                   T:  $ )NTF)r;   )rG   r   installed_versions    r<   _should_install_candidateAPackageFinder.find_requirement.<locals>._should_install_candidate  s)     !(%!)),===rO   zUExisting installed version (%s) satisfies requirement (most up-to-date version is %s)zLExisting installed version (%s) is most up-to-date and satisfies requirementz)Using version %s (newest of versions: %s)z=Installed version (%s) is most up-to-date (past versions: %s))ro   r   ro  r   r   satisfied_byr;   r   r   r5   r6   criticalr   r   r	   r8   r   r   )
r^   rq  rr  ro   r   best_candidate_resultry  r}  r   r|  s
           @@r<   find_requirementPackageFinder.find_requirement  s    xxI!II51 $ 8 8mm !9 !

 /==48' # 0 0 8 8	1F(G 	C 	 $)?OO& !6!E!EF	 ')LSE'RSS	> 56	>/	> 	> ,8(886%"**	  ,%
 $^44LL;&& !6!L!LM
 "! 	K2HHI	

 *)rO   )	r   rY   r   r   r[   r   r   r]   r   )NNNr   r   )NN)7rA   rB   rC   rD   r   r   r   r   r	   r   r   r_   r   r   r   propertyrV   r   r   setterr   r5   r  r  r	  r   r  r  r  r   r  r   r%  r+  rQ   r/  r   r7  r?   r;  r   r?  rB  rJ  rh  r   r   r#   r   rk  r)   ro  r    r  rN   r+   rO   r<   r*   r*   <  s    37:>15(%( $( 	(
 !/( ""67( !)( 
(\ 
 15	
%
 .
  -	

 

 
> #| # # 1k 1 1 9 9 9 9 /DI / / ,DI , , 6x} 6 6 +x} + + ;Xc] ; ; Xc]  
 ;t ; ;; 3t 3 33c 
 
 
$ DJ  *d *H *c *d *+37	'	(*+4<TN	#	$1>	#	$*72 72=R8S 72x 9=#'	

 J445
  	

 

( 9=#'	FF J445F  	F
 
F:X*%X*04X*	'	(X*rO   r*   fragmentrT   c                     [        U 5       H#  u  p#US:w  a  M  [        U SU 5      U:X  d  M!  Us  $    [        U  SU 35      e)a  Find the separator's index based on the package's canonical name.

:param fragment: A <package>+<version> filename "fragment" (stem) or
    egg fragment.
:param canonical_name: The package's canonical name.

This function is needed since the canonicalized name does not necessarily
have the same length as the egg info's name part. An example::

>>> fragment = 'foo__bar-1.0'
>>> canonical_name = 'foo-bar'
>>> _find_name_version_sep(fragment, canonical_name)
8
-Nz does not match )r   r   r   )r  rT   ir   s       r<   _find_name_version_sepr    sQ    $ (#8Xbq\*n<H	 $
 z!1.1AB
CCrO   c                 \     [        X5      S-   nXS nU(       d  gU$ ! [         a     gf = f)zParse the version string from a <package>+<version> filename
"fragment" (stem) or egg fragment.

:param fragment: The string to parse. E.g. foo-2.1
:param canonical_name: The canonicalized name of the package this
    belongs to.
rg   N)r  r   )r  rT   version_startr;   s       r<   rs   rs     sA    .xH1L ~&GN  s    
++)F)Xr   rE   rX  rZ  r^  r   dataclassesr   typingr   r   r   r   r   r	   r
   r   r   pip._vendor.packagingr   pip._vendor.packaging.tagsr   pip._vendor.packaging.utilsr   pip._vendor.packaging.versionr   r   r   rx  pip._internal.exceptionsr   r   r   r   pip._internal.index.collectorr   r   pip._internal.models.candidater   #pip._internal.models.format_controlr   pip._internal.models.linkr   !pip._internal.models.search_scoper   $pip._internal.models.selection_prefsr   "pip._internal.models.target_pythonr   pip._internal.models.wheelr   pip._internal.reqr    pip._internal.utils._logr!   pip._internal.utils.filetypesr"   pip._internal.utils.hashesr#   pip._internal.utils.loggingr$   pip._internal.utils.miscr%   pip._internal.utils.packagingr&   pip._internal.utils.unpackingr'   pip._vendor.typing_extensionsr(   __all__rA   r6   r   r5   BuildTagr   r   r=   Enumr?   rQ   r   r   r)   r   r*   r  rs   r+   rO   r<   <module>r     s   '     	 !
 
 
 - * 9 F @  E @ = * 9 E ; , 0 . 9 - 2 1 ? >7
C 
8	rE#s(O+,Cc<#PQ  $),
,S#&, !, 
	,^+tyy +L- L-^G*+GVG G 

 	GT ( ( ( $E E E2D
 D
Nr* r*jDS D# D# D4S # (SV- rO   