Re@sddlmZddlZddlZddlZddlZddlZddlmZddl m Z ddlm Z ddl mZddlmZddlmZdd lmZdd lmZdd lmZdd lmZer>dd lmZddlmZmZm Z ddl!m"Z"ddl#m$Z$ej%e&Z'ddZ(ddZ)ddZ*ddZ+ddZ,ddZ-ddZ.dd Z/d!d"Z0Gd#d$d$eZ1dS)%)absolute_importN) pkg_resources)where)__file__) cmdoptions)Command)make_target_python)SUCCESS) indent_log)get_pip_version)MYPY_CHECK_RUNNING) ModuleType)ListOptionalDict)Values) ConfigurationcCstjd||dS)Nz%s: %s)loggerinfo)namevaluer/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_internal/commands/debug.py show_valuesrc CsYtjdttdr1tj}|j}nd}ttd|WdQRXdS)Nzsys.implementation:implementationr)rrhasattrsysrrr r)rimplementation_namerrrshow_sys_implementation#s    rc Csjtjjtjjtdd}t| }dd|jD}WdQRXtdd|DS)N_vendorz vendor.txtcSs8g|].}d|kr|jjdddqS)z== r)stripsplit).0linerrr ;s z)create_vendor_txt_map..css!|]}|jddVqdS)z==r"N)r$)r%r&rrr ?sz(create_vendor_txt_map..)ospathjoindirname pip_locationopen readlinesdict)Zvendor_txt_pathflinesrrrcreate_vendor_txt_map0s   r3cCsS|j}|dkrd}tdj|ttddttj|S)N setuptoolsrzpip._vendor.{}levelr)lower __import__formatglobalslocalsgetattrpipr ) module_namerrrget_module_from_module_nameBs    r>cCsvt|}t|dd}|srtjtjj|jg}|jtj j |}t|dd}|S)N __version__version) r>r;r WorkingSetr)r*r,rfind Requirementparse)r=moduler@Zpkg_setpackagerrrget_vendor_version_from_moduleSs rGcCsyxr|jD]d\}}d}t|}|s@d}|}n||kr[dj|}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. rzM (Unable to locate actual module version, using vendor.txt specified version)z5 (CONFLICT: vendor.txt suggests version should be {})z%s==%s%sN)itemsrGr8rr)vendor_txt_versionsr=Zexpected_versionZ extra_messageZactual_versionrrrshow_actual_vendor_versionsgs    rJc Cs5tjdt}tt|WdQRXdS)Nzvendored library versions:)rrr3r rJ)rIrrrshow_vendor_versionsys   rKc Csd}t|}|j}|j}d}|rEdj|}djt||}tj||jdkrt||krd}|d|}nd}tNx!|D]}tjt |qW|rdjd |}tj|WdQRXdS) N rz (target: {})zCompatible tags: {}{}r"TFz?... [First {tag_limit} tags shown. Pass --verbose to show all.] tag_limit) rget_tags format_givenr8lenrrverboser str) optionsrM target_pythontagsZformatted_targetsuffixmsgZ tags_limitedtagrrr show_tagss(    !    rYcst}x4|jD]&\}}|j|jddqW|sJdSdddgfdd|D}|s|d Sd |kr|jd d j|S) N.rz Not specifiedinstallwheeldownloadcs"g|]}|kr|qSrr)r%r5)levels_that_override_globalrrr's z"ca_bundle_info..globalz, )setrHaddr$remover+)configlevelskey_Zglobal_overriding_levelr)r^rca_bundle_infos   rgc@s:eZdZdZdZdZddZddZdS) DebugCommandz$ Display debug information. z %prog TcCs:tj|j|jjd|j|jjjdS)Nr)radd_target_python_optionscmd_optsparserinsert_option_grouprcload)selfrrr add_optionsszDebugCommand.add_optionscCstjdtdttdtjtdtjtdtjtdtjtdt 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)rwarningrr rr@ executablegetdefaultencodinggetfilesystemencodinglocalegetpreferredencodingplatformrrgrkrcr)environgetrr<r DEBUNDLEDrKrYr )rnrSargsrrrruns& zDebugCommand.runN)__name__ __module__ __qualname____doc__usageignore_require_venvror}rrrrrhs  rh)2 __future__rrvloggingr)r pip._vendorr<rpip._vendor.certifirrr-Zpip._internal.clirpip._internal.cli.base_commandrZpip._internal.cli.cmdoptionsrpip._internal.cli.status_codesr pip._internal.utils.loggingr pip._internal.utils.miscr pip._internal.utils.typingr typesr typingrrroptparserpip._internal.configurationr getLoggerr~rrrr3r>rGrJrKrYrgrhrrrrs>           "