o g@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>/usr/lib/python3/dist-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)vendor_txt_pathflinesrrrcreate_vendor_txt_map%s r5 module_namecCs:|}|dkr d}td|ttddttj|S)N setuptools pkg_resourcesz pip._vendor.r)level)lower __import__globalslocalsgetattrpipr)r6rrrget_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)r6modulerDenvdistrrrget_vendor_version_from_module@s   rHvendor_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)itemsrH parse_versionformatrr)rIr6expected_version extra_messageactual_versionrrrshow_actual_vendor_versionsNsrQcCsDtdt}t t|WddS1swYdS)Nzvendored library versions:)rrr5rrQ)rIrrrshow_vendor_versionscs  "rRoptionsc Csd}t|}|}|}d}|rd|d}dt||}t||jdkr9t||kr9d}|d|}nd}t*|D] }tt |qA|r`d j|d }t|WddSWddS1skwYdS) N rJz (target: )zCompatible tags: {}{}r"TFz?... [First {tag_limit} tags shown. Pass --verbose to show all.]) tag_limit) r get_tags format_givenrMlenrrverboserrC) rSrV target_pythontagsformatted_targetsuffixmsg tags_limitedtagrrr show_tagsks0   "rbconfigcsrt}|D]\}}||ddq|sdSgdfdd|D}|s+dSd|vr4|dd|S) N.rz Not specified)installwheeldownloadcsg|]}|vr|qSrr)r&r9levels_that_override_globalrrr(sz"ca_bundle_info..globalz, )setrKaddr$remover,)rclevelskey_global_overriding_levelrrhrca_bundle_infos   rrc@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_grouprcload)selfrrr add_optionss zDebugCommand.add_optionsrSargscCstdtdttdtjtdtjtdttdttdt 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)rwarningrrrrD executablegetdefaultencodinggetfilesystemencodinglocalegetpreferredencodingplatformrrrrvrcr*environgetrr?r DEBUNDLEDrRrbr)ryrSr{rrrruns,     zDebugCommand.runrN) __name__ __module__ __qualname____doc__usageignore_require_venvrzrrrCintrrrrrrss  rsr)4rloggingr*roptparsertypesrtypingrrrr pip._vendorr?pip._vendor.certifirpip._vendor.packaging.versionr rLr r.pip._internal.clir pip._internal.cli.base_commandr pip._internal.cli.cmdoptionsr pip._internal.cli.status_codesrpip._internal.configurationrpip._internal.metadatarpip._internal.utils.loggingrpip._internal.utils.miscr getLoggerrrrCrrr5r@rHrQrRrbrrrsrrrrs<