3
g>                 @   s  d Z ddlZddlZddlmZ ddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ejeZG dd deZee ee eddddZee ee ee ee ee e e eee ee
eee dddZ!dS )z6Legacy installation process, i.e. `setup.py install`.
    N)change_root)ListOptionalSequence)BuildEnvironment)InstallationError)Scheme)
indent_log)
ensure_dir)make_setuptools_install_args)runner_with_spinner_message)TempDirectoryc               @   s   e Zd ZdS )LegacyInstallFailureN)__name__
__module____qualname__ r   r   e/var/www/tester-filtro-web/env/lib/python3.6/site-packages/pip/_internal/operations/install/legacy.pyr      s   r   )record_linesrootreq_descriptionreturnc          
      s   t t d fdd}x>| D ]$}tjj|}|jdr||}P qW dj|}t|g }xD| D ]<}|j }	tjj|	r|	tjj	7 }	|j
tjj||	| q^W |j  t| tjj|d}
t|
d}|jdj|d  W d Q R X d S )	N)pathr   c                s(    d kst jj|  r| S t | S d S )N)osr   isabsr   )r   )r   r   r   prepend_root   s    zBwrite_installed_files_from_setuptools_record.<locals>.prepend_rootz	.egg-infoz{} did not indicate that it installed an .egg-info directory. Only setup.py projects generating .egg-info directories are supported.zinstalled-files.txtw
)strr   r   dirnameendswithformatr   stripisdirsepappendrelpathsortr
   joinopenwrite)r   r   r   r   line	directoryegg_info_dirmessage	new_linesfilenameZinst_files_pathfr   )r   r   ,write_installed_files_from_setuptools_record   s(    


r2   )install_optionsglobal_optionsr   homeprefixuse_user_site	pycompileschemesetup_py_pathisolatedreq_name	build_envunpacked_source_directoryr   r   c          &   C   s   |j }tdd}ytjj|jd}t||| |||||||	|d}td|
 }t " | |||d W d Q R X W d Q R X tjj|st	j
d| dS W n( tk
r } zt|W Y d d }~X nX t|}|j j }W d Q R X W d Q R X t||| d	S )
Nrecord)kindzinstall-record.txt)
r4   r3   record_filenamer   r6   
header_dirr5   r7   no_user_configr8   zRunning setup.py install for )cmdcwdzRecord file %s not foundFT)headersr   r   r   r(   r   r   r	   existsloggerdebug	Exceptionr   r)   read
splitlinesr2   )r3   r4   r   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r   rB   temp_dirrA   Zinstall_argsrunnerer1   r   r   r   r   install>   s>    
 rP   )"__doc__loggingr   distutils.utilr   typingr   r   r   pip._internal.build_envr   pip._internal.exceptionsr   pip._internal.models.schemer   pip._internal.utils.loggingr	   pip._internal.utils.miscr
   $pip._internal.utils.setuptools_buildr   pip._internal.utils.subprocessr   pip._internal.utils.temp_dirr   	getLoggerr   rH   rJ   r   r   r2   boolrP   r   r   r   r   <module>   sB   
"