관리-도구
편집 파일: metadata_legacy.cpython-38.pyc
U &?�f� � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZm Z m Z ddlmZ ddl mZ ddlmZ e�e�Zeed �d d�Zeeeeeed�d d�ZdS )z;Metadata generation logic for legacy source distributions. � N)�BuildEnvironment)�open_spinner)�InstallationError�InstallationSubprocessError�MetadataGenerationFailed)�make_setuptools_egg_info_args)�call_subprocess)� TempDirectory)� directory�returnc C sR dd� t �| �D �}|s&td| � ���t|�dkr@td| � ���t j�| |d �S )z.Find an .egg-info subdirectory in `directory`.c S s g | ]}|� d �r|�qS )z .egg-info)�endswith)�.0�f� r �\/opt/hc_python/lib/python3.8/site-packages/pip/_internal/operations/build/metadata_legacy.py� <listcomp> s z"_find_egg_info.<locals>.<listcomp>z No .egg-info directory found in � z+More than one .egg-info directory found in r )�os�listdirr �len�path�join)r � filenamesr r r �_find_egg_info s �r )� build_env� setup_py_path� source_dir�isolated�detailsr c C s� t �d||� tddd�j}t|||d�}| �^ td��J}zt||d|d� W n. tk r| } zt|d �|�W 5 d }~X Y nX W 5 Q R X W 5 Q R X t |�S )znGenerate metadata using setup.py-based defacto mechanisms. Returns the generated metadata directory. z2Running setup.py (path:%s) egg_info for package %szpip-egg-infoT)�kind�globally_managed)�egg_info_dir�no_user_configzPreparing metadata (setup.py)zpython setup.py egg_info)�cwd�command_desc�spinner)�package_detailsN) �logger�debugr r r r r r r r ) r r r r r r! �argsr% �errorr r r �generate_metadata$ s. �� � 2r+ )�__doc__�loggingr �pip._internal.build_envr �pip._internal.cli.spinnersr �pip._internal.exceptionsr r r �$pip._internal.utils.setuptools_buildr �pip._internal.utils.subprocessr �pip._internal.utils.temp_dirr � getLogger�__name__r'