HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/site-packages/pip/_internal/commands/__pycache__/index.cpython-38.pyc
U

�{�e��@s�ddlZddlmZddlmZmZmZmZmZddl	m
Z
mZddlm
Z
ddlmZddlmZmZddlmZdd	lmZmZmZdd
lmZddlmZddlmZdd
lm Z ddl!m"Z"ddl#m$Z$e�%e&�Z'Gdd�de�Z(dS)�N)�Values)�Any�Iterable�List�Optional�Union)�
LegacyVersion�Version)�
cmdoptions)�IndexGroupCommand)�ERROR�SUCCESS)�print_dist_installation_info)�CommandError�DistributionNotFound�PipError)�
LinkCollector)�
PackageFinder)�SelectionPreferences)�TargetPython)�
PipSession)�write_outputc@sreZdZdZdZdZdd�dd�Zeee	e
d�d	d
�Zdeee
ee
eed�dd
�Zeeedd�dd�ZdS)�IndexCommandz=
    Inspect information available from package indexes.
    Tz&
        %prog versions <package>
    N)�returncCs~t�|j�|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�	no_binary�only_binary�make_option_group�index_group�parser�insert_option_group)�self�
index_opts�r'�@/tmp/pip-unpacked-wheel-_0scjqea/pip/_internal/commands/index.py�add_options s�zIndexCommand.add_options)�options�argsrc
Cs�d|ji}t�d�|r$|d|kr>t�dd�t|���tS|d}z||||dd��Wn:tk
r�}zt�|jd�tWY�Sd}~XYnXt	S)N�versionsztpip index is currently an experimental command. It may be removed/changed in a future release without prior warning.rzNeed an action (%s) to perform.�, �)
�get_available_package_versions�logger�warning�error�join�sortedrrr+r
)r%r*r+�handlers�action�er'r'r(�run0s&���zIndexCommand.run)r*�session�
target_pythonrrcCs.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*r9r:rr=r>r'r'r(�_build_package_finderNs
��z"IndexCommand._build_package_finderc
	Cs�t|�dkrtd��t�|�}|d}|�|��z}|j||||jd�}dd�|�|�D�}|jsndd�|D�}t	|�}|s�t
d�|���d	d
�t|dd�D�}|d}	W5QRXt
d
�||	��t
d�d�|���t||	�dS)Nr.z(You need to specify exactly one argumentr)r*r9r:rcss|]}|jVqdS�N)�version)�.0�	candidater'r'r(�	<genexpr>vsz>IndexCommand.get_available_package_versions.<locals>.<genexpr>css|]}|js|VqdSrA)�
is_prerelease)rCrBr'r'r(rE|sz%No matching distribution found for {}cSsg|]}t|��qSr')�str)rC�verr'r'r(�
<listcomp>�sz?IndexCommand.get_available_package_versions.<locals>.<listcomp>T)�reversez{} ({})zAvailable versions: {}r-)�lenrr
�make_target_python�_build_sessionr@r�find_all_candidatesr�setr�formatr4rr3r)
r%r*r+r:�queryr9�finderr,Zformatted_versionsZlatestr'r'r(r/gs8
����z+IndexCommand.get_available_package_versions)NN)�__name__�
__module__�__qualname__�__doc__�ignore_require_venv�usager)rrrG�intr8rrr�boolrr@rr/r'r'r'r(rs"��r))�logging�optparser�typingrrrrr�pip._vendor.packaging.versionrr	Zpip._internal.clir
�pip._internal.cli.req_commandr�pip._internal.cli.status_codesrr
Zpip._internal.commands.searchr�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�	getLoggerrSr0rr'r'r'r(�<module>s