o ai@sddlZddlZddlZddlZddlmZddlmZddlm Z m Z m Z m Z ddl ZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd l m!Z!ddl"m#Z#ddl$m%Z%e&e'Z(de)de ddfddZ*d+ddZ+de e)e)ffddZ,de)defddZ-de)de e)fddZ.de e)e)fddfdd Z/d+d!d"Z0d#eddfd$d%Z1d&ede)fd'd(Z2Gd)d*d*eZ3dS),N)Values) ModuleType)AnyDictListOptional)where)parse)__file__) cmdoptions)Command)make_target_python)SUCCESS) Configuration)get_environment) indent_log)get_pip_versionnamevaluereturncCstd||dS)Nz%s: %s)loggerinfo)rrr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/commands/debug.py show_valuesrcCsHtdtjj}ttd|WddS1swYdS)Nzsys.implementation:r)rrsysimplementationrrr)implementation_namerrrshow_sys_implementations  "rcCsdtjtjtdd}t|}dd|D}Wdn1s$wYtdd|DS)N_vendorz vendor.txtcSs(g|]}d|vr|dddqS)== r)stripsplit.0linerrr -s"z)create_vendor_txt_map..css|] }|ddVqdS)r r"N)r$r%rrr 2sz(create_vendor_txt_map..)ospathjoindirname pip_locationopen readlinesdict)Zvendor_txt_pathflinesrrrcreate_vendor_txt_map%s r4 module_namecCs:|}|dkr d}td|ttddttj|S)N setuptools pkg_resourcesz pip._vendor.r)level)lower __import__globalslocalsgetattrpipr)r5rrrget_module_from_module_name5s  r?cCsHt|}t|dd}|s"ttj|jg}||}|r"t|j }|S)N __version__) r?r=rr*r+r-r get_distributionstrversion)r5modulerCenvdistrrrget_vendor_version_from_module@s   rGvendor_txt_versionscCsZ|D]&\}}d}t|}|sd}|}n t|t|kr"d|}td|||qdS)z{Log the actual version and print extra info if there is a conflict or if the actual version could not be imported. zM (Unable to locate actual module version, using vendor.txt specified version)z5 (CONFLICT: vendor.txt suggests version should be {})z%s==%s%sN)itemsrG parse_versionformatrr)rHr5Zexpected_versionZ extra_messageZactual_versionrrrshow_actual_vendor_versionsNsrMcCsDtdt}t t|WddS1swYdS)Nzvendored library versions:)rrr4rrM)rHrrrshow_vendor_versionscs  "rNoptionsc Csd}t|}|}|}d}|rd|d}dt||}t||jdkr9t||kr9d}|d|}nd}t*|D] }tt |qA|r`d j|d }t|WddSWddS1skwYdS) N rIz (target: )zCompatible tags: {}{}r"TFz?... [First {tag_limit} tags shown. Pass --verbose to show all.]) tag_limit) r get_tags format_givenrLlenrrverboserrB) rOrR target_pythontagsZformatted_targetsuffixmsgZ tags_limitedtagrrr show_tagsks0   "r\configcsrt}|D]\}}||ddq|sdSgdfdd|D}|s+dSd|vr4|dd|S) N.rz Not specified)installwheeldownloadcsg|]}|vr|qSrr)r&r8Zlevels_that_override_globalrrr(sz"ca_bundle_info..globalz, )setrJaddr$remover,)r]Zlevelskey_Zglobal_overriding_levelrrbrca_bundle_infos   ric@s<eZdZdZdZdZd ddZded ee de fd d Z dS) DebugCommandz$ Display debug information. z %prog TrNcCs,t|j|jd|j|jjdS)Nr)r add_target_python_optionscmd_optsparserinsert_option_groupr]load)selfrrr add_optionss zDebugCommand.add_optionsrOargscCstdtdttdtjtdtjtdttdttdt tdtj t td t |jjtd tjd td tjd td ttd tjjtt|tS)NzThis command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.z pip versionz sys.versionzsys.executablezsys.getdefaultencodingzsys.getfilesystemencodingzlocale.getpreferredencodingz sys.platformz'cert' config valueREQUESTS_CA_BUNDLECURL_CA_BUNDLEzpip._vendor.certifi.where()zpip._vendor.DEBUNDLED)rwarningrrrrC executablegetdefaultencodinggetfilesystemencodinglocalegetpreferredencodingplatformrrirmr]r*environgetrr>r DEBUNDLEDrNr\r)rprOrrrrrruns,     zDebugCommand.runrN) __name__ __module__ __qualname____doc__usageignore_require_venvrqrrrBintrrrrrrjs  rjr)4ryloggingr*roptparsertypesrtypingrrrr pip._vendorr>pip._vendor.certifirZpip._vendor.packaging.versionr rKr r.pip._internal.clir pip._internal.cli.base_commandr Zpip._internal.cli.cmdoptionsr pip._internal.cli.status_codesrpip._internal.configurationrpip._internal.metadatarpip._internal.utils.loggingrpip._internal.utils.miscr getLoggerrrrBrrr4r?rGrMrNr\rirjrrrrs<