
    et                         d dl Z d dlmZ d dlmZmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZmZ d dlmZ d dlmZ  e j        e          Z G d de          ZdS )    N)Values)AnyDictList)default_environment)
print_json)__version__)
cmdoptions)Command)SUCCESS)BaseDistributionget_environment)stdlib_pkgs)path_to_urlc                   b    e Zd ZdZdZdZddZdedee	         de
fd	Zd
edee	ef         fdZdS )InspectCommandzZ
    Inspect the content of a Python environment and produce a report in JSON format.
    Tz
      %prog [options]returnNc                    | j                             dddd           | j                             ddddd	           | j                             t          j                               | j                            d
| j                    d S )Nz--local
store_trueFzSIf in a virtualenv that has global access, do not list globally-installed packages.)actiondefaulthelpz--useruserz,Only output packages installed in user-site.)destr   r   r   r   )cmd_opts
add_optionr
   	list_pathparserinsert_option_group)selfs    U/var/www/html/api/venv/lib/python3.11/site-packages/pip/_internal/commands/inspect.pyadd_optionszInspectCommand.add_options   s      / 	! 	
 	
 	
 	  ? 	! 	
 	
 	
 	  !5!7!7888''4=99999    optionsargsc                 .    t          j        |           t          |j                                      |j        |j        t          t                              }dt           fd|D             t                      d}t          |           t          S )N)
local_only	user_onlyskip1c                 :    g | ]}                     |          S  )_dist_to_dict).0distr    s     r!   
<listcomp>z&InspectCommand.run.<locals>.<listcomp>:   s'    EEEt$,,T22EEEr#   )versionpip_version	installedenvironment)data)r
   check_list_path_optionr   pathiter_installed_distributionslocalr   setr   r	   r   r   r   )r    r$   r%   distsoutputs   `    r!   runzInspectCommand.run0   s    )'222--JJ}l[!! K 
 
 &EEEEuEEE.00	
 
 	r#   r/   c                     |j         |j        d}|j        }||                                |d<   n |j        }|t          |          ddid|d<   |j        }|j        r||d<   |j        r
|j        |d<   |S )N)metadatametadata_location
direct_urleditableT)urldir_info	installer	requested)	metadata_dictinfo_locationrA   to_dicteditable_project_locationr   rE   installed_with_dist_inforF   )r    r/   resrA   rJ   rE   s         r!   r-   zInspectCommand._dist_to_dictA   s    *!%!3
 
 _
! * 2 2 4 4C )-(F%(4&'@AA"D!% %L! N	> 	)(C( 	.#~C
r#   )r   N)__name__
__module____qualname____doc__ignore_require_venvusager"   r   r   strintr=   r   r   r   r-   r,   r#   r!   r   r      s          E: : : :(6 c s    ""2 tCH~      r#   r   )loggingoptparser   typingr   r   r   pip._vendor.packaging.markersr   pip._vendor.richr   pipr	   pip._internal.clir
   pip._internal.cli.req_commandr   pip._internal.cli.status_codesr   pip._internal.metadatar   r   pip._internal.utils.compatr   pip._internal.utils.urlsr   	getLoggerrM   loggerr   r,   r#   r!   <module>rc      s6          " " " " " " " " " " = = = = = = ' ' ' ' ' '       ( ( ( ( ( ( 1 1 1 1 1 1 2 2 2 2 2 2 D D D D D D D D 2 2 2 2 2 2 0 0 0 0 0 0		8	$	$I I I I IW I I I I Ir#   