a
    Œ�éi¹  ã                   @   sÒ   d Z ddl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G dd„ deƒZ dd„ Z!dS )z6Legacy installation process, i.e. `setup.py install`.
é    N)Úchange_root)ÚInstallationError)Ú
indent_log)Ú
ensure_dir)Úmake_setuptools_install_args)Úrunner_with_spinner_message)ÚTempDirectory)ÚMYPY_CHECK_RUNNING)ÚListÚOptionalÚSequence)ÚBuildEnvironment)ÚSchemec                   @   s   e Zd Zdd„ ZdS )ÚLegacyInstallFailurec                 C   s   t  ¡ | _d S ©N)ÚsysÚexc_infoÚparent)Úself© r   úW/home/Claro/venv/lib/python3.9/site-packages/pip/_internal/operations/install/legacy.pyÚ__init__   s    zLegacyInstallFailure.__init__N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s   r   c                    s>  |j }tdd���}zÀtj |jd¡}t||| |ˆ |||||	|d�}td |
¡ƒ}tƒ �@ |� |||d� W d   ƒ n1 s€0    Y  W d   ƒ n1 sž0    Y  tj 	|¡sÒt
 d|¡ W W d   ƒ dS W n tyê   t‚Y n0 t|ƒ�}| ¡  ¡ }W d   ƒ n1 �s0    Y  W d   ƒ n1 �s80    Y  ‡ fd	d
„}|D ],}tj |¡}| d¡�rR||ƒ} �q’�qRd |¡}t|ƒ‚g }|D ]@}| ¡ }tj |¡�rÀ|tjj7 }| tj ||ƒ|¡¡ �qš| ¡  t|ƒ tj |d¡}t|dƒ�$}| d |¡d ¡ W d   ƒ n1 �s00    Y  dS )NÚrecord)Úkindzinstall-record.txt)
Úglobal_optionsÚinstall_optionsÚ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 foundFc                    s&   ˆ d u st j | ¡s| S tˆ | ƒS d S r   )ÚosÚpathÚisabsr   )r*   ©r    r   r   Úprepend_root`   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installed-files.txtÚwÚ
T)Úheadersr   r)   r*   Újoinr   r   Úformatr   ÚexistsÚloggerÚdebugÚ	Exceptionr   ÚopenÚreadÚ
splitlinesÚdirnameÚendswithr   ÚstripÚisdirÚsepÚappendÚrelpathÚsortr   Úwrite)r   r   r    r#   r!   r$   r&   ÚschemeÚsetup_py_pathÚisolatedÚreq_nameÚ	build_envÚunpacked_source_directoryÚreq_descriptionr"   Útemp_dirr   Úinstall_argsÚrunnerÚfÚrecord_linesr-   ÚlineÚ	directoryÚegg_info_dirÚmessageÚ	new_linesÚfilenameÚinst_files_pathr   r,   r   Úinstall!   sr    õÿþB

L
ÿüÿ4rV   )"Ú__doc__Úloggingr)   r   Údistutils.utilr   Úpip._internal.exceptionsr   Ú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.build_envr   Úpip._internal.models.schemer   Ú	getLoggerr   r4   r6   r   rV   r   r   r   r   Ú<module>   s$   
