a  ze@sddlZddlmZddlmZmZmZmZmZddl m Z m Z ddl m Z ddlmZddlmZmZddlmZdd lmZmZmZdd lmZdd lmZdd lmZdd lm Z ddl!m"Z"ddl#m$Z$e%e&Z'GdddeZ(dS)N)Values)AnyIterableListOptionalUnion) LegacyVersionVersion) cmdoptions)IndexGroupCommand)ERRORSUCCESS)print_dist_installation_info) CommandErrorDistributionNotFoundPipError) LinkCollector) PackageFinder)SelectionPreferences) TargetPython) PipSession) write_outputc@sneZdZdZdZddddZeeee ddd Z dee e e e eed d d Zeeeddd dZdS) IndexCommandz= Inspect information available from package indexes. z& %prog versions N)returncCs~t|j|jt|jt|jt|jtttj |j }|j d||j d|jdS)Nr) r add_target_python_optionscmd_opts add_optionignore_requires_pythonpre no_binary only_binarymake_option_group index_groupparserinsert_option_group)self index_optsr'^/opt/bitninja-python-dojo/embedded/lib/python3.9/site-packages/pip/_internal/commands/index.py add_optionss zIndexCommand.add_options)optionsargsrc Csd|ji}td|r$|d|vr>tddt|tS|d}z||||ddWn8ty}z t|jdtWYd}~Sd}~00t S)Nversionsztpip 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_versionsloggerwarningerrorjoinsortedr rr+r )r%r*r+handlersactioner'r'r(run/s$ zIndexCommand.run)r*session target_pythonrrcCs.tj||d}td|j|d}tj|||dS)zK Create a package finder appropriate to the index command. )r*F) allow_yankedallow_all_prereleasesr)link_collectorselection_prefsr:)rcreaterrr)r%r*r9r:rr=r>r'r'r(_build_package_finderMs z"IndexCommand._build_package_finderc Cst|dkrtdt|}|d}||}|j||||jd}dd||D}|jsndd|D}t |}|st d |d d t |d d D}|d} Wdn1s0Yt d || t d d|t|| dS)Nr.z(You need to specify exactly one argumentr)r*r9r:rcss|] }|jVqdSN)version).0 candidater'r'r( usz>IndexCommand.get_available_package_versions..css|]}|js|VqdSrA) is_prerelease)rCrBr'r'r(rE|sz%No matching distribution found for {}cSsg|] }t|qSr')str)rCverr'r'r( z?IndexCommand.get_available_package_versions..T)reversez{} ({})zAvailable versions: {}r-)lenrr make_target_python_build_sessionr@rfind_all_candidatesrsetrformatr4rr3r) r%r*r+r:queryr9finderr,Zformatted_versionsZlatestr'r'r(r/fs<    &z+IndexCommand.get_available_package_versions)NN)__name__ __module__ __qualname____doc__usager)rrrintr8rrrboolrr@r/r'r'r'r(rs" r))loggingoptparsertypingrrrrrZpip._vendor.packaging.versionrr Zpip._internal.clir pip._internal.cli.req_commandr pip._internal.cli.status_codesr r Zpip._internal.commands.searchrpip._internal.exceptionsrrrpip._internal.index.collectorr"pip._internal.index.package_finderr$pip._internal.models.selection_prefsr"pip._internal.models.target_pythonrpip._internal.network.sessionrpip._internal.utils.miscr getLoggerrTr0rr'r'r'r(s