§
    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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&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)dS )(é    )ÚannotationsN)Údefaultdict)ÚIterable)ÚCallable)ÚInvalidSdistFilenameÚInvalidWheelFilenameÚcanonicalize_nameÚparse_sdist_filenameÚparse_wheel_filename)ÚInstallationCandidate)ÚLink)Úpath_to_urlÚurl_to_path)Úis_urlc                  ó6   — e Zd Zed	d„¦   «         Zd
d„Zdd„ZdS )Ú
LinkSourceÚreturnúLink | Nonec                ó   — t          ¦   «         ‚)z,Returns the underlying link, if there's one.©ÚNotImplementedError©Úselfs    új/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/pip/_internal/index/sources.pyÚlinkzLinkSource.link    s   € õ "Ñ#Ô#Ð#ó    ÚFoundCandidatesc                ó   — t          ¦   «         ‚)z9Candidates found by parsing an archive listing HTML file.r   r   s    r   Úpage_candidateszLinkSource.page_candidates%   ó   € å!Ñ#Ô#Ð#r   Ú
FoundLinksc                ó   — t          ¦   «         ‚)z,Links found by specifying archives directly.r   r   s    r   Ú
file_linkszLinkSource.file_links)   r    r   N©r   r   ©r   r   ©r   r!   )Ú__name__Ú
__module__Ú__qualname__Úpropertyr   r   r#   © r   r   r   r      sZ   € € € € € Øð$ð $ð $ñ „Xð$ð$ð $ð $ð $ð$ð $ð $ð $ð $ð $r   r   Úfile_urlÚstrr   Úboolc                óB   — t          j        | d¬¦  «        d         dk    S )NF)Ústrictr   z	text/html)Ú	mimetypesÚ
guess_type)r,   s    r   Ú_is_html_filer3   .   s"   € ÝÔ °Ð7Ñ7Ô7¸Ô:¸kÒIÐIr   c                  óR   — e Zd ZdZdd„Zdd„Zedd	„¦   «         Zedd„¦   «         ZdS )Ú_FlatDirectoryToUrlsz"Scans directory and caches resultsÚpathr-   r   ÚNonec                ób   — || _         g | _        t          t          ¦  «        | _        d| _        d S )NF)Ú_pathÚ_page_candidatesr   ÚlistÚ_project_name_to_urlsÚ_scanned_directory)r   r6   s     r   Ú__init__z_FlatDirectoryToUrls.__init__5   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Úscandirr9   r   r6   r3   r:   Úappendr   Únamer   r
   r   r<   r=   )r   ÚentryÚurlÚproject_filenames       r   Ú_scan_directoryz$_FlatDirectoryToUrls._scan_directory;   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ú	list[str]c                óF   — | j         s|                      ¦   «          | j        S ©N)r=   rG   r:   r   s    r   r   z$_FlatDirectoryToUrls.page_candidatesR   s(   € àÔ&ð 	#Ø× Ò Ñ"Ô"Ð"àÔ$Ð$r   údict[str, list[str]]c                óF   — | j         s|                      ¦   «          | j        S rJ   )r=   rG   r<   r   s    r   Úproject_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsY   s(   € àÔ&ð 	#Ø× Ò Ñ"Ô"Ð"àÔ)Ð)r   N)r6   r-   r   r7   )r   r7   )r   rH   )r   rK   )	r'   r(   r)   Ú__doc__r>   rG   r*   r   rM   r+   r   r   r5   r5   2   s‚   € € € € € Ø,Ð,ð(ð (ð (ð (ð'ð 'ð 'ð 'ð. ð%ð %ð %ñ „Xð%ð ð*ð *ð *ñ „Xð*ð *ð *r   r5   c                  óR   — 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
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.
    zdict[str, _FlatDirectoryToUrls]Ú_paths_to_urlsÚcandidates_from_pageÚCandidatesFromPager6   r-   Úproject_namer   r7   c                ó¾   — || _         t          |¦  «        | _        || j        v r| j        |         | _        d S t          |¬¦  «        | _        | j        | j        |<   d S )N)r6   )Ú_candidates_from_pager	   Ú_project_namerQ   Ú_path_to_urlsr5   )r   rR   r6   rT   s       r   r>   z_FlatDirectorySource.__init__l   sk   € ð &:ˆÔ"Ý.¨|Ñ<Ô<ˆÔð �4Ô&Ð&Ð&Ø!%Ô!4°TÔ!:ˆDÔÐÐå!5¸4Ð!@Ñ!@Ô!@ˆDÔØ(,Ô(:ˆDÔ Ñ%Ð%Ð%r   r   c                ó   — d S rJ   r+   r   s    r   r   z_FlatDirectorySource.link|   s   € àˆtr   r   c              #  óx   K  — | j         j        D ]*}|                      t          |¦  «        ¦  «        E d {V —† Œ+d S rJ   )rX   r   rV   r   ©r   rE   s     r   r   z$_FlatDirectorySource.page_candidates€   sT   è è € ØÔ%Ô5ð 	=ð 	=ˆCØ×1Ò1µ$°s±)´)Ñ<Ô<Ð<Ð<Ð<Ð<Ð<Ð<Ð<Ð<ð	=ð 	=r   r!   c              #  ó`   K  — | j         j        | j                 D ]}t          |¦  «        V — Œd S rJ   )rX   rM   rW   r   r[   s     r   r#   z_FlatDirectorySource.file_links„   s>   è è € ØÔ%Ô:¸4Ô;MÔNð 	ð 	ˆCÝ�s‘)”)ˆOˆOˆOˆOð	ð 	r   N)rR   rS   r6   r-   rT   r-   r   r7   r$   r%   r&   )r'   r(   r)   rN   rQ   Ú__annotations__r>   r*   r   r   r#   r+   r   r   rP   rP   a   s�   € € € € € € ðð ð 79€NÐ8Ð8Ð8Ñ8ð;ð ;ð ;ð ;ð  ðð ð ñ „Xðð=ð =ð =ð =ðð ð ð ð ð r   rP   c                  óB   — e Zd ZdZdd„Zedd
„¦   «         Zdd„Zd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.
    rR   rS   r   r   r   r7   c                ó"   — || _         || _        d S rJ   ©rV   Ú_link©r   rR   r   s      r   r>   z_LocalFileSource.__init__“   ó   € ð
 &:ˆÔ"ØˆŒ
ˆ
ˆ
r   r   c                ó   — | j         S rJ   ©rb   r   s    r   r   z_LocalFileSource.link›   ó
   € àŒzÐr   r   c              #  ó€   K  — t          | j        j        ¦  «        sd S |                      | j        ¦  «        E d {V —† d S rJ   )r3   rb   rE   rV   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   r!   c              #  óR   K  — t          | j        j        ¦  «        rd S | j        V — d S rJ   )r3   rb   rE   r   s    r   r#   z_LocalFileSource.file_links¤   s3   è è € Ý˜œœÑ(Ô(ð 	ØˆFØŒjÐÐÐÐÐr   N©rR   rS   r   r   r   r7   r$   r%   r&   ©	r'   r(   r)   rN   r>   r*   r   r   r#   r+   r   r   r_   r_   ‰   sz   € € € € € ðð ðð ð ð ð ðð ð ñ „Xðð:ð :ð :ð :ð
ð ð ð ð ð r   r_   c                  óB   — e Zd ZdZdd
„Zedd„¦   «         Zdd„Zd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.
    rR   rS   Úpage_validatorÚPageValidatorr   r   r   r7   c                ó0   — || _         || _        || _        d S rJ   )rV   Ú_page_validatorrb   )r   rR   rn   r   s       r   r>   z_RemoteFileSource.__init__³   s   € ð &:ˆÔ"Ø-ˆÔØˆŒ
ˆ
ˆ
r   r   c                ó   — | j         S rJ   rf   r   s    r   r   z_RemoteFileSource.link½   rg   r   r   c              #  ó‚   K  — |                       | j        ¦  «        sd S |                      | j        ¦  «        E d {V —† d S rJ   )rq   rb   rV   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   r!   c              #  ó   K  — | j         V — d S rJ   rf   r   s    r   r#   z_RemoteFileSource.file_linksÆ   s   è è € ØŒjÐÐÐÐÐr   N)rR   rS   rn   ro   r   r   r   r7   r$   r%   r&   rk   r+   r   r   rm   rm   ª   sz   € € € € € ðð ðð ð ð ð ðð ð ñ „Xðð:ð :ð :ð :ð
ð ð ð ð ð r   rm   c                  óB   — e Zd ZdZdd„Zedd
„¦   «         Zdd„Zd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.
    rR   rS   r   r   r   r7   c                ó"   — || _         || _        d S rJ   ra   rc   s      r   r>   z_IndexDirectorySource.__init__Ñ   rd   r   r   c                ó   — | j         S rJ   rf   r   s    r   r   z_IndexDirectorySource.linkÙ   rg   r   r   c              #  óJ   K  — |                       | j        ¦  «        E d {V —† d S rJ   ra   r   s    r   r   z%_IndexDirectorySource.page_candidatesÝ   s4   è è € Ø×-Ò-¨d¬jÑ9Ô9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9Ð9r   r!   c                ó   — dS )Nr+   r+   r   s    r   r#   z _IndexDirectorySource.file_linksà   s   € Øˆrr   Nrj   r$   r%   r&   rk   r+   r   r   rv   rv   Ê   sz   € € € € € ðð ðð ð ð ð ðð ð ñ „Xðð:ð :ð :ð :ðð ð ð ð ð r   rv   ÚlocationrR   rS   rn   ro   Ú
expand_dirÚcache_link_parsingrT   ú$tuple[str | None, LinkSource | None]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)r}   )rR   rn   r   )rR   r6   rT   )rR   r   z?Location '%s' is ignored: it is neither a file nor a directory.)r@   r6   Úexistsr   Ú
startswithr   r   ÚloggerÚwarningrm   r   ÚisdirrP   rv   Úisfiler_   )
r{   rR   rn   r|   r}   rT   r6   rE   Ú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   )r,   r-   r   r.   )r{   r-   rR   rS   rn   ro   r|   r.   r}   r.   rT   r-   r   r~   )*Ú
__future__r   Úloggingr1   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!   rS   r.   ro   r   r3   r5   rP   r_   rm   rv   rˆ   r+   r   r   ú<module>r”      s‚  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø Ð Ð Ð Ø 	€	€	€	Ø #Ð #Ð #Ð #Ð #Ð #Ø $Ð $Ð $Ð $Ð $Ð $Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð AÐ @Ð @Ð @Ð @Ð @Ø *Ð *Ð *Ð *Ð *Ð *Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ø $Ð $Ð $Ð $Ð $Ð $à	ˆÔ	˜8Ñ	$Ô	$€àÐ0Ô1€Ø�dŒ^€
Ø˜t˜f hÐ/DÔ&EÐEÔFÐ Ø˜$˜ ˜Ô&€ð$ð $ð $ð $ð $ñ $ô $ð $ðJð Jð Jð Jð,*ð ,*ð ,*ð ,*ð ,*ñ ,*ô ,*ð ,*ð^%ð %ð %ð %ð %˜:ñ %ô %ð %ðPð ð ð ð �zñ ô ð ðBð ð ð ð ˜
ñ ô ð ð@ð ð ð ð ˜Jñ ô ð ð4;ð ;ð ;ð ;ð ;ð ;r   