+
     h!  c                   s   ^ RI t ^ RIt^ RIt^ RIHt ^ RIHtHtHtH	t	H
t
Ht ^ RIHtHtHtHtHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ] P6                  ! ]4      t]],          t]],          t]].]],          3,          t ]].]!3,          t" ! R	 R
4      t#R R lt$ ! R R4      t% ! R R]#4      t& ! R R]#4      t' ! R R]#4      t( ! R R]#4      t)R R lt*R# )i    N)defaultdict)CallableDictIterableListOptionalTuple)InvalidSdistFilenameInvalidWheelFilenamecanonicalize_nameparse_sdist_filenameparse_wheel_filename)InstallationCandidate)Link)path_to_urlurl_to_path)is_urlc                   s`   a  ] tR t^t o ]V 3R lR l4       tV 3R lR ltV 3R lR ltRtV t	R# )	
LinkSourcec                0   < V ^8  d   QhRS[ S[,          /#    returnr   r   format__classdict__   "@/usr/lib/python3.14/site-packages/pip/_internal/index/sources.py__annotate__LinkSource.__annotate__   s     $ $htn $    c                    \        4       h)z,Returns the underlying link, if there's one.ZNotImplementedErrorself   &r   linkZLinkSource.link   s     "##r   c                    < V ^8  d   QhRS[ /# r   FoundCandidatesr   r   r   r   r   "   s     $ $ $r   c                r   )z9Candidates found by parsing an archive listing HTML file.r    r!   r#   r   page_candidatesZLinkSource.page_candidates"       !##r   c                r%   r   
FoundLinksr   r   r   r   r   &   s     $ $J $r   c                r   )z,Links found by specifying archives directly.r    r!   r#   r   
file_linksZLinkSource.file_links&   r)   r    N)
__name__
__module____qualname____firstlineno__propertyr$   r(   r,   __static_attributes____classdictcell__r      @r   r   r      s+     $ $$ $$ $r   r   c                s0    V ^8  d   QhR\         R\        /# )r   file_urlr   )strboolr      "r   r   r   +   s     J JC JD Jr   c                 sF    \         P                  ! V R R7      ^ ,          R8H  # )F)Zstrictz	text/html)	mimetypesZ
guess_type)r7   r#   r   _is_html_filer=   +   s    7:kIIr   c                   s   a  ] tR t^/t o RtV 3R lR ltV 3R lR lt]V 3R lR l4       t]V 3R lR	 l4       t	R
t
V tR# )_FlatDirectoryToUrlsz"Scans directory and caches resultsc                s$   < V ^8  d   QhRS[ RR/# )r   pathr   N)r8   r   r   r   r   !_FlatDirectoryToUrls.__annotate__2   s     ( (S (T (r   c                sV    Wn         . V n        \        \        4      V n        R V n        R# )FN)_path_page_candidatesr    Zlist_project_name_to_urls_scanned_directory)r"   r?   s   &&r   __init__Z_FlatDirectoryToUrls.__init__2   s$    
+-;Ft;L""'r   c                s   < V ^8  d   QhRR/# )r   r   Nr-   r   r   r   r   r@   8   s     ' ' 'r   c                s   \         P                  ! V P                  4       F  p\        VP                  4      p\        V4      '       d   V P                  P                  V4       KF   \        VP                  4      ^ ,          pT P                  T,          P                  T4       K  	  RV n        R#   \         d4     \        TP                  4      ^ ,          p LY  \         d      K  i ; ii ; i)zbScans directory once and populates both page_candidates
and project_name_to_urls at the same time
TN)osZscandirrA   r   r?   r=   rB   Zappendr   Znamer   r
   r   rC   rD   )r"   ZentryurlZproject_filenames   &   r   _scan_directoryZ$_FlatDirectoryToUrls._scan_directory8   s     ZZ

+Eejj)CS!!%%,,S1#7

#CA#F  &&'78??D! ," #' ( ';EJJ'G'J$+ s*   (B33C1?CC-(C1,C--C1c                r   r   )r   r8   r   r   r   r   r@   P   s     % %c %r   c                ^    V P                   '       g   V P                  4        V P                  # N)rD   rH   rB   r!   r#   r   r(   Z$_FlatDirectoryToUrls.page_candidatesO   s&    &&&  "$$$r   c                sF   < V ^8  d   QhRS[ S[S[S[,          3,          /# r   )r   r8   r   r   r   r   r   r@   W   s!     * *d3S	>&: *r   c                rI   rJ   )rD   rH   rC   r!   r#   r   project_name_to_urlsZ)_FlatDirectoryToUrls.project_name_to_urlsV   s&    &&&  ")))r   )rB   rA   rC   rD   N)r.   r/   r0   r1   __doc__rE   rH   r2   r(   rK   r3   r4   r5   r6   r   r>   r>   /   sD     ,( (' '. % % * *r   r>   c                   s   a  ] tR t^^t o Rt/ tV 3R lR lt]V 3R lR l4       tV 3R lR lt	V 3R lR	 lt
V 3R
 ltRtV tR# )_FlatDirectorySourcezLink source specified by ``--find-links=<path-to-dir>``.

This looks the content of the directory, and returns:

* ``page_candidates``: Links listed on each HTML file in the directory.
* ``file_candidates``: Archives in the directory.
c                s0   < V ^8  d   QhRS[ RS[RS[RR/# )r   candidates_from_pager?   project_namer   N)CandidatesFromPager8   r   r   r   r   !_FlatDirectorySource.__annotate__i   s3     ; ;0; ; 	;
 
;r   c                s    Wn         \        V4      V n        W P                  9   d   V P                  V,          V n        R# \        VR 7      V n        V P                  V P                  V&   R# ))r?   N)_candidates_from_pager	   _project_name_paths_to_urls_path_to_urlsr>   )r"   rN   r?   rO      &&&&r   rE   Z_FlatDirectorySource.__init__i   s[     &:".|< &&&!%!4!4T!:D!54!@D(,(:(:D%r   c                r   r   r   r   r   r   r   rQ   z   s      htn r   c                s    R # rJ   r-   r!   r#   r   r$   Z_FlatDirectorySource.linky   s    r   c                r%   r   r&   r   r   r   r   rQ   }   s     = = =r   c              #  s   "   V P                   P                   F%  pV P                  \        V4      4       R j  xL
  K'  	  R #  L
5irJ   )rU   r(   rR   r   r"   rG      & r   r(   Z$_FlatDirectorySource.page_candidates}   s6     %%55C11$s)<<< 6<s   7AAAc                r%   r   r*   r   r   r   r   rQ      s      J r   c              #  s   "   V P                   P                  V P                  ,           F  p\        V4      x  K  	  R # 5irJ   )rU   rK   rS   r   rW   rX   r   r,   Z_FlatDirectorySource.file_links   s3     %%::4;M;MNNCs)O Os   >A c                s<   < V ^8  d   Qh/ S[ S[S[3,          ;R&   # )r   rT   )r   r8   r>   r   r   r   r   rQ   ^   s      2238 r   )rR   rU   rS   N)r.   r/   r0   r1   rL   rT   rE   r2   r$   r(   r,   Z__annotate_func__r3   r4   r5   r6   r   rM   rM   ^   sK      79N; ;   = = G  r   rM   c                   sv   a  ] tR t^t o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltV 3R lR	 lt	R
t
V tR# )_LocalFileSourcea/  ``--find-links=<path-or-url>`` or ``--[extra-]index-url=<path-or-url>``.

If a URL is supplied, it must be a ``file:`` URL. If a path is supplied to
the option, it is converted to a URL first. This returns:

* ``page_candidates``: Links listed on an HTML file.
* ``file_candidates``: The non-HTML file.
c                *   < V ^8  d   QhRS[ RS[RR/# r   rN   r$   r   NrP   r   r   r   r   r   _LocalFileSource.__annotate__   )      0  
	r   c                    Wn         W n        R # rJ   rR   _linkr"   rN   r$      &&&r   rE   Z_LocalFileSource.__init__       
 &:"
r   c                r   r   r   r   r   r   r   r]            htn r   c                    V P                   # rJ   ra   r!   r#   r   r$   Z_LocalFileSource.link       zzr   c                r%   r   r&   r   r   r   r   r]           : : :r   c              #  s   "   \        V P                  P                  4      '       g   R # V P                  V P                  4       R j  xL
  R #  L5irJ   )r=   ra   rG   rR   r!   r#   r   r(   Z _LocalFileSource.page_candidates   s3     TZZ^^,,--djj999s   AAA	Ac                r%   r   r*   r   r   r   r   r]      s      J r   c              #  sx   "   \        V P                  P                  4      '       d   R # V P                  x  R # 5irJ   )r=   ra   rG   r!   r#   r   r,   Z_LocalFileSource.file_links   s%     ((jjs   8:r`   Nr.   r/   r0   r1   rL   rE   r2   r$   r(   r,   r3   r4   r5   r6   r   rY   rY      s<        : :
 r   rY   c                   sv   a  ] tR t^t o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltV 3R lR	 lt	R
t
V tR# )_RemoteFileSourcez``--find-links=<url>`` or ``--[extra-]index-url=<url>``.

This returns:

* ``page_candidates``: Links listed on an HTML file.
* ``file_candidates``: The non-HTML file.
c                s0   < V ^8  d   QhRS[ RS[RS[RR/# )r   rN   page_validatorr$   r   N)rP   PageValidatorr   r   r   r   r   _RemoteFileSource.__annotate__   s3      0 & 	
 
r   c                s*    Wn         W n        W0n        R # rJ   )rR   _page_validatorra   )r"   rN   rl   r$   rV   r   rE   Z_RemoteFileSource.__init__   s     &:"-
r   c                r   r   r   r   r   r   r   rn      re   r   c                rf   rJ   rg   r!   r#   r   r$   Z_RemoteFileSource.link   rh   r   c                r%   r   r&   r   r   r   r   rn      ri   r   c              #  s   "   V P                  V P                  4      '       g   R # V P                  V P                  4       R j  xL
  R #  L5irJ   )ro   ra   rR   r!   r#   r   r(   Z!_RemoteFileSource.page_candidates   s5     ##DJJ//--djj999s   AAAAc                r%   r   r*   r   r   r   r   rn      s      J r   c              #  s*   "   V P                   x  R # 5irJ   rg   r!   r#   r   r,   Z_RemoteFileSource.file_links   s     jjs   )rR   ra   ro   Nrj   r5   r6   r   rk   rk      s<        : :
 r   rk   c                   sv   a  ] tR t^t o RtV 3R lR lt]V 3R lR l4       tV 3R lR ltV 3R lR	 lt	R
t
V tR# )_IndexDirectorySourcez``--[extra-]index-url=<path-to-directory>``.

This is treated like a remote URL; ``candidates_from_page`` contains logic
for this by appending ``index.html`` to the link.
c                rZ   r[   r\   r   r   r   r   "_IndexDirectorySource.__annotate__   r^   r   c                r_   rJ   r`   rb   rc   r   rE   Z_IndexDirectorySource.__init__   rd   r   c                r   r   r   r   r   r   r   rq      re   r   c                rf   rJ   rg   r!   r#   r   r$   Z_IndexDirectorySource.link   rh   r   c                r%   r   r&   r   r   r   r   rq      s     : : :r   c              #  sX   "   V P                  V P                  4       R j  xL
  R #  L5irJ   r`   r!   r#   r   r(   Z%_IndexDirectorySource.page_candidates   s     --djj999s   *(*c                r%   r   r*   r   r   r   r   rq      s      J r   c                s    R# )Nr-   r-   r!   r#   r   r,   Z _IndexDirectorySource.file_links   s    	r   r`   Nrj   r5   r6   r   rp   rp      s<        : : r   rp   c                s    V ^8  d   QhR\         R\        R\        R\        R\        R\         R\        \
        \         ,          \
        \        ,          3,          /# )r   locationrN   rl   
expand_dircache_link_parsingrO   r   )r8   rP   rm   r9   r   r   r   r:   r;   r   r   r      sc     ; ;; -; "	;
 ; ; ; 8C=(:../;r   c          	      s   R pR p\         P                  P                  V 4      '       d   \        V 4      pT pM8V P	                  R4      '       d   T p\        V 4      pM\        V 4      '       d   T pVf   Rp\        P                  W4       R# Vf   \        VV\        WtR7      R7      p	Wy3# \         P                  P                  V4      '       d4   V'       d   \        VVVR7      p	Wy3# \        V\        WtR7      R7      p	Wy3# \         P                  P                  V4      '       d   \        V\        WtR7      R7      p	Wy3# \        P                  RV 4       VR 3# )	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)rt   )rN   rl   r$   )rN   r?   rO   )rN   r$   z?Location '%s' is ignored: it is neither a file nor a directory.)NN)rF   r?   Zexistsr   Z
startswithr   r   loggerZwarningrk   r   ZisdirrM   rp   ZisfilerY   )
rr   rN   rl   rs   rt   rO   r?   rG   ZmsgZsources
   &$$$$$    r   build_sourcerv      sO    DC	ww~~h(#			W	%	%8$			
{K 	 	s%|.!5)cA

 }	ww}}T)%9)F }	 +%9#EF }			!!5cA
 }
NNI ;r   )+Zloggingr<   rF   Zcollectionsr    Ztypingr   r   r   r   r   r   Zpip._vendor.packaging.utilsr   r   r	   r
   r   Zpip._internal.models.candidater   Zpip._internal.models.linkr   Zpip._internal.utils.urlsr   r   Zpip._internal.vcsr   Z	getLoggerr.   ru   r'   r+   rP   r9   rm   r   r=   r>   rM   rY   rk   rp   rv   r-   r   r   <module>rw      s      	 # B B  A * = $			8	$01d^
tfh/D&EEF $&$ $J,* ,*^%: %Pz B
 @J 4;r   