o Ec@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)rrrO/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/commands/debug.py show_valuesrcCsHtdtjj}ttd|WddS1swYdS)Nzsys.implementation:r)rrsysimplementationrrr)Zimplementation_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)rr!N)r#r$rrr 2sz(create_vendor_txt_map..)ospathjoindirname pip_locationopen readlinesdict)Zvendor_txt_pathflinesrrrcreate_vendor_txt_map%s r3 module_namecCs:|}|dkr d}td|ttddttj|S)NZ setuptoolsZ pkg_resourcesz pip._vendor.r)level)lower __import__globalslocalsgetattrpipr)r4rrrget_module_from_module_name5s  r<cCsHt|}t|dd}|s"ttj|jg}||}|r"t|j }|S)N __version__) r<r:rr)r*r,r Zget_distributionstrversion)r4moduler?envZdistrrrget_vendor_version_from_module@s   rBvendor_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)itemsrB parse_versionformatrr)rCr4Zexpected_versionZ extra_messageZactual_versionrrrshow_actual_vendor_versionsNsrHcCsDtdt}t t|WddS1swYdS)Nzvendored library versions:)rrr3rrH)rCrrrshow_vendor_versionscs  "rIoptionsc Csd}t|}|}|}d}|rd|d}dt||}t||jdkr9t||kr9d}|d|}nd}t*|D] }tt |qA|r`d j|d }t|WddSWddS1skwYdS) N rDz (target: )zCompatible tags: {}{}r!TFz?... [First {tag_limit} tags shown. Pass --verbose to show all.]) tag_limit) r Zget_tagsZ format_givenrGlenrrverboserr>) rJrMZ target_pythontagsZformatted_targetsuffixmsgZ tags_limitedtagrrr show_tagsks0   "rTconfigcsrt}|D]\}}||ddq|sdSgdfdd|D}|s+dSd|vr4|dd|S) N.rz Not specified)ZinstallZwheelZdownloadcsg|]}|vr|qSrr)r%r5Zlevels_that_override_globalrrr's z"ca_bundle_info..globalz, )setrEaddr#remover+)rUZlevelskey_Zglobal_overriding_levelrrWrca_bundle_infos   r^c@s<eZdZdZdZdZd ddZded ee de fd d Z dS) DebugCommandz$ Display debug information. z %prog TrNcCs,t|j|jd|j|jjdS)Nr)r Zadd_target_python_optionsZcmd_optsparserZinsert_option_grouprUload)selfrrr add_optionss zDebugCommand.add_optionsrJargscCstdtdttdtjtdtjtdttdttdt 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 valueZREQUESTS_CA_BUNDLEZCURL_CA_BUNDLEzpip._vendor.certifi.where()zpip._vendor.DEBUNDLED)rZwarningrrrr? executablegetdefaultencodinggetfilesystemencodinglocaleZgetpreferredencodingplatformrr^r`rUr)environgetrr;rZ DEBUNDLEDrIrTr)rbrJrdrrrruns,     zDebugCommand.runrN) __name__ __module__ __qualname____doc__ZusageZignore_require_venvrcrrr>intrlrrrrr_s  r_rm)4rhZloggingr)rZoptparsertypesrtypingrrrrZ pip._vendorr;Zpip._vendor.certifirZpip._vendor.packaging.versionr rFr r-Zpip._internal.clir Zpip._internal.cli.base_commandr Zpip._internal.cli.cmdoptionsr Zpip._internal.cli.status_codesrZpip._internal.configurationrZpip._internal.metadatarZpip._internal.utils.loggingrZpip._internal.utils.miscrZ getLoggerrnrr>rrr3r<rBrHrIrTr^r_rrrrs<