3
g                 @   s   d dl Z d dlZd dlmZmZ d dlmZ d dlm	Z	 d dl
mZmZmZ e jeZee eedddZee eeee eee d	d
dZeeeee ee eee dddZdS )    N)ListOptional)open_spinner) make_setuptools_bdist_wheel_args)LOG_DIVIDERcall_subprocessformat_command_args)command_argscommand_outputreturnc             C   sb   t | }d| d}|s"|d7 }n<tj tjkr:|d7 }n$|jdsL|d7 }|d| t 7 }|S )z'Format command information for logging.zCommand arguments: 
zCommand output: Nonez'Command output: [use --verbose to show]zCommand output:
)r   loggergetEffectiveLevelloggingDEBUGendswithr   )r	   r
   command_desctext r   i/var/www/tester-filtro-web/env/lib/python3.6/site-packages/pip/_internal/operations/build/wheel_legacy.pyformat_command_result   s    


r   )namestemp_dirnamer	   r
   r   c             C   st   t | } | s2dj|}|t||7 }tj| dS t| dkrbdj|| }|t||7 }tj| tjj|| d S )z>Return the path to the wheel in the temporary build directory.z1Legacy build of wheel for {!r} created no files.
N   zZLegacy build of wheel for {!r} created more than one file.
Filenames (choosing first): {}
r   )	sortedformatr   r   warninglenospathjoin)r   r   r   r	   r
   msgr   r   r   get_legacy_build_wheel_path$   s    	


r#   )r   setup_py_path
source_dirglobal_optionsbuild_optionstempdr   c             C   s   t ||||d}d|  d}t|l}tjd| yt|||d}	W n* tk
rn   |jd tjd|  dS X tj	|}
t
|
|| ||	d	}|S Q R X dS )
zBuild one unpacked package using the "legacy" build process.

    Returns path to wheel if successfully built. Otherwise, returns None.
    )r&   r'   destination_dirzBuilding wheel for z (setup.py)zDestination directory: %s)cwdspinnererrorzFailed building wheel for %sN)r   r   r   r	   r
   )r   r   r   debugr   	Exceptionfinishr,   r   listdirr#   )r   r$   r%   r&   r'   r(   Z
wheel_argsZspin_messager+   outputr   
wheel_pathr   r   r   build_wheel_legacy?   s2    


r3   )r   os.pathr   typingr   r   pip._internal.cli.spinnersr   $pip._internal.utils.setuptools_buildr   pip._internal.utils.subprocessr   r   r   	getLogger__name__r   strr   r#   r3   r   r   r   r   <module>   s,   
