HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_internal/commands/__pycache__/index.cpython-310.pyc
o

��h{�@sddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlmZddl
mZddlmZdd	lmZmZdd
lmZmZddlmZmZmZddlmZdd
lmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&e�'e(�Z)Gdd�de�Z*dS)�)�annotationsN)�Iterable)�Values)�Any�Callable)�Version)�
cmdoptions)�IndexGroupCommand)�ERROR�SUCCESS)�get_installed_distribution�print_dist_installation_info)�CommandError�DistributionNotFound�PipError)�
LinkCollector)�
PackageFinder)�SelectionPreferences)�TargetPython)�
PipSession)�write_outputc@sPeZdZdZdZdZddd�Zd d	d
�Zd!dd�Z		d"d#dd�Z	d$dd�Z
dS)%�IndexCommandz=
    Inspect information available from package indexes.
    Tz&
        %prog versions <package>
    �return�NonecCs�t�|j�|j�t���|j�t���|j�t���|j�t���|j�t���t�	tj
|j�}|j�d|�|j�d|j�dS)Nr)
r�add_target_python_options�cmd_opts�
add_option�ignore_requires_python�pre�json�	no_binary�only_binary�make_option_group�index_group�parser�insert_option_group)�self�
index_opts�r(�G/usr/local/lib/python3.10/dist-packages/pip/_internal/commands/index.py�add_options's�zIndexCommand.add_options�.dict[str, Callable[[Values, list[str]], None]]cCs
d|jiS)N�versions)�get_available_package_versions)r&r(r(r)�handler_map8s�zIndexCommand.handler_map�optionsr�args�	list[str]�intc
Cs�|��}|r|d|vrt�dd�t|���tS|d}z||||dd��WtStyG}zt�|jd�tWYd}~Sd}~ww)NrzNeed an action (%s) to perform.�, �)	r.�logger�error�join�sortedr
rr0r)r&r/r0r.�action�er(r(r)�run=s ����zIndexCommand.runN�sessionr�
target_python�TargetPython | Noner�bool | NonercCs.tj||d�}td|j|d�}tj|||d�S)zK
        Create a package finder appropriate to the index command.
        )r/F)�allow_yanked�allow_all_prereleasesr)�link_collector�selection_prefsr=)r�createrrr)r&r/r<r=rrBrCr(r(r)�_build_package_finderSs
��z"IndexCommand._build_package_finder�	list[Any]cCs<t|�dkr
td��t�|�}|d}|�|��B}|j||||jd�}dd�|�|�D�}|js7dd�|D�}t	|�}|sDt
d|����d	d
�t|dd�D�}|d}	Wd�n1s]wYt|�}
|j
r�|||	d
�}|
durzt|
j�|d<tt
�|��dSt|�d|	�d��td�d�|���t|	|
�dS)Nr4z(You need to specify exactly one argumentr)r/r<r=rcss�|]}|jVqdS�N)�version)�.0�	candidater(r(r)�	<genexpr>{s�
�z>IndexCommand.get_available_package_versions.<locals>.<genexpr>css�|]}|js|VqdSrG)�
is_prerelease)rIrHr(r(r)rK�s��
�z#No matching distribution found for cSsg|]}t|��qSr()�str)rI�verr(r(r)�
<listcomp>�sz?IndexCommand.get_available_package_versions.<locals>.<listcomp>T)�reverse)�namer,�latest�installed_versionz (�)zAvailable versions: {}r3)�lenrr�make_target_python�_build_sessionrEr�find_all_candidatesr�setrr8rrrMrHr�dumps�formatr7r
)r&r/r0r=�queryr<�finderr,�formatted_versionsrR�dist�structured_outputr(r(r)r-lsL
����
��z+IndexCommand.get_available_package_versions)rr)rr+)r/rr0r1rr2)NN)
r/rr<rr=r>rr?rr)r/rr0rFrr)�__name__�
__module__�__qualname__�__doc__�ignore_require_venv�usager*r.r;rEr-r(r(r(r)rs


�r)+�
__future__rr�logging�collections.abcr�optparser�typingrr�pip._vendor.packaging.versionr�pip._internal.clir�pip._internal.cli.req_commandr	�pip._internal.cli.status_codesr
r�pip._internal.commands.searchrr
�pip._internal.exceptionsrrr�pip._internal.index.collectorr�"pip._internal.index.package_finderr�$pip._internal.models.selection_prefsr�"pip._internal.models.target_pythonr�pip._internal.network.sessionr�pip._internal.utils.miscr�	getLoggerrar5rr(r(r(r)�<module>s(