
    vKg!                        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  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  S SKJrJr  S SKJr  \ R8                  " \5      r\\   r\\   r \\/\\   4   r!\\/\"4   r# " S	 S
5      r$S\%S\"4S jr& " S S5      r' " S S\$5      r( " S S\$5      r) " S S\$5      r* " S S\$5      r+S\%S\!S\#S\"S\"S\%S\\
\%   \
\$   4   4S jr,g)    N)defaultdict)CallableDictIterableListOptionalTuple)InvalidSdistFilenameInvalidVersionInvalidWheelFilenamecanonicalize_nameparse_sdist_filenameparse_wheel_filename)InstallationCandidate)Link)path_to_urlurl_to_path)is_urlc                   N    \ rS rSr\S\\   4S j5       rS\4S jr	S\
4S jrSrg)
LinkSource   returnc                     [        5       e)z,Returns the underlying link, if there's one.NotImplementedErrorselfs    [/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/pip/_internal/index/sources.pylinkLinkSource.link   s     "##    c                     [        5       e)z9Candidates found by parsing an archive listing HTML file.r   r   s    r   page_candidatesLinkSource.page_candidates#       !##r!   c                     [        5       e)z,Links found by specifying archives directly.r   r   s    r   
file_linksLinkSource.file_links'   r%   r!    N)__name__
__module____qualname____firstlineno__propertyr   r   r   FoundCandidatesr#   
FoundLinksr'   __static_attributes__r)   r!   r   r   r      s7    $htn $ $$ $$J $r!   r   file_urlr   c                 8    [         R                  " U SS9S   S:H  $ )NF)strictr   z	text/html)	mimetypes
guess_type)r2   s    r   _is_html_filer7   ,   s    7:kIIr!   c                   z    \ rS rSrSrS\SS4S jrSS jr\S\	\   4S j5       r
\S\\\	\   4   4S	 j5       rS
rg)_FlatDirectoryToUrls0   z"Scans directory and caches resultspathr   Nc                 T    Xl         / U l        [        [        5      U l        SU l        g )NF)_path_page_candidatesr   list_project_name_to_urls_scanned_directory)r   r;   s     r   __init___FlatDirectoryToUrls.__init__3   s$    
+-;Ft;L""'r!   c                    [         R                  " U R                  5       H|  n[        UR                  5      n[        U5      (       a  U R                  R                  U5        ME   [        UR                  5      S   nU R                  U   R                  U5        M~     SU l        g! [        [        4 a4     [        UR                  5      S   n NU! [        [        4 a      M  f = ff = f)zbScans directory once and populates both page_candidates
and project_name_to_urls at the same time
r   TN)osscandirr=   r   r;   r7   r>   appendr   namer   r   r   r
   r@   rA   )r   entryurlproject_filenames       r   _scan_directory$_FlatDirectoryToUrls._scan_directory9   s     ZZ

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

#CA#F  &&'78??D! ," #' ).9 ';EJJ'G'J$,n= s*   'B))C-:CC)$C-(C))C-c                 \    U R                   (       d  U R                  5         U R                  $ N)rA   rL   r>   r   s    r   r#   $_FlatDirectoryToUrls.page_candidatesP   s#    &&  "$$$r!   c                 \    U R                   (       d  U R                  5         U R                  $ rO   )rA   rL   r@   r   s    r   project_name_to_urls)_FlatDirectoryToUrls.project_name_to_urlsW   s#    &&  ")))r!   )r>   r=   r@   rA   )r   N)r*   r+   r,   r-   __doc__strrB   rL   r.   r   r#   r   rR   r1   r)   r!   r   r9   r9   0   sd    ,(S (T ('. %c % % *d3S	>&: * *r!   r9   c                       \ rS rSr% Sr0 r\\\4   \	S'   S\
S\S\SS4S	 jr\S\\   4S
 j5       rS\4S jrS\4S jrSrg)_FlatDirectorySource_   zLink 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.
_paths_to_urlscandidates_from_pager;   project_namer   Nc                     Xl         [        U5      U l        X R                  ;   a  U R                  U   U l        g [        US9U l        U R                  U R                  U'   g )N)r;   )_candidates_from_pager   _project_namerY   _path_to_urlsr9   )r   rZ   r;   r[   s       r   rB   _FlatDirectorySource.__init__j   s[     &:".|< &&&!%!4!4T!:D!54!@D(,(:(:D%r!   c                     g rO   r)   r   s    r   r   _FlatDirectorySource.linkz   s    r!   c              #      #    U R                   R                   H%  nU R                  [        U5      5       S h  vN   M'     g  N	7frO   )r_   r#   r]   r   r   rJ   s     r   r#   $_FlatDirectorySource.page_candidates~   s6     %%55C11$s)<<< 6<s   7AA
Ac              #   z   #    U R                   R                  U R                      H  n[        U5      v   M     g 7frO   )r_   rR   r^   r   rd   s     r   r'   _FlatDirectorySource.file_links   s0     %%::4;M;MNCs)O Os   9;)r]   r_   r^   )r*   r+   r,   r-   rT   rY   r   rU   r9   __annotations__CandidatesFromPagerB   r.   r   r   r   r/   r#   r0   r'   r1   r)   r!   r   rW   rW   _   s     79ND2238;0; ; 	;
 
;  htn  = =J r!   rW   c                   h    \ rS rSrSrS\S\SS4S jr\S\	\   4S j5       r
S\4S	 jrS\4S
 jrSrg)_LocalFileSource   a/  ``--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.
rZ   r   r   Nc                     Xl         X l        g rO   r]   _linkr   rZ   r   s      r   rB   _LocalFileSource.__init__       
 &:"
r!   c                     U R                   $ rO   ro   r   s    r   r   _LocalFileSource.link       zzr!   c              #      #    [        U R                  R                  5      (       d  g U R                  U R                  5       S h  vN   g  N7frO   )r7   ro   rJ   r]   r   s    r   r#    _LocalFileSource.page_candidates   s3     TZZ^^,,--djj999s   AAAAc              #   r   #    [        U R                  R                  5      (       a  g U R                  v   g 7frO   )r7   ro   rJ   r   s    r   r'   _LocalFileSource.file_links   s%     ((jjs   57rn   r*   r+   r,   r-   rT   ri   r   rB   r.   r   r   r/   r#   r0   r'   r1   r)   r!   r   rk   rk      s_    0  
	 htn  : :
J r!   rk   c                   l    \ rS rSrSrS\S\S\SS4S jr\	S\
\   4S	 j5       rS\4S
 jrS\4S jrSrg)_RemoteFileSource   z``--find-links=<url>`` or ``--[extra-]index-url=<url>``.

This returns:

* ``page_candidates``: Links listed on an HTML file.
* ``file_candidates``: The non-HTML file.
rZ   page_validatorr   r   Nc                 (    Xl         X l        X0l        g rO   )r]   _page_validatorro   )r   rZ   r   r   s       r   rB   _RemoteFileSource.__init__   s     &:"-
r!   c                     U R                   $ rO   rt   r   s    r   r   _RemoteFileSource.link   rv   r!   c              #      #    U R                  U R                  5      (       d  g U R                  U R                  5       S h  vN   g  N7frO   )r   ro   r]   r   s    r   r#   !_RemoteFileSource.page_candidates   s5     ##DJJ//--djj999s   A A
AA
c              #   (   #    U R                   v   g 7frO   rt   r   s    r   r'   _RemoteFileSource.file_links   s     jjs   )r]   ro   r   )r*   r+   r,   r-   rT   ri   PageValidatorr   rB   r.   r   r   r/   r#   r0   r'   r1   r)   r!   r   r}   r}      si    0 & 	
 
 htn  : :
J r!   r}   c                   h    \ rS rSrSrS\S\SS4S jr\S\	\   4S j5       r
S\4S	 jrS\4S
 jrSrg)_IndexDirectorySource   z``--[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.
rZ   r   r   Nc                     Xl         X l        g rO   rn   rp   s      r   rB   _IndexDirectorySource.__init__   rr   r!   c                     U R                   $ rO   rt   r   s    r   r   _IndexDirectorySource.link   rv   r!   c              #   V   #    U R                  U R                  5       S h  vN   g  N7frO   rn   r   s    r   r#   %_IndexDirectorySource.page_candidates   s     --djj999s   )')c                     g)Nr)   r)   r   s    r   r'    _IndexDirectorySource.file_links   s    r!   rn   r{   r)   r!   r   r   r      s_    0  
	 htn  : :J r!   r   locationrZ   r   
expand_dircache_link_parsingr[   c          	      ~   S nS n[         R                  R                  U 5      (       a  [        U 5      nU nO6U R	                  S5      (       a  U n[        U 5      nO[        U 5      (       a  U nUc  Sn[        R                  X5        gUc  [        UU[        XtS9S9n	Xy4$ [         R                  R                  U5      (       a)  U(       a  [        UUUS9n	Xy4$ [        U[        XtS9S9n	Xy4$ [         R                  R                  U5      (       a  [        U[        XtS9S9n	Xy4$ [        R                  SU 5        US 4$ )	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)r   )rZ   r   r   )rZ   r;   r[   )rZ   r   z?Location '%s' is ignored: it is neither a file nor a directory.)rE   r;   existsr   
startswithr   r   loggerwarningr}   r   isdirrW   r   isfilerk   )
r   rZ   r   r   r   r[   r;   rJ   msgsources
             r   build_sourcer      sL    DC	ww~~h(#			W	%	%8$			
{K 	 	s%|.!5)cA

 }	ww}}T)%9)F }	 +%9#EF }			!!5cA
 }
NNI ;r!   )-loggingr5   rE   collectionsr   typingr   r   r   r   r   r	   pip._vendor.packaging.utilsr
   r   r   r   r   r   pip._internal.models.candidater   pip._internal.models.linkr   pip._internal.utils.urlsr   r   pip._internal.vcsr   	getLoggerr*   r   r/   r0   ri   boolr   r   rU   r7   r9   rW   rk   r}   r   r   r)   r!   r   <module>r      s6     	 # B B  A * = $			8	$01d^
tfh/D&EEF $&$ $JC JD J,* ,*^%: %Pz B
 @J 4;; -; "	;
 ; ; ; 8C=(:../;r!   