o
    f}”e>  ã                   @   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 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G dd„ d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)ÚScheme)Ú
indent_log)Ú
ensure_dir)Úmake_setuptools_install_args)Úrunner_with_spinner_message)ÚTempDirectoryc                   @   s   e Zd ZdS )ÚLegacyInstallFailureN)Ú__name__Ú
__module__Ú__qualname__© r   r   úp/Users/abhinavbhinder/Documents/map/venv/lib/python3.10/site-packages/pip/_internal/operations/install/legacy.pyr      s    r   Ú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   r   r   Ú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ÚfilenameZinst_files_pathÚfr   r   r   Ú,write_installed_files_from_setuptools_record   s.   
þü"ÿr3   Úinstall_optionsÚglobal_optionsÚhomeÚprefixÚuse_user_siteÚ	pycompileÚschemeÚsetup_py_pathÚisolatedÚreq_nameÚ	build_envÚunpacked_source_directoryc                 C   sT  |j }tdd��’}z`tj |jd¡}t||| |||||||	|d�}td|
› �ƒ}tƒ �  |� |||d� W d   ƒ n1 s?w   Y  W d   ƒ n1 sNw   Y  tj |¡sht	 
d|¡ W W d   ƒ dS W n tyx } zt|‚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)
r5   r4   Úrecord_filenamer   r7   Ú
header_dirr6   r8   Úno_user_configr9   zRunning setup.py install for )ÚcmdÚcwdzRecord file %s not foundFT)Úheadersr   r   r   r)   r   r   r	   ÚexistsÚloggerÚdebugÚ	Exceptionr   r*   ÚreadÚ
splitlinesr3   )r4   r5   r   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r   rC   Útemp_dirrB   Zinstall_argsÚrunnerÚer2   r   r   r   r   Úinstall>   sX   õÿþÿ€ ã€þ
	ÿ€Ø+rQ   )"Ú__doc__Úloggingr   Údistutils.utilr   Útypingr   r   r   Úpip._internal.build_envr   Úpip._internal.exceptionsr   Úpip._internal.models.schemer   Úpip._internal.utils.loggingr	   Úpip._internal.utils.miscr
   Ú$pip._internal.utils.setuptools_buildr   Úpip._internal.utils.subprocessr   Úpip._internal.utils.temp_dirr   Ú	getLoggerr   rI   rK   r   r   r3   ÚboolrQ   r   r   r   r   Ú<module>   sn    
ÿþý
ü%ÿþýüûúùø	÷
öõôóòñ