관리-도구
편집 파일: inspect.cpython-38.pyc
U &?�fu � @ s� d dl Z d dlmZ d dlmZmZmZ d dlmZ d dl m Z d dlmZ d dl mZ d dlmZ d d lmZ d d lmZmZ d dlmZ d dlmZ e �e�ZG d d� de�ZdS )� N)�Values)�Any�Dict�List)�default_environment)� print_json)�__version__)� cmdoptions)�Command)�SUCCESS)�BaseDistribution�get_environment)�stdlib_pkgs)�path_to_urlc @ sT e Zd ZdZdZdZdd�dd�Zeee e d�d d �Zee e ef d�dd �ZdS )�InspectCommandzZ Inspect the content of a Python environment and produce a report in JSON format. Tz %prog [options]N)�returnc C sN | j jddddd� | j jdddddd � | j �t�� � | 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��self� r �L/opt/hc_python/lib/python3.8/site-packages/pip/_internal/commands/inspect.py�add_options s � �zInspectCommand.add_options)�options�argsr c sT t �|� t|j�j|j|jtt�d�}dt � fdd�|D �t � d�}t|d� tS )N)� local_only� user_only�skip�1c s g | ]}� � |��qS r )� _dist_to_dict)�.0�distr r r � <listcomp>: s z&InspectCommand.run.<locals>.<listcomp>)�version�pip_version� installed�environment)�data) r �check_list_path_optionr �path�iter_installed_distributions�localr �setr r r r r )r r"