a
    3g	                     @   s   d Z ddlZddl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 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)ListOptionalSequence)BuildEnvironment)InstallationErrorLegacyInstallFailure)change_root)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 s0    Y  d S )	N)pathr   c                    s&    d u st j| s| S t | S d S )N)osr   isabsr   )r   r    u/var/www/html/cobodadashboardai.evdpl.com/venv/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}ztj|jd}t||| |||||||	|d}td|
 }| |||d W d    n1 sx0    Y  tj|st	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   typingr   r   r   pip._internal.build_envr   pip._internal.exceptionsr   r   Zpip._internal.locations.baser   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   
&