3 ig@sddlZddlZddlZddlZddlmZddlmZddlm Z m Z m Z m Z ddl ZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd l m!Z!ddl"m#Z#ddl$m%Z%ej&e'Z(e)e ddddZ*ddddZ+e e)e)fdddZ,e)edddZ-e)e e)dddZ.e e)e)fddddZ/ddd d!Z0edd"d#d$Z1ee)d%d&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_version)namevaluereturncCstjd||dS)Nz%s: %s)loggerinfo)rrr;/tmp/pip-build-88gy_88q/pip/pip/_internal/commands/debug.py show_valuesr)rc Cs2tjdtjj}ttd|WdQRXdS)Nzsys.implementation:r)rrsysimplementationrrr)implementation_namerrrshow_sys_implementations rc CsPtjjtjjtdd}t|}dd|jD}WdQRXtdd|DS)N_vendorz vendor.txtcSs(g|] }d|kr|jjdddqS)z== r)stripsplit).0linerrr .sz)create_vendor_txt_map..css|]}|jddVqdS)z==r!N)r#)r$r%rrr 2sz(create_vendor_txt_map..)ospathjoindirname pip_locationopen readlinesdict)Zvendor_txt_pathflinesrrrcreate_vendor_txt_map%s  r2) module_namercCs:|j}|dkrd}td|ttddttj|S)N setuptools pkg_resourcesz pip._vendor.r)level)lower __import__globalslocalsgetattrpipr)r3rrrget_module_from_module_name5s r=cCsHt|}t|dd}|sDttjj|jg}|j|}|rDt|j }|S)N __version__) r=r;rr(r)r+r get_distributionstrversion)r3modulerAenvdistrrrget_vendor_version_from_module@s   rE)vendor_txt_versionsrcCs^xX|jD]L\}}d}t|}|s,d}|}nt|t|krFdj|}tjd|||q WdS)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)itemsrE parse_versionformatrr)rFr3Zexpected_versionZ extra_messageZactual_versionrrrshow_actual_vendor_versionsNsrKc Cs.tjdt}tt|WdQRXdS)Nzvendored library versions:)rrr2rrK)rFrrrshow_vendor_versionscs rL)optionsrc Csd}t|}|j}|j}d}|r0d|d}djt||}tj||jdkrrt||krrd}|d|}nd}t<x|D]}tjt |qW|rd j|d }tj|WdQRXdS) N rGz (target: )zCompatible tags: {}{}r!TFz?... [First {tag_limit} tags shown. Pass --verbose to show all.]) tag_limit) r Zget_tagsZ format_givenrJlenrrverboserr@) rMrPZ target_pythontagsZformatted_targetsuffixmsgZ tags_limitedtagrrr show_tagsks(   rW)configrcsxt}x(|jD]\}}|j|jddqW|s8dSdddgfdd|D}|s\d Sd |krn|jd d j|S) N.rz Not specifiedinstallwheeldownloadcsg|]}|kr|qSrr)r$r6)levels_that_override_globalrrr&sz"ca_bundle_info..globalz, )setrHaddr#remover*)rXZlevelskey_Zglobal_overriding_levelr)r]rca_bundle_infos  rdc@s<eZdZdZdZdZddddZeee e dd d Z dS) DebugCommandz$ Display debug information. z %prog TN)rcCs,tj|j|jjd|j|jjjdS)Nr)r Zadd_target_python_optionscmd_optsparserinsert_option_grouprXload)selfrrr add_optionss zDebugCommand.add_options)rMargsrcCstjdtdttdtjtdtjtdtjtdtjtdt j tdtj t td t |jjtd tjjd td tjjd 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)rwarningrrrrA executablegetdefaultencodinggetfilesystemencodinglocalegetpreferredencodingplatformrrdrgrXr(environgetrr<r DEBUNDLEDrLrWr)rjrMrlrrrruns(      zDebugCommand.run) __name__ __module__ __qualname____doc__usageZignore_require_venvrkrrr@intryrrrrres re)4rsloggingr(roptparsertypesrZtypingrrrr pip._vendorr<pip._vendor.certifirZpip._vendor.packaging.versionr rIr 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.miscr getLoggerrzrr@rrr2r=rErKrLrWrdrerrrrs: