Ë
    ”U.j¿!  ã                  ó¦  — d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZmZmZmZmZ d dlmZ d dlmZ d d	lmZmZ d d
lmZ  ej4                  e«      Zee   Zee   Ze
egee   f   Ze
ege f   Z! G d„ d«      Z"dd„Z# G d„ d«      Z$ G d„ de"«      Z% G d„ de"«      Z& G d„ de"«      Z' G d„ de"«      Z(	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z)y)é    )ÚannotationsN)Údefaultdict)ÚIterable)ÚCallable)ÚInvalidSdistFilenameÚInvalidWheelFilenameÚcanonicalize_nameÚparse_sdist_filenameÚparse_wheel_filename)ÚInstallationCandidate)ÚLink)Úpath_to_urlÚurl_to_path)Úis_urlc                  ó.   — e Zd Zedd„«       Zdd„Zdd„Zy)Ú
LinkSourcec                ó   — t        «       ‚)z,Returns the underlying link, if there's one.©ÚNotImplementedError©Úselfs    ú]C:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\pip/_internal/index/sources.pyÚlinkzLinkSource.link    s   € ô "Ó#Ð#ó    c                ó   — t        «       ‚)z9Candidates found by parsing an archive listing HTML file.r   r   s    r   Úpage_candidateszLinkSource.page_candidates%   ó   € ä!Ó#Ð#r   c                ó   — t        «       ‚)z,Links found by specifying archives directly.r   r   s    r   Ú
file_linkszLinkSource.file_links)   r   r   N©ÚreturnzLink | None©r!   ÚFoundCandidates©r!   Ú
FoundLinks)Ú__name__Ú
__module__Ú__qualname__Úpropertyr   r   r   © r   r   r   r      s   „ Øò$ó ð$ó$ô$r   r   c                ó<   — t        j                  | d¬«      d   dk(  S )NF)Ústrictr   z	text/html)Ú	mimetypesÚ
guess_type)Úfile_urls    r   Ú_is_html_filer0   .   s   € Ü×Ñ °Ô7¸Ñ:¸kÑIÐIr   c                  óD   — e Zd ZdZdd„Zdd„Zed	d„«       Zed
d„«       Zy)Ú_FlatDirectoryToUrlsz"Scans directory and caches resultsc                óV   — || _         g | _        t        t        «      | _        d| _        y )NF)Ú_pathÚ_page_candidatesr   ÚlistÚ_project_name_to_urlsÚ_scanned_directory)r   Úpaths     r   Ú__init__z_FlatDirectoryToUrls.__init__5   s&   € ØˆŒ
Ø+-ˆÔÜ;FÄtÓ;LˆÔ"Ø"'ˆÕr   c                ó²  — t        j                  | j                  «      D ]u  }t        |j                  «      }t        |«      r| j                  j                  |«       Œ?	 t        |j                  «      d   }| j                  |   j                  |«       Œw d| _        y# t        $ r- 	 t        |j                  «      d   }n# t        $ r Y Y Œ¯w xY wY Œ]w xY w)zrScans directory once and populates both page_candidates
        and project_name_to_urls at the same time
        r   TN)ÚosÚscandirr4   r   r9   r0   r5   Úappendr   Únamer   r
   r   r7   r8   )r   ÚentryÚurlÚproject_filenames       r   Ú_scan_directoryz$_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Ñ$øÜ+ò Úðúñ %ðús6   Á B Â 	CÂ*CÃCÃ	CÃCÃCÃCÃCc                óR   — | j                   s| j                  «        | j                  S ©N)r8   rC   r5   r   s    r   r   z$_FlatDirectoryToUrls.page_candidatesR   s#   € à×&Ò&Ø× Ñ Ô"à×$Ñ$Ð$r   c                óR   — | j                   s| j                  «        | j                  S rE   )r8   rC   r7   r   s    r   Úproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsY   s#   € à×&Ò&Ø× Ñ Ô"à×)Ñ)Ð)r   N)r9   Ústrr!   ÚNone)r!   rI   )r!   z	list[str])r!   zdict[str, list[str]])	r&   r'   r(   Ú__doc__r:   rC   r)   r   rG   r*   r   r   r2   r2   2   s7   „ Ù,ó(ó'ð. ò%ó ð%ð ò*ó ñ*r   r2   c                  óZ   — e Zd ZU dZi Zded<   	 	 	 	 	 	 	 	 d	d„Zed
d„«       Zdd„Z	dd„Z
y)Ú_FlatDirectorySourcezû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                óÌ   — || _         t        |«      | _        || j                  v r| j                  |   | _        y t        |¬«      | _        | j                  | j                  |<   y )N)r9   )Ú_candidates_from_pager	   Ú_project_namerM   Ú_path_to_urlsr2   )r   Úcandidates_from_pager9   Úproject_names       r   r:   z_FlatDirectorySource.__init__l   s_   € ð &:ˆÔ"Ü.¨|Ó<ˆÔð �4×&Ñ&Ñ&Ø!%×!4Ñ!4°TÑ!:ˆDÕä!5¸4Ô!@ˆDÔØ(,×(:Ñ(:ˆD×Ñ Ò%r   c                 ó   — y rE   r*   r   s    r   r   z_FlatDirectorySource.link|   s   € àr   c              #  óŠ   K  — | j                   j                  D ]$  }| j                  t        |«      «      E d {  –—†  Œ& y 7 Œ­wrE   )rQ   r   rO   r   ©r   rA   s     r   r   z$_FlatDirectorySource.page_candidates€   s7   è ø€ Ø×%Ñ%×5Ô5ˆCØ×1Ñ1´$°s³)Ó<×<Ñ<ñ 6Ø<ús   ‚7A¹AºAc              #  óv   K  — | j                   j                  | j                     D ]  }t        |«      –— Œ y ­wrE   )rQ   rG   rP   r   rV   s     r   r   z_FlatDirectorySource.file_links„   s1   è ø€ Ø×%Ñ%×:Ñ:¸4×;MÑ;MÔNˆCÜ�s“)‹Oñ Oùs   ‚79N)rR   ÚCandidatesFromPager9   rH   rS   rH   r!   rI   r    r"   r$   )r&   r'   r(   rJ   rM   Ú__annotations__r:   r)   r   r   r   r*   r   r   rL   rL   a   s]   … ñð 79€NÐ3Ó8ð;à0ð;ð ð;ð ð	;ð
 
ó;ð  òó ðó=ôr   rL   c                  óF   — e Zd ZdZ	 	 	 	 	 	 dd„Zedd„«       Zd	d„Zd
d„Zy)Ú_LocalFileSourceaC  ``--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                ó    — || _         || _        y rE   ©rO   Ú_link©r   rR   r   s      r   r:   z_LocalFileSource.__init__“   ó   € ð
 &:ˆÔ"Øˆ�
r   c                ó   — | j                   S rE   ©r^   r   s    r   r   z_LocalFileSource.link›   ó   € à�z‰zÐr   c              #  ó–   K  — t        | j                  j                  «      sy | j                  | j                  «      E d {  –—†  y 7 Œ­wrE   )r0   r^   rA   rO   r   s    r   r   z _LocalFileSource.page_candidatesŸ   s1   è ø€ Ü˜TŸZ™ZŸ^™^Ô,ØØ×-Ñ-¨d¯j©jÓ9×9Ò9ús   ‚?A	ÁAÁA	c              #  óh   K  — t        | j                  j                  «      ry | j                  –— y ­wrE   )r0   r^   rA   r   s    r   r   z_LocalFileSource.file_links¤   s#   è ø€ Ü˜Ÿ™Ÿ™Ô(ØØ�j‰jÓùs   ‚02N©rR   rX   r   r   r!   rI   r    r"   r$   ©	r&   r'   r(   rJ   r:   r)   r   r   r   r*   r   r   r[   r[   ‰   sF   „ ñðà0ðð ðð 
ó	ð òó ðó:ô
r   r[   c                  óJ   — e Zd ZdZ	 	 	 	 	 	 	 	 dd„Zedd„«       Zd	d„Zd
d„Zy)Ú_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                ó.   — || _         || _        || _        y rE   )rO   Ú_page_validatorr^   )r   rR   Úpage_validatorr   s       r   r:   z_RemoteFileSource.__init__³   s   € ð &:ˆÔ"Ø-ˆÔØˆ�
r   c                ó   — | j                   S rE   rb   r   s    r   r   z_RemoteFileSource.link½   rc   r   c              #  óŽ   K  — | j                  | j                  «      sy | j                  | j                  «      E d {  –—†  y 7 Œ­wrE   )rk   r^   rO   r   s    r   r   z!_RemoteFileSource.page_candidatesÁ   s3   è ø€ Ø×#Ñ# D§J¡JÔ/ØØ×-Ñ-¨d¯j©jÓ9×9Ò9ús   ‚;A½A¾Ac              #  ó(   K  — | j                   –— y ­wrE   rb   r   s    r   r   z_RemoteFileSource.file_linksÆ   s   è ø€ Ø�j‰jÓùs   ‚N)rR   rX   rl   ÚPageValidatorr   r   r!   rI   r    r"   r$   rg   r*   r   r   ri   ri   ª   sP   „ ñðà0ðð &ðð ð	ð
 
óð òó ðó:ô
r   ri   c                  óF   — e Zd ZdZ	 	 	 	 	 	 dd„Zedd„«       Zd	d„Zd
d„Zy)Ú_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                ó    — || _         || _        y rE   r]   r_   s      r   r:   z_IndexDirectorySource.__init__Ñ   r`   r   c                ó   — | j                   S rE   rb   r   s    r   r   z_IndexDirectorySource.linkÙ   rc   r   c              #  óV   K  — | j                  | j                  «      E d {  –—†  y 7 Œ­wrE   r]   r   s    r   r   z%_IndexDirectorySource.page_candidatesÝ   s   è ø€ Ø×-Ñ-¨d¯j©jÓ9×9Ò9ús   ‚)¡'¢)c                 ó   — y)Nr*   r*   r   s    r   r   z _IndexDirectorySource.file_linksà   s   € Ør   Nrf   r    r"   r$   rg   r*   r   r   rr   rr   Ê   sF   „ ñðà0ðð ðð 
ó	ð òó ðó:ôr   rr   c               óx  — d }d }t         j                  j                  | «      rt        | «      }| }n,| j	                  d«      r| }t        | «      }nt        | «      r| }|€d}t        j                  || «       y|€t        ||t        ||¬«      ¬«      }	||	fS t         j                  j                  |«      r0|rt        |||¬«      }	||	fS t        |t        ||¬«      ¬«      }	||	fS t         j                  j                  |«      rt        |t        ||¬«      ¬«      }	||	fS t        j                  d| «       |d fS )	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)Úcache_link_parsing)rR   rl   r   )rR   r9   rS   )rR   r   z?Location '%s' is ignored: it is neither a file nor a directory.)r<   r9   Úexistsr   Ú
startswithr   r   ÚloggerÚwarningri   r   ÚisdirrL   rr   Úisfiler[   )
ÚlocationrR   rl   Ú
expand_dirrx   rS   r9   rA   ÚmsgÚsources
             r   Úbuild_sourcerƒ   ä   sP  € ð €DØ€CÜ	‡w�w‡~�~�hÔÜ˜(Ó#ˆØ‰Ø	×	Ñ	˜WÔ	%ØˆÜ˜8Ó$‰Ü	�Ô	Øˆà
€{ðKð 	ô 	�‰�s˜HÔ%Øà€|Ü.Ø!5Ø)Ü�cÐ.@ÔAô
ˆð
 �Vˆ}Ðä	‡w�w‡}�}�TÔÙÜ)Ø%9ØØ)ôˆFð �Vˆ}Ðô	 +Ø%9Ü˜#Ð2DÔEôˆFð �Vˆ}ÐÜ	�‰�‰˜Ô	Ü!Ø!5Ü�cÐ.@ÔAô
ˆð �Vˆ}ÐÜ
‡N�NØIØôð �ˆ;Ðr   )r/   rH   r!   Úbool)r   rH   rR   rX   rl   rp   r€   r„   rx   r„   rS   rH   r!   z$tuple[str | None, LinkSource | None])*Ú
__future__r   Úloggingr-   r<   Úcollectionsr   Úcollections.abcr   Útypingr   Ú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%   rX   r„   rp   r   r0   r2   rL   r[   ri   rr   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   