Ë
    ��h¸!  ã                   óÀ  — d dl Z d dlZd dlZd dlmZ d dlmZmZmZm	Z	m
Z
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 j6                  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e$de!f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e$de de"de!de!de$dee
e$   e
e#   f   fd„Z+y)é    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                   ó@   — e Zd Zedee   fd„«       Zdefd„Zde	fd„Z
y)Ú
LinkSourceÚreturnc                 ó   — t        «       ‚)z,Returns the underlying link, if there's one.©ÚNotImplementedError©Úselfs    úY/var/www/skyplay_api_hub/venv/lib/python3.12/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)Ú__name__Ú
__module__Ú__qualname__Úpropertyr   r   r   ÚFoundCandidatesr    Ú
FoundLinksr#   © r   r   r   r      s7   „ Øð$�h˜t‘nò $ó ð$ð$ ó $ð$˜Jô $r   r   Úfile_urlr   c                 ó<   — t        j                  | d¬«      d   dk(  S )NF)Ústrictr   z	text/html)Ú	mimetypesÚ
guess_type)r+   s    r   Ú_is_html_filer0   +   s   € Ü×Ñ °Ô7¸Ñ:¸kÑIÐIr   c                   ój   — e Zd ZdZdeddfd„Zd	d„Zedee   fd„«       Z	ede
eee   f   fd„«       Zy)
Ú_FlatDirectoryToUrlsz"Scans directory and caches resultsÚpathr   Nc                 óV   — || _         g | _        t        t        «      | _        d| _        y )NF)Ú_pathÚ_page_candidatesr   ÚlistÚ_project_name_to_urlsÚ_scanned_directory)r   r3   s     r   Ú__init__z_FlatDirectoryToUrls.__init__2   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Úscandirr5   r   r3   r0   r6   Úappendr   Únamer   r   r
   r8   r9   )r   ÚentryÚurlÚproject_filenames       r   Ú_scan_directoryz$_FlatDirectoryToUrls._scan_directory8   sÏ   € ô —Z‘Z §
¡
Ó+ò 	EˆEÜ˜eŸj™jÓ)ˆCÜ˜SÔ!Ø×%Ñ%×,Ñ,¨SÔ1ØðÜ#7¸¿
¹
Ó#CÀAÑ#FÐ ð ×&Ñ&Ð'7Ñ8×?Ñ?ÀÕDð!	Eð" #'ˆÕøô (ò ðÜ';¸E¿J¹JÓ'GÈÑ'JÑ$øÜ+ò Úðúñ %ðús6   Á B Â 	CÂ*CÃCÃ	CÃCÃCÃCÃCc                 óR   — | j                   s| j                  «        | j                  S ©N)r9   rC   r6   r   s    r   r    z$_FlatDirectoryToUrls.page_candidatesO   s#   € à×&Ò&Ø× Ñ Ô"à×$Ñ$Ð$r   c                 óR   — | j                   s| j                  «        | j                  S rE   )r9   rC   r8   r   s    r   Úproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsV   s#   € à×&Ò&Ø× Ñ Ô"à×)Ñ)Ð)r   )r   N)r$   r%   r&   Ú__doc__Ústrr:   rC   r'   r   r    r   rG   r*   r   r   r2   r2   /   sd   „ Ù,ð(˜Sð ( Tó (ó'ð. ð%  c¡ò %ó ð%ð ð* d¨3°°S±	¨>Ñ&:ò *ó ñ*r   r2   c                   óv   — e Zd ZU dZi Zeeef   ed<   de	dededdfd„Z
edee   fd	„«       Zdefd
„Zdef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.
    Ú_paths_to_urlsÚcandidates_from_pager3   Úproject_namer   Nc                 óÌ   — || _         t        |«      | _        || j                  v r| j                  |   | _        y t        |¬«      | _        | j                  | j                  |<   y )N)r3   )Ú_candidates_from_pager   Ú_project_namerL   Ú_path_to_urlsr2   )r   rM   r3   rN   s       r   r:   z_FlatDirectorySource.__init__i   s_   € ð &:ˆÔ"Ü.¨|Ó<ˆÔð �4×&Ñ&Ñ&Ø!%×!4Ñ!4°TÑ!:ˆDÕä!5¸4Ô!@ˆDÔØ(,×(:Ñ(:ˆD×Ñ Ò%r   c                  ó   — y rE   r*   r   s    r   r   z_FlatDirectorySource.linky   s   € àr   c              #   óŠ   K  — | j                   j                  D ]$  }| j                  t        |«      «      E d {  –—†  Œ& y 7 Œ­wrE   )rR   r    rP   r   ©r   rA   s     r   r    z$_FlatDirectorySource.page_candidates}   s<   è ø€ Ø×%Ñ%×5Ñ5ò 	=ˆCØ×1Ñ1´$°s³)Ó<×<Ñ<ñ	=Ø<ús   ‚7A¹AºAc              #   óv   K  — | j                   j                  | j                     D ]  }t        |«      –— Œ y ­wrE   )rR   rG   rQ   r   rU   s     r   r#   z_FlatDirectorySource.file_links�   s5   è ø€ Ø×%Ñ%×:Ñ:¸4×;MÑ;MÑNò 	ˆCÜ�s“)‹Oñ	ùs   ‚79)r$   r%   r&   rH   rL   r   rI   r2   Ú__annotations__ÚCandidatesFromPager:   r'   r   r   r   r(   r    r)   r#   r*   r   r   rK   rK   ^   s€   … ñð 79€N�D˜Ð2Ð2Ñ3Ó8ð;à0ð;ð ð;ð ð	;ð
 
ó;ð  ð�h˜t‘nò ó ðð= ó =ð˜Jô r   rK   c                   óX   — e Zd ZdZdededdfd„Zedee   fd„«       Z	de
fd„Zdef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.
    rM   r   r   Nc                 ó    — || _         || _        y rE   ©rP   Ú_link©r   rM   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   rP   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©r$   r%   r&   rH   rX   r   r:   r'   r   r   r(   r    r)   r#   r*   r   r   rZ   rZ   †   s_   „ ñðà0ðð ðð 
ó	ð ð�h˜t‘nò ó ðð: ó :ð
˜Jô r   rZ   c                   ó\   — e Zd ZdZdedededdfd„Zede	e   fd„«       Z
defd	„Zdef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.
    rM   Úpage_validatorr   r   Nc                 ó.   — || _         || _        || _        y rE   )rP   Ú_page_validatorr]   )r   rM   rh   r   s       r   r:   z_RemoteFileSource.__init__°   s   € ð &:ˆÔ"Ø-ˆÔØˆ�
r   c                 ó   — | j                   S rE   ra   r   s    r   r   z_RemoteFileSource.linkº   rb   r   c              #   óŽ   K  — | j                  | j                  «      sy | j                  | j                  «      E d {  –—†  y 7 Œ­wrE   )rj   r]   rP   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   ra   r   s    r   r#   z_RemoteFileSource.file_linksÃ   s   è ø€ Ø�j‰jÓùs   ‚)r$   r%   r&   rH   rX   ÚPageValidatorr   r:   r'   r   r   r(   r    r)   r#   r*   r   r   rg   rg   §   si   „ ñðà0ðð &ðð ð	ð
 
óð ð�h˜t‘nò ó ðð: ó :ð
˜Jô r   rg   c                   óX   — e Zd ZdZdededdfd„Zedee   fd„«       Z	de
fd„Zdef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.
    rM   r   r   Nc                 ó    — || _         || _        y rE   r\   r^   s      r   r:   z_IndexDirectorySource.__init__Î   r_   r   c                 ó   — | j                   S rE   ra   r   s    r   r   z_IndexDirectorySource.linkÖ   rb   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   re   r*   r   r   rp   rp   Ç   s_   „ ñðà0ðð ðð 
ó	ð ð�h˜t‘nò ó ðð: ó :ð˜Jô r   rp   ÚlocationrM   rh   Ú
expand_dirÚcache_link_parsingrN   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)rw   )rM   rh   r   )rM   r3   rN   )rM   r   z?Location '%s' is ignored: it is neither a file nor a directory.)r<   r3   Úexistsr   Ú
startswithr   r   ÚloggerÚwarningrg   r   ÚisdirrK   rp   ÚisfilerZ   )
ru   rM   rh   rv   rw   rN   r3   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   ),Úloggingr.   r<   Úcollectionsr   Útypingr   r   r   r   r   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)   rX   Úboolrn   r   rI   r0   r2   rK   rZ   rg   rp   r�   r*   r   r   ú<module>rŒ      s8  ðÛ Û Û 	Ý #ß B× B÷õ õ AÝ *ß =Ý $à	ˆ×	Ñ	˜8Ó	$€àÐ0Ñ1€Ø�d‰^€
Ø˜t˜f hÐ/DÑ&EÐEÑFÐ Ø˜$˜ ˜Ñ&€÷$ñ $ðJ˜Cð J Dó J÷,*ñ ,*ô^%˜:ô %ôP�zô ôB˜
ô ô@˜Jô ð4;Øð;ð -ð;ð "ð	;ð
 ð;ð ð;ð ð;ð ˆ8�C‰=˜( :Ñ.Ð.Ñ/ô;r   