관리-도구
편집 파일: meta.cpython-38.pyc
U ��.e� � @ sB d Z ddlZddlZddlZddlZddlZzddlmZ W n e k rX ddl ZY nX zddlmZ W n e k r� ddl mZ Y nX ddlmZ ddlmZmZ ddlmZmZmZ ddlmZmZmZ e�e�Zd d � Zddd �Zefdd�Zdd� Z e�!� Z"e"j#ddd� e"j#dddd� dd� Z$edk�r>e$� dS )z2Build metadata for a project using PEP 517 hooks. � N)�Path� )�BuildEnvironment)�Pep517HookCaller�quiet_subprocess_runner)�tempdir�mkdir_p�dir_to_zipfile)�validate_system�load_system� compat_systemc C s� | � i �}t�d|� |�|� t�d� t� �J}t�d|� | �|i �}tj�||�}t � |tj�|tj�|��� W 5 Q R X d S )NzGot build requires: %sz$Installed dynamic build dependencieszTrying to build metadata in %s)Zget_requires_for_build_wheel�log�info�pip_installr Z prepare_metadata_for_build_wheel�os�path�join�shutilZmove�basename)�hooks�env�destZreqsZtd�filename�source� r �;/usr/lib/python3.8/site-packages/pip/_vendor/pep517/meta.py� _prep_meta s r �.c C s� |p t | �}tj�| |pd�}t|� t|� t| |d |�d��}|�t ��2 t � � }|�|d � t|||� W 5 Q R X W 5 Q R X d S )NZdistz build-backendzbackend-pathZrequires) r r r r r r r �getZsubprocess_runnerr r r r )� source_dirr �systemr r r r r �build) s �r! c C s0 t � � }| |d� t|�W 5 Q R � S Q R X d S )N)r )r r )�builder�out_dirr r r �build_as_zip8 s r$ c C s: t j�| �} t| �}tjt| |d�}tt|��}t � |�S )z� Given a source directory (root) of a package, return an importlib.metadata.Distribution object with metadata build from that package. )r r )r r � expanduserr � functools�partialr! r r$ �imp_metaZPathDistribution)�rootr r"