U
    «ÃT_Ö  ã                   @   sº   d Z ddlZddl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r¤ddlmZmZmZ ddlmZ ddlmZ e e¡Zdd„ ZdS )z6Legacy installation process, i.e. `setup.py install`.
é    N)Úchange_root)Ú
deprecated)Ú
indent_log)Ú
ensure_dir)Úmake_setuptools_install_args)Úrunner_with_spinner_message)ÚTempDirectory)ÚMYPY_CHECK_RUNNING)ÚListÚOptionalÚSequence)ÚScheme)ÚInstallRequirementc	                    sþ  t |ƒ| j dg ¡ }t |ƒ| j dg ¡ }|j}	tdd��Æ}
tj |
jd¡}t| j	|||ˆ ||	||| j
|d�}td | j¡ƒ}tƒ �& | j� ||| jd� W 5 Q R X W 5 Q R X tj |¡sØt d	|¡ W 5 Q R £ d S d
| _t|ƒ�}| ¡  ¡ }W 5 Q R X W 5 Q R X ‡ fdd„}|D ],}tj |¡}| d¡�r||ƒ} �qh�qtd | ¡d | j¡ddd� d S g }|D ]@}| ¡ }tj |¡�r–|tjj7 }| tj ||ƒ|¡¡ �qp|  ¡  t!|ƒ tj |d¡}t|dƒ�}| "d |¡d ¡ W 5 Q R X d S )NÚglobal_optionsÚinstall_optionsÚrecord)Úkindzinstall-record.txt)
r   r   Úrecord_filenameÚrootÚprefixÚ
header_dirÚhomeÚuse_user_siteÚno_user_configÚ	pycompilezRunning setup.py install for {})ÚcmdÚcwdzRecord file %s not foundTc                    s&   ˆ d kst j | ¡s| S tˆ | ƒS d S )N)ÚosÚpathÚisabsr   )r   ©r   © úK/tmp/pip-unpacked-wheel-8u7dkzi1/pip/_internal/operations/install/legacy.pyÚprepend_rootV   s    zinstall.<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ƒfor maintainers: updating the setup.py of {0}. For users: contact the maintainers of {0} to let them know to update their setup.py.z20.2iV  )ÚreasonÚreplacementÚgone_inÚissuezinstalled-files.txtÚwÚ
)#ÚlistÚoptionsÚgetÚheadersr   r   r   Újoinr   Úsetup_py_pathÚisolatedr   ÚformatÚnamer   Ú	build_envÚunpacked_source_directoryÚexistsÚloggerÚdebugÚinstall_succeededÚopenÚreadÚ
splitlinesÚdirnameÚendswithr   ÚstripÚisdirÚsepÚappendÚrelpathÚsortr   Úwrite)Úinstall_reqr   r   r   r   r   r   r   Úschemer   Útemp_dirr   Úinstall_argsÚrunnerÚfÚrecord_linesr#   ÚlineÚ	directoryÚegg_info_dirÚ	new_linesÚfilenameÚinst_files_pathr!   r    r"   Úinstall   s†    ÿÿõ
ÿþ
 
ÿüýòÿrR   )Ú__doc__Úloggingr   Údistutils.utilr   Úpip._internal.utils.deprecationr   Úpip._internal.utils.loggingr   Úpip._internal.utils.miscr   Ú$pip._internal.utils.setuptools_buildr   Úpip._internal.utils.subprocessr   Úpip._internal.utils.temp_dirr   Úpip._internal.utils.typingr	   Útypingr
   r   r   Úpip._internal.models.schemer   Úpip._internal.req.req_installr   Ú	getLoggerÚ__name__r6   rR   r!   r!   r!   r"   Ú<module>   s    
