§
    è ph¸!  ã                   ó  — 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 j        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+dS )é    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                   óN   — e Zd Zedee         fd„¦   «         Zdefd„Zde	fd„Z
dS )Ú
LinkSourceÚreturnc                 ó   — t          ¦   «         ‚)z,Returns the underlying link, if there's one.©ÚNotImplementedError©Úselfs    úhC:\Users\Daniel\PycharmProjects\Portfolio_Website\.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)Ú__name__Ú
__module__Ú__qualname__Úpropertyr   r   r   ÚFoundCandidatesr    Ú
FoundLinksr#   © r   r   r   r      ss   € € € € € Øð$�h˜t”nð $ð $ð $ñ „Xð$ð$ ð $ð $ð $ð $ð$˜Jð $ð $ð $ð $ð $ð $r   r   Úfile_urlr   c                 óB   — t          j        | d¬¦  «        d         dk    S )NF)Ústrictr   z	text/html)Ú	mimetypesÚ
guess_type)r+   s    r   Ú_is_html_filer0   +   s"   € ÝÔ °Ð7Ñ7Ô7¸Ô:¸kÒIÐIr   c                   óŠ   — 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dS )
Ú_FlatDirectoryToUrlsz"Scans directory and caches resultsÚpathr   Nc                 ób   — || _         g | _        t          t          ¦  «        | _        d| _        d S )NF)Ú_pathÚ_page_candidatesr   ÚlistÚ_project_name_to_urlsÚ_scanned_directory)r   r3   s     r   Ú__init__z_FlatDirectoryToUrls.__init__2   s/   € ØˆŒ
Ø+-ˆÔÝ;FÅtÑ;LÔ;LˆÔ"Ø"'ˆÔÐÐr   c                 óº  — t          j        | j        ¦  «        D ]¹}t          |j        ¦  «        }t          |¦  «        r| j                             |¦  «         Œ@	 t          |j	        ¦  «        d         }n=# t          $ r0 	 t          |j	        ¦  «        d         }n# t          $ r Y Y Œ�w xY wY nw xY w| j        |                              |¦  «         Œºd| _        dS )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 ¤
Ñ+Ô+ð 	Eð 	EˆEÝ˜eœjÑ)Ô)ˆCÝ˜SÑ!Ô!ð ØÔ%×,Ò,¨SÑ1Ô1Ð1ØðÝ#7¸¼
Ñ#CÔ#CÀAÔ#FÐ Ð øÝ'ð ð ð ðÝ';¸E¼JÑ'GÔ'GÈÔ'JÐ$Ð$øÝ+ð ð ð Ø�H�Hðøøøð %Ð$ðøøøð Ô&Ð'7Ô8×?Ò?ÀÑDÔDÐDÐDØ"&ˆÔÐÐs6   ÁA6Á6
B0ÂBÂB0Â
B*Â&B0Â)B*Â*B0Â/B0c                 óF   — | j         s|                      ¦   «          | j        S ©N)r9   rC   r6   r   s    r   r    z$_FlatDirectoryToUrls.page_candidatesO   s(   € àÔ&ð 	#Ø× Ò Ñ"Ô"Ð"àÔ$Ð$r   c                 óF   — | j         s|                      ¦   «          | 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   /   s¯   € € € € € Ø,Ð,ð(˜Sð ( Tð (ð (ð (ð (ð'ð 'ð 'ð 'ð. ð%  c¤ð %ð %ð %ñ „Xð%ð ð* d¨3°°S´	¨>Ô&:ð *ð *ð *ñ „Xð*ð *ð *r   r2   c                   óŠ   — 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dS )Ú_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        |         | _        d S t          |¬¦  «        | _        | j        | j        |<   d S )N)r3   )Ú_candidates_from_pager   Ú_project_namerL   Ú_path_to_urlsr2   )r   rM   r3   rN   s       r   r:   z_FlatDirectorySource.__init__i   sm   € ð &:ˆÔ"Ý.¨|Ñ<Ô<ˆÔð �4Ô&Ð&ð 	;Ø!%Ô!4°TÔ!:ˆDÔÐÐå!5¸4Ð!@Ñ!@Ô!@ˆDÔØ(,Ô(:ˆDÔ Ñ%Ð%Ð%r   c                 ó   — d S rE   r*   r   s    r   r   z_FlatDirectorySource.linky   s   € àˆtr   c              #   óx   K  — | j         j        D ]*}|                      t          |¦  «        ¦  «        E d {V —† Œ+d S rE   )rR   r    rP   r   ©r   rA   s     r   r    z$_FlatDirectorySource.page_candidates}   sT   è è € ØÔ%Ô5ð 	=ð 	=ˆCØ×1Ò1µ$°s±)´)Ñ<Ô<Ð<Ð<Ð<Ð<Ð<Ð<Ð<Ð<ð	=ð 	=r   c              #   ó`   K  — | j         j        | j                 D ]}t          |¦  «        V — Œd S rE   )rR   rG   rQ   r   rU   s     r   r#   z_FlatDirectorySource.file_links�   s>   è è € ØÔ%Ô:¸4Ô;MÔNð 	ð 	ˆCÝ�s‘)”)ˆOˆOˆOˆOð	ð 	r   )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Ð8Ñ8ð;à0ð;ð ð;ð ð	;ð
 
ð;ð ;ð ;ð ;ð  ð�h˜t”nð ð ð ñ „Xðð= ð =ð =ð =ð =ð˜Jð ð ð ð ð ð r   rK   c                   óf   — 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dS )
Ú_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                 ó"   — || _         || _        d S 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Ðr   c              #   ó€   K  — t          | j        j        ¦  «        sd S |                      | j        ¦  «        E d {V —† d S rE   )r0   r]   rA   rP   r   s    r   r    z _LocalFileSource.page_candidatesœ   sM   è è € Ý˜TœZœ^Ñ,Ô,ð 	ØˆFØ×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   c              #   óR   K  — t          | j        j        ¦  «        rd S | j        V — d S rE   )r0   r]   rA   r   s    r   r#   z_LocalFileSource.file_links¡   s3   è è € Ý˜œœÑ(Ô(ð 	ØˆFØŒjÐÐÐÐÐr   ©r$   r%   r&   rH   rX   r   r:   r'   r   r   r(   r    r)   r#   r*   r   r   rZ   rZ   †   s¯   € € € € € ðð ðà0ðð ðð 
ð	ð ð ð ð ð�h˜t”nð ð ð ñ „Xðð: ð :ð :ð :ð :ð
˜Jð ð ð ð ð ð r   rZ   c                   ój   — 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dS )Ú_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                 ó0   — || _         || _        || _        d S 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        ¦  «        sd S |                      | j        ¦  «        E d {V —† d S rE   )rj   r]   rP   r   s    r   r    z!_RemoteFileSource.page_candidates¾   sQ   è è € Ø×#Ò# D¤JÑ/Ô/ð 	ØˆFØ×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   c              #   ó   K  — | j         V — d S rE   ra   r   s    r   r#   z_RemoteFileSource.file_linksÃ   s   è è € ØŒjÐÐÐÐÐr   )r$   r%   r&   rH   rX   ÚPageValidatorr   r:   r'   r   r   r(   r    r)   r#   r*   r   r   rg   rg   §   s¹   € € € € € ðð ðà0ðð &ðð ð	ð
 
ðð ð ð ð ð�h˜t”nð ð ð ñ „Xðð: ð :ð :ð :ð :ð
˜Jð ð ð ð ð ð r   rg   c                   óf   — 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dS )
Ú_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                 ó"   — || _         || _        d S 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              #   óJ   K  — |                       | j        ¦  «        E d {V —† d S rE   r\   r   s    r   r    z%_IndexDirectorySource.page_candidatesÚ   s4   è è € Ø×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   c                 ó   — dS )Nr*   r*   r   s    r   r#   z _IndexDirectorySource.file_linksÝ   s   € Øˆrr   re   r*   r   r   rp   rp   Ç   s¯   € € € € € ðð ðà0ðð ðð 
ð	ð ð ð ð ð�h˜t”nð ð ð ñ „Xðð: ð :ð :ð :ð :ð˜Jð ð ð ð ð ð r   rp   ÚlocationrM   rh   Ú
expand_dirÚcache_link_parsingrN   c                óà  — d }d }t           j                             | ¦  «        rt          | ¦  «        }| }n8|                      d¦  «        r| }t          | ¦  «        }nt          | ¦  «        r| }|€d}t                               || ¦  «         dS |€%t          ||t          ||¬¦  «        ¬¦  «        }	||	fS t           j                             |¦  «        r9|rt          |||¬¦  «        }	n t          |t          ||¬¦  «        ¬¦  «        }	||	fS t           j                             |¦  «        r$t          |t          ||¬¦  «        ¬¦  «        }	||	fS t                               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�   á   sÉ  € ð €DØ€CÝ	„w‡~‚~�hÑÔð Ý˜(Ñ#Ô#ˆØˆˆØ	×	Ò	˜WÑ	%Ô	%ð ØˆÝ˜8Ñ$Ô$ˆˆÝ	�Ñ	Ô	ð Øˆà
ð ðKð 	õ 	�Š�s˜HÑ%Ô%Ð%Øˆ|àð Ý.Ø!5Ø)Ý�cÐ.@ÐAÑAÔAð
ñ 
ô 
ˆð
 �Vˆ}Ðå	„w‡}‚}�TÑÔð Øð 
	Ý)Ø%9ØØ)ðñ ô ˆFˆFõ +Ø%9Ý˜#Ð2DÐEÑEÔEðñ ô ˆFð �Vˆ}ÐÝ	Œ�Š˜Ñ	Ô	ð Ý!Ø!5Ý�cÐ.@ÐAÑAÔ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Œ      sã  ðØ €€€Ø Ð Ð Ð Ø 	€	€	€	Ø #Ð #Ð #Ð #Ð #Ð #Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ BÐ Bðð ð ð ð ð ð ð ð ð ð ð ð ð ð AÐ @Ð @Ð @Ð @Ð @Ø *Ð *Ð *Ð *Ð *Ð *Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ø $Ð $Ð $Ð $Ð $Ð $à	ˆÔ	˜8Ñ	$Ô	$€àÐ0Ô1€Ø�dŒ^€
Ø˜t˜f hÐ/DÔ&EÐEÔFÐ Ø˜$˜ ˜Ô&€ð$ð $ð $ð $ð $ñ $ô $ð $ðJ˜Cð J Dð Jð Jð Jð Jð,*ð ,*ð ,*ð ,*ð ,*ñ ,*ô ,*ð ,*ð^%ð %ð %ð %ð %˜:ñ %ô %ð %ðPð ð ð ð �zñ ô ð ðBð ð ð ð ˜
ñ ô ð ð@ð ð ð ð ˜Jñ ô ð ð4;Øð;ð -ð;ð "ð	;ð
 ð;ð ð;ð ð;ð ˆ8�CŒ=˜( :Ô.Ð.Ô/ð;ð ;ð ;ð ;ð ;ð ;r   