o
    Ëý°jû  ã                   @   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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 e¡Zdee dee deddfdd„Zdee dee dee dee dee dedededededede
dededefdd„ZdS ) z6Legacy installation process, i.e. `setup.py install`.
é    N)Úchange_root)ÚListÚOptionalÚSequence)ÚBuildEnvironment)ÚInstallationErrorÚLegacyInstallFailure)ÚScheme)Ú
ensure_dir)Úmake_setuptools_install_args)Úrunner_with_spinner_message)ÚTempDirectoryÚrecord_linesÚrootÚreq_descriptionÚreturnc                    sü   dt dt f‡ fdd„}| D ]}tj |¡}| d¡r ||ƒ} n
qd |¡}t|ƒ‚g }| D ]}| ¡ }	tj |	¡r@|	tjj	7 }	| 
tj ||	ƒ|¡¡ q.| ¡  t|ƒ tj |d¡}
t|
dƒ�}| d	 |¡d	 ¡ W d   ƒ d S 1 sww   Y  d S )
NÚpathr   c                    s"   ˆ d u s
t j | ¡s| S tˆ | ƒS )N)Úosr   Úisabsr   )r   ©r   © úš/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/pip/_internal/operations/install/legacy.pyÚ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ÚfilenameÚinst_files_pathÚfr   r   r   Ú,write_installed_files_from_setuptools_record   s.   
þü"ÿr0   Úinstall_optionsÚglobal_optionsÚhomeÚprefixÚuse_user_siteÚ	pycompileÚschemeÚsetup_py_pathÚisolatedÚreq_nameÚ	build_envÚunpacked_source_directoryc                 C   s4  |j }tdd��‚}zMtj |jd¡}t||| |||||||	|d�}td|
› �ƒ}|� |||d� W d   ƒ n1 s;w   Y  tj |¡sUt 	d|¡ W W d   ƒ dS W n t
yh } zt|
d	�|‚d }~ww t|ƒ�}| ¡  ¡ }W d   ƒ n1 s~w   Y  W d   ƒ n1 s�w   Y  t|||ƒ d
S )NÚrecord)Úkindzinstall-record.txt)
r2   r1   Úrecord_filenamer   r4   Ú
header_dirr3   r5   Úno_user_configr6   zRunning setup.py install for )ÚcmdÚcwdzRecord file %s not foundF)Úpackage_detailsT)Úheadersr   r   r   r%   r   r   ÚexistsÚloggerÚdebugÚ	Exceptionr   r&   ÚreadÚ
splitlinesr0   )r1   r2   r   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r   r@   Útemp_dirr?   Úinstall_argsÚrunnerÚer/   r   r   r   r   Úinstall9   sT   õÿþÿã€þ
	ÿ€Ø+rP   )Ú__doc__Úloggingr   Údistutils.utilr   Útypingr   r   r   Úpip._internal.build_envr   Úpip._internal.exceptionsr   r   Úpip._internal.models.schemer	   Úpip._internal.utils.miscr
   Ú$pip._internal.utils.setuptools_buildr   Úpip._internal.utils.subprocessr   Úpip._internal.utils.temp_dirr   Ú	getLoggerÚ__name__rG   r   r0   ÚboolrP   r   r   r   r   Ú<module>   sj    
ÿþý
ü%ÿþýüûúùø	÷
öõôóòñ