a
    hbòfû  ã                   @   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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ÚLegacyInstallFailure)ÚScheme)Ú
ensure_dir)Úmake_setuptools_install_args)Úrunner_with_spinner_message)ÚTempDirectory)Úrecord_linesÚrootÚreq_descriptionÚreturnc                    sø   t t dœ‡ fdd„}| D ]&}tj |¡}| d¡r||ƒ} qRqd |¡}t|ƒ‚g }| D ]<}| ¡ }	tj |	¡r~|	tjj	7 }	| 
tj ||	ƒ|¡¡ qZ| ¡  t|ƒ tj |d¡}
t|
dƒ�$}| d |¡d ¡ W d   ƒ n1 sê0    Y  d S )	N)Úpathr   c                    s&   ˆ d u st j | ¡s| S tˆ | ƒS d S )N)Úosr   Úisabsr   )r   ©r   © úd/home/httpd/docs/test/DocsMgr/lib/python3.9/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_optionsr   ÚhomeÚprefixÚuse_user_siteÚ	pycompileÚschemeÚsetup_py_pathÚisolatedÚreq_nameÚ	build_envÚunpacked_source_directoryr   r   c                 C   sF  |j }tdd���}zštj |jd¡}t||| |||||||	|d�}td|
› �ƒ}|� |||d� W d   ƒ n1 sx0    Y  tj |¡s¬t 	d|¡ W W d   ƒ dS W n0 t
yÞ } zt|
d	�|‚W Y d }~n
d }~0 0 t|ƒ�}| ¡  ¡ }W d   ƒ n1 �s0    Y  W d   ƒ n1 �s,0    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   sD    õÿþ$"
L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>   sB   
ü&ñ