U ʗRe. @sddlZddlmZddlmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZdd lmZdd lmZeeZGd ddeZdS)N)Values)AnyDictList)default_environment) print_json) __version__) cmdoptions)Command)SUCCESS)BaseDistributionget_environment) stdlib_pkgs) path_to_urlc@sTeZdZdZdZdZddddZeee e dd d Z e e e efd d d ZdS)InspectCommandzZ Inspect the content of a Python environment and produce a report in JSON format. Tz %prog [options]N)returncCsN|jjddddd|jjdddddd |jt|jd |jdS) Nz--local store_trueFzSIf in a virtualenv that has global access, do not list globally-installed packages.)actiondefaulthelpz--useruserz,Only output packages installed in user-site.)destrrrr)cmd_opts add_optionr list_pathparserinsert_option_groupselfr/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/commands/inspect.py add_optionss zInspectCommand.add_options)optionsargsrcs^tdt|t|jj|j|jt t d}dt fdd|Dt d}t |dtS)Nzypip inspect is currently an experimental command. The output format may change in a future release without prior warning.) local_only user_onlyskip0csg|]}|qSr) _dist_to_dict).0distrrr ?sz&InspectCommand.run..)version pip_version installed environment)data)loggerwarningr check_list_path_optionr pathiter_installed_distributionslocalrsetrrrrr )rr"r#distsoutputrrr run0s    zInspectCommand.run)r*rcCsv|j|jd}|j}|dk r*||d<n$|j}|dk rNt|ddid|d<|j}|jrb||d<|jrr|j|d<|S)N)metadataZmetadata_location direct_urleditableT)urldir_info installer requested) metadata_dict info_locationr<to_dicteditable_project_locationrr@installed_with_dist_inforA)rr*resr<rEr@rrr r(Fs&  zInspectCommand._dist_to_dict)__name__ __module__ __qualname____doc__ignore_require_venvusager!rrstrintr:r rrr(rrrr rs r)loggingoptparsertypingrrrZpip._vendor.packaging.markersrpip._vendor.richrpiprZpip._internal.clir pip._internal.cli.req_commandr pip._internal.cli.status_codesr pip._internal.metadatar r pip._internal.utils.compatrpip._internal.utils.urlsr getLoggerrHr1rrrrr s