3
ûâde}  ã               @   s`   d dl Z d dlZd dlmZ d dlmZmZ d dlmZ e j	e
ƒZeeeeee dœdd„ZdS )é    N)ÚOptional)ÚHookMissingÚPep517HookCaller)Úrunner_with_spinner_message)ÚnameÚbackendÚmetadata_directoryÚtempdÚreturnc             C   s´   |dk	st ‚yxtjd|ƒ td| › d�ƒ}|j|ƒ�H y|j||d�}W n. tk
rv } ztjd| |ƒ dS d}~X nX W dQ R X W n  tk
r¤   tjd| ƒ dS X t	j
j||ƒS )z�Build one InstallRequirement using the PEP 660 build process.

    Returns path to wheel if successfully built. Otherwise, returns None.
    NzDestination directory: %szBuilding editable for z (pyproject.toml))r   zLCannot build editable %s because the build backend does not have the %s hookzFailed building editable for %s)ÚAssertionErrorÚloggerÚdebugr   Zsubprocess_runnerZbuild_editabler   ÚerrorÚ	ExceptionÚosÚpathÚjoin)r   r   r   r	   ZrunnerÚ
wheel_nameÚe© r   úL/tmp/pip-build-red6nood/pip/pip/_internal/operations/build/wheel_editable.pyÚbuild_wheel_editable   s(    
r   )Úloggingr   Útypingr   Zpip._vendor.pep517.wrappersr   r   Zpip._internal.utils.subprocessr   Ú	getLoggerÚ__name__r   Ústrr   r   r   r   r   Ú<module>   s   
