U
    Eh                     @   s   d 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rddlmZmZmZ ddlmZ ddlmZ eeZdd ZdS )z6Legacy installation process, i.e. `setup.py install`.
    N)change_root)
deprecated)
indent_log)
ensure_dir)make_setuptools_install_args)runner_with_spinner_message)TempDirectory)MYPY_CHECK_RUNNING)ListOptionalSequence)Scheme)InstallRequirementc	                    s  t || jdg  }t || jdg  }|j}	tdd}
tj|
jd}t| j	||| ||	||| j
|d}td| j}t & | j ||| jd W 5 Q R X W 5 Q R X tj|std	| W 5 Q R  d S d
| _t|}|  }W 5 Q R X W 5 Q R X  fdd}|D ],}tj|}|dr||} qhqtd| d| jddd d S g }|D ]@}| }tj|r|tjj7 }|tj||| qp|   t!| tj|d}t|d}|"d|d  W 5 Q R X d S )Nglobal_optionsinstall_optionsrecord)kindzinstall-record.txt)
r   r   record_filenamerootprefix
header_dirhomeuse_user_siteZno_user_config	pycompilezRunning setup.py install for {})cmdcwdzRecord file %s not foundTc                    s&    d kst j| s| S t | S d S )N)ospathisabsr   )r   r    M./venv/lib/python3.8/site-packages/pip/_internal/operations/install/legacy.pyprepend_rootV   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.zfor maintainers: updating the setup.py of {0}. For users: contact the maintainers of {0} to let them know to update their setup.py.z20.2iV  )reasonZreplacementZgone_inZissuezinstalled-files.txtw
)#listoptionsgetZheadersr   r   r   joinr   Zsetup_py_pathisolatedr   formatnamer   Z	build_envZunpacked_source_directoryexistsloggerdebugZinstall_succeededopenread
splitlinesdirnameendswithr   stripisdirsepappendrelpathsortr   write)Zinstall_reqr   r   r   r   r   r   r   Zschemer   Ztemp_dirr   Zinstall_argsZrunnerfZrecord_linesr"   lineZ	directoryZegg_info_dirZ	new_linesfilenameZinst_files_pathr    r   r!   install   s    

 
r?   )__doc__Zloggingr   Zdistutils.utilr   Zpip._internal.utils.deprecationr   Zpip._internal.utils.loggingr   Zpip._internal.utils.miscr   Z$pip._internal.utils.setuptools_buildr   Zpip._internal.utils.subprocessr   Zpip._internal.utils.temp_dirr   Zpip._internal.utils.typingr	   typingr
   r   r   Zpip._internal.models.schemer   Zpip._internal.req.req_installr   Z	getLogger__name__r.   r?   r    r    r    r!   <module>   s    
