HEX
Server: nginx/1.24.0
System: Linux webserver 6.8.0-85-generic #85-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 18 15:26:59 UTC 2025 x86_64
User: wpuser (1002)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/pip/_internal/index/__pycache__/sources.cpython-312.pyc
�

��h�!����ddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
mZddlm
Z
mZmZmZmZmZddlmZddlmZddlmZmZddlmZej8e�ZeeZeeZ eegeefZ!eege"fZ#Gd	�d
�Z$de%de"fd
�Z&Gd�d�Z'Gd�de$�Z(Gd�de$�Z)Gd�de$�Z*Gd�de$�Z+de%de!de#de"de"de%dee
e%e
e$ffd�Z,y)�N)�defaultdict)�Callable�Dict�Iterable�List�Optional�Tuple)�InvalidSdistFilename�InvalidVersion�InvalidWheelFilename�canonicalize_name�parse_sdist_filename�parse_wheel_filename)�InstallationCandidate)�Link)�path_to_url�url_to_path)�is_urlc�@�eZdZedeefd��Zdefd�Zde	fd�Z
y)�
LinkSource�returnc��t��)z,Returns the underlying link, if there's one.��NotImplementedError��selfs �=/usr/lib/python3/dist-packages/pip/_internal/index/sources.py�linkzLinkSource.links
��"�#�#�c��t��)z9Candidates found by parsing an archive listing HTML file.rrs r�page_candidateszLinkSource.page_candidates#���!�#�#rc��t��)z,Links found by specifying archives directly.rrs r�
file_linkszLinkSource.file_links'r"rN)�__name__�
__module__�__qualname__�propertyrrr�FoundCandidatesr!�
FoundLinksr$�rrrrs7��
�$�h�t�n�$��$�$��$�$�J�$rr�file_urlrc�<�tj|d��ddk(S)NF)�strictrz	text/html)�	mimetypes�
guess_type)r,s r�
_is_html_filer1,s�������7��:�k�I�Irc�j�eZdZdZdeddfd�Zd	d�Zedeefd��Z	ede
eeeffd��Zy)
�_FlatDirectoryToUrlsz"Scans directory and caches results�pathrNc�V�||_g|_tt�|_d|_y)NF)�_path�_page_candidatesr�list�_project_name_to_urls�_scanned_directory)rr4s  r�__init__z_FlatDirectoryToUrls.__init__3s&����
�+-���;F�t�;L��"�"'��rc���tj|j�D]u}t|j�}t|�r|jj|��?	t|j�d}|j|j|��wd|_y#ttf$r3	t|j�d}n#ttf$rYY��wxYwY�iwxYw)zrScans directory once and populates both page_candidates
        and project_name_to_urls at the same time
        rTN)�os�scandirr6rr4r1r7�appendr�namerrrr
r9r:)r�entry�url�project_filenames    r�_scan_directoryz$_FlatDirectoryToUrls._scan_directory9s����Z�Z��
�
�+�	E�E��e�j�j�)�C��S�!��%�%�,�,�S�1��
�#7��
�
�#C�A�#F� �
�&�&�'7�8�?�?��D�!	E�"#'����)�.�9�
��';�E�J�J�'G��'J�$��,�n�=�����%�
�s6� B � C"�0C	�C"�	C�C"�C�C"�!C"c�R�|js|j�|jS�N)r:rDr7rs rr!z$_FlatDirectoryToUrls.page_candidatesPs#���&�&�� � �"��$�$�$rc�R�|js|j�|jSrF)r:rDr9rs r�project_name_to_urlsz)_FlatDirectoryToUrls.project_name_to_urlsWs#���&�&�� � �"��)�)�)r)rN)r%r&r'�__doc__�strr;rDr(rr!rrHr+rrr3r30sd��,�(�S�(�T�(�'�.�%��c��%��%��*�d�3��S�	�>�&:�*��*rr3c�v�eZdZUdZiZeeefed<de	dededdfd�Z
edee
fd	��Zdefd
�Zdefd�Zy)�_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_pager4�project_namerNc���||_t|�|_||jvr|j||_yt|��|_|j|j|<y)N)r4)�_candidates_from_pager
�
_project_namerM�
_path_to_urlsr3)rrNr4rOs    rr;z_FlatDirectorySource.__init__js_��&:��"�.�|�<����4�&�&�&�!%�!4�!4�T�!:�D��!5�4�!@�D��(,�(:�(:�D����%rc��yrFr+rs rrz_FlatDirectorySource.linkzs��rc#�K�|jjD]$}|jt|��Ed{����&y7��wrF)rSr!rQr�rrBs  rr!z$_FlatDirectorySource.page_candidates~s<�����%�%�5�5�	=�C��1�1�$�s�)�<�<�<�	=�<�s�7A�A�Ac#�vK�|jj|jD]}t|����y�wrF)rSrHrRrrVs  rr$z_FlatDirectorySource.file_links�s5�����%�%�:�:�4�;M�;M�N�	�C��s�)�O�	�s�79)r%r&r'rIrMrrJr3�__annotations__�CandidatesFromPager;r(rrrr)r!r*r$r+rrrLrL_s����79�N�D��2�2�3�8�;�0�;��;��	;�

�;� ��h�t�n����=��=��J�rrLc�X�eZdZdZdededdfd�Zedeefd��Z	de
fd�Zdefd	�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.
    rNrrNc� �||_||_yrF�rQ�_link�rrNrs   rr;z_LocalFileSource.__init__����
&:��"���
rc��|jSrF�r^rs rrz_LocalFileSource.link�����z�z�rc#�K�t|jj�sy|j|j�Ed{���y7��wrF)r1r^rBrQrs rr!z _LocalFileSource.page_candidates�s1�����T�Z�Z�^�^�,���-�-�d�j�j�9�9�9�s�?A	�A�A	c#�hK�t|jj�ry|j��y�wrF)r1r^rBrs rr$z_LocalFileSource.file_links�s#����������(���j�j��s�02�r%r&r'rIrYrr;r(rrr)r!r*r$r+rrr[r[�s_����0����
�	���h�t�n����:��:�
�J�rr[c�\�eZdZdZdedededdfd�Zede	efd��Z
defd	�Zde
fd
�Zy)�_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.
    rN�page_validatorrrNc�.�||_||_||_yrF)rQ�_page_validatorr^)rrNrirs    rr;z_RemoteFileSource.__init__�s��&:��"�-�����
rc��|jSrFrbrs rrz_RemoteFileSource.link�rcrc#�K�|j|j�sy|j|j�Ed{���y7��wrF)rkr^rQrs rr!z!_RemoteFileSource.page_candidates�s3�����#�#�D�J�J�/���-�-�d�j�j�9�9�9�s�;A�A�Ac#�(K�|j��y�wrFrbrs rr$z_RemoteFileSource.file_links�s�����j�j��s�)r%r&r'rIrY�
PageValidatorrr;r(rrr)r!r*r$r+rrrhrh�si����0��&���	�

����h�t�n����:��:�
�J�rrhc�X�eZdZdZdededdfd�Zedeefd��Z	de
fd�Zdefd	�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.
    rNrrNc� �||_||_yrFr]r_s   rr;z_IndexDirectorySource.__init__�r`rc��|jSrFrbrs rrz_IndexDirectorySource.link�rcrc#�VK�|j|j�Ed{���y7��wrFr]rs rr!z%_IndexDirectorySource.page_candidates�s�����-�-�d�j�j�9�9�9�s�)�'�)c��y)Nr+r+rs rr$z _IndexDirectorySource.file_links�s��rrfr+rrrqrq�s_����0����
�	���h�t�n����:��:��J�rrq�locationrNri�
expand_dir�cache_link_parsingrOc�x�d}d}tjj|�rt|�}|}n,|j	d�r|}t|�}n
t
|�r|}|�d}tj||�y|�t||t||����}	||	fStjj|�r0|rt|||��}	||	fSt|t||����}	||	fStjj|�rt|t||����}	||	fStjd|�|dfS)	Nzfile:zVLocation '%s' is ignored: it is either a non-existing path or lacks a specific scheme.)NN)rx)rNrir)rNr4rO)rNrz?Location '%s' is ignored: it is neither a file nor a directory.)r=r4�existsr�
startswithrr�logger�warningrhr�isdirrLrq�isfiler[)
rvrNrirwrxrOr4rB�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�typingrrrrrr	�pip._vendor.packaging.utilsr
rrr
rr�pip._internal.models.candidater�pip._internal.models.linkr�pip._internal.utils.urlsrr�pip._internal.vcsr�	getLoggerr%r|r)r*rY�boolrorrJr1r3rLr[rhrqr�r+rr�<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