ó
    T=Œj­!  ã                  ó¢  • S SK J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	  S SK
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  \R2                  " \5      r\	\   r\	\   r\\/\	\   4   r\\/\4   r  " S
 S5      r!S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 jr(g)é    )ÚannotationsN)Údefaultdict)ÚCallableÚIterable)ÚInvalidSdistFilenameÚInvalidWheelFilenameÚcanonicalize_nameÚparse_sdist_filenameÚparse_wheel_filename)ÚInstallationCandidate)ÚLink)Úpath_to_urlÚurl_to_path)Úis_urlc                  ó<   • \ rS rSr\SS j5       rSS jrS	S jrSrg)
Ú
LinkSourceé   c                ó   • [        5       e)z,Returns the underlying link, if there's one.©ÚNotImplementedError©Úselfs    Ú_/Users/stevendouglas/BidBrain/.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©ÚreturnzLink | None©r&   ÚFoundCandidates©r&   Ú
FoundLinks)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Úpropertyr   r   r"   Ú__static_attributes__r$   r   r   r   r      s   † Øó$ó ð$ô$÷$r   r   c                ó8   • [         R                  " U SS9S   S:H  $ )NF)Ústrictr   z	text/html)Ú	mimetypesÚ
guess_type)Úfile_urls    r   Ú_is_html_filer6   -   s   € Ü×Ò °Ñ7¸Ñ:¸kÑIÐIr   c                  óT   • \ rS rSrSrS	S jrS
S jr\SS j5       r\SS j5       r	Sr
g)Ú_FlatDirectoryToUrlsé1   z"Scans directory and caches resultsc                óT   • Xl         / U l        [        [        5      U l        SU l        g )NF)Ú_pathÚ_page_candidatesr   ÚlistÚ_project_name_to_urlsÚ_scanned_directory)r   Úpaths     r   Ú__init__Ú_FlatDirectoryToUrls.__init__4   s$   € ØŒ
Ø+-ˆÔÜ;FÄtÓ;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! [         a.     [        UR                  5      S   n NO! [         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@   r6   r<   Úappendr   Únamer   r
   r   r>   r?   )r   ÚentryÚurlÚproject_filenames       r   Ú_scan_directoryÚ$_FlatDirectoryToUrls._scan_directory:   sÆ   € ô —Z’Z §
¡
Ö+ˆEÜ˜eŸj™jÓ)ˆCÜ˜S×!Ñ!Ø×%Ñ%×,Ñ,¨SÔ1ÙðÜ#7¸¿
¹
Ó#CÀAÑ#FÐ ð ×&Ñ&Ð'7Ñ8×?Ñ?ÀÖDñ! ,ð" #'ˆÕøô (ó ðÜ';¸E¿J¹JÓ'GÈÑ'JÒ$øÜ+ó Ûðúðús*   Á'B)Â)
C!Â4CÃ
CÃC!ÃCÃC!c                ó\   • U R                   (       d  U R                  5         U R                  $ ©N)r?   rK   r<   r   s    r   r   Ú$_FlatDirectoryToUrls.page_candidatesQ   s#   € à×&×&Ø× Ñ Ô"à×$Ñ$Ð$r   c                ó\   • U R                   (       d  U R                  5         U R                  $ rN   )r?   rK   r>   r   s    r   Úproject_name_to_urlsÚ)_FlatDirectoryToUrls.project_name_to_urlsX   s#   € à×&×&Ø× Ñ Ô"à×)Ñ)Ð)r   )r<   r;   r>   r?   N)r@   Ústrr&   ÚNone)r&   rT   )r&   z	list[str])r&   zdict[str, list[str]])r+   r,   r-   r.   Ú__doc__rA   rK   r/   r   rQ   r0   r$   r   r   r8   r8   1   s7   † Ù,ô(ô'ð. ó%ó ð%ð ó*ó ó*r   r8   c                  ój   • \ rS rSr% Sr0 rS\S'           SS jr\SS j5       r	SS jr
SS jrS	rg
)Ú_FlatDirectorySourceé`   zëLink 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.
zdict[str, _FlatDirectoryToUrls]Ú_paths_to_urlsc                óÆ   • 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_urlsr8   )r   Úcandidates_from_pager@   Úproject_names       r   rA   Ú_FlatDirectorySource.__init__k   s[   € ð &:Ô"Ü.¨|Ó<ˆÔð ×&Ñ&Ó&Ø!%×!4Ñ!4°TÑ!:ˆDÕä!5¸4Ñ!@ˆDÔØ(,×(:Ñ(:ˆD×Ñ Ò%r   c                ó   • g rN   r$   r   s    r   r   Ú_FlatDirectorySource.link{   s   € àr   c              #  óŽ   #   • U R                   R                   H%  nU R                  [        U5      5       S h  v•N   M'     g  N	7frN   )r]   r   r[   r   ©r   rI   s     r   r   Ú$_FlatDirectorySource.page_candidates   s6   é € Ø×%Ñ%×5Ô5ˆCØ×1Ñ1´$°s³)Ó<×<Ò<ò 6Ù<ùs   ‚7A¹Aº
Ac              #  óz   #   • U R                   R                  U R                      H  n[        U5      v •  M     g 7frN   )r]   rQ   r\   r   rd   s     r   r"   Ú_FlatDirectorySource.file_linksƒ   s0   é € Ø×%Ñ%×:Ñ:¸4×;MÑ;MÔNˆCÜ�s“)ŒOò Oùs   ‚9;)r[   r]   r\   N)r^   ÚCandidatesFromPager@   rS   r_   rS   r&   rT   r%   r'   r)   )r+   r,   r-   r.   rU   rY   Ú__annotations__rA   r/   r   r   r"   r0   r$   r   r   rW   rW   `   s]   ‡ ñð 79€NÐ3Ó8ð;à0ð;ð ð;ð ð	;ð
 
ô;ð  óó ðô=÷r   rW   c                  óV   • \ rS rSrSr      S	S jr\S
S j5       rSS jrS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.
c                ó   • Xl         X l        g rN   ©r[   Ú_link©r   r^   r   s      r   rA   Ú_LocalFileSource.__init__’   ó   € ð
 &:Ô"Ø�
r   c                ó   • U R                   $ rN   ©ro   r   s    r   r   Ú_LocalFileSource.linkš   ó   € à�z‰zÐr   c              #  ó    #   • [        U R                  R                  5      (       d  g U R                  U R                  5       S h  v•N   g  N7frN   )r6   ro   rI   r[   r   s    r   r   Ú _LocalFileSource.page_candidatesž   s3   é € Ü˜TŸZ™ZŸ^™^×,Ñ,ØØ×-Ñ-¨d¯j©jÓ9×9Ó9ùs   ‚AAÁAÁAc              #  ór   #   • [        U R                  R                  5      (       a  g U R                  v •  g 7frN   )r6   ro   rI   r   s    r   r"   Ú_LocalFileSource.file_links£   s%   é € Ü˜Ÿ™Ÿ™×(Ñ(ØØ�j‰jÓùs   ‚57rn   N©r^   rh   r   r   r&   rT   r%   r'   r)   ©r+   r,   r-   r.   rU   rA   r/   r   r   r"   r0   r$   r   r   rk   rk   ˆ   sF   † ñðà0ðð ðð 
ô	ð óó ðô:÷
r   rk   c                  óZ   • \ rS rSrSr        S	S jr\S
S j5       rSS jrS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.
c                ó(   • Xl         X l        X0l        g rN   )r[   Ú_page_validatorro   )r   r^   Úpage_validatorr   s       r   rA   Ú_RemoteFileSource.__init__²   s   € ð &:Ô"Ø-ÔØ�
r   c                ó   • U R                   $ rN   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rN   )r�   ro   r[   r   s    r   r   Ú!_RemoteFileSource.page_candidatesÀ   s5   é € Ø×#Ñ# D§J¡J×/Ñ/ØØ×-Ñ-¨d¯j©jÓ9×9Ó9ùs   ‚A A
ÁAÁA
c              #  ó(   #   • U R                   v •  g 7frN   rt   r   s    r   r"   Ú_RemoteFileSource.file_linksÅ   s   é € Ø�j‰jÓùs   ‚)r[   ro   r�   N)r^   rh   r‚   ÚPageValidatorr   r   r&   rT   r%   r'   r)   r|   r$   r   r   r~   r~   ©   sP   † ñðà0ðð &ðð ð	ð
 
ôð óó ðô:÷
r   r~   c                  óV   • \ rS rSrSr      S	S jr\S
S j5       rSS jrS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.
c                ó   • Xl         X l        g rN   rn   rp   s      r   rA   Ú_IndexDirectorySource.__init__Ð   rr   r   c                ó   • U R                   $ rN   rt   r   s    r   r   Ú_IndexDirectorySource.linkØ   rv   r   c              #  óV   #   • U R                  U R                  5       S h  v•N   g  N7frN   rn   r   s    r   r   Ú%_IndexDirectorySource.page_candidatesÜ   s   é € Ø×-Ñ-¨d¯j©jÓ9×9Ó9ùs   ‚)¡'¢)c                ó   • g)Nr$   r$   r   s    r   r"   Ú _IndexDirectorySource.file_linksß   s   € Ør   rn   Nr{   r%   r'   r)   r|   r$   r   r   rŒ   rŒ   É   sF   † ñðà0ðð ðð 
ô	ð óó ðô:÷r   rŒ   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                  X€5        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)Úcache_link_parsing)r^   r‚   r   )r^   r@   r_   )r^   r   z?Location '%s' is ignored: it is neither a file nor a directory.)rD   r@   Úexistsr   Ú
startswithr   r   ÚloggerÚwarningr~   r   ÚisdirrW   rŒ   Úisfilerk   )
Úlocationr^   r‚   Ú
expand_dirr—   r_   r@   rI   ÚmsgÚsources
             r   Úbuild_sourcer¢   ã   sL  € ð €DØ€CÜ	‡w�w‡~�~�h×ÑÜ˜(Ó#ˆØ‰Ø	×	Ñ	˜W×	%Ñ	%ØˆÜ˜8Ó$‰Ü	�×	Ñ	Øˆà
�{ðKð 	ô 	�‰�sÔ%Øà�|Ü.Ø!5Ø)Ü�cÑAñ
ˆð
 ˆ}Ðä	‡w�w‡}�}�T×ÑÞÜ)Ø%9ØØ)ñˆFð ˆ}Ðô	 +Ø%9Ü˜#ÑEñˆFð ˆ}ÐÜ	�‰�‰˜×	Ñ	Ü!Ø!5Ü�cÑAñ
ˆð ˆ}ÐÜ
‡N�NØIØôð �ˆ;Ðr   )r5   rS   r&   Úbool)rž   rS   r^   rh   r‚   rŠ   rŸ   r£   r—   r£   r_   rS   r&   z$tuple[str | None, LinkSource | None]))Ú
__future__r   Úloggingr3   rD   Úcollectionsr   Úcollections.abcr   r   Úpip._vendor.packaging.utilsr   r   r	   r
   r   Úpip._internal.models.candidater   Úpip._internal.models.linkr   Úpip._internal.utils.urlsr   r   Úpip._internal.vcsr   Ú	getLoggerr+   rš   r(   r*   rh   r£   rŠ   r   r6   r8   rW   rk   r~   rŒ   r¢   r$   r   r   Ú<module>r®      s  ðÝ "ã Û Û 	Ý #ß .÷õ õ AÝ *ß =Ý $à	×	Ò	˜8Ó	$€àÐ0Ñ1€Ø�d‰^€
Ø˜t˜f hÐ/DÑ&EÐEÑFÐ Ø˜$˜ ˜Ñ&€÷$ñ $ôJ÷,*ñ ,*ô^%˜:ô %ôP�zô ôB˜
ô ô@˜Jô ð4;Øð;ð -ð;ð "ð	;ð
 ð;ð ð;ð ð;ð *õ;r   