U
    @vgo
                     @   s   d dl m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 erhd d	lmZmZmZ d
dddgZeeZG dd deZdddZdS )    )absolute_importN)
indent_log)MYPY_CHECK_RUNNING   )parse_requirements)InstallRequirement)RequirementSet)AnyListSequencer   r   r   install_given_reqsc                   @   s   e Zd Zdd Zdd ZdS )InstallationResultc                 C   s
   || _ d S )Nname)selfr    r   >/tmp/pip-unpacked-wheel-gw11q0wt/pip/_internal/req/__init__.py__init__   s    zInstallationResult.__init__c                 C   s   d | jS )NzInstallationResult(name={!r}))formatr   )r   r   r   r   __repr__   s    zInstallationResult.__repr__N)__name__
__module____qualname__r   r   r   r   r   r   r      s   r   r   c           
      O   s   | r t dddd | D  g }t  | D ]}|jrft d|j t  |jdd}W 5 Q R X z|j||f|| W n0 tk
r   |jo|j	 }|r|
   Y nX |jo|j	}	|	r|  |t|j q0W 5 Q R X |S )zu
    Install everything in the given list.

    (to be called after having downloaded and unpacked the packages)
    z!Installing collected packages: %sz, c                 S   s   g | ]
}|j qS r   r   ).0reqr   r   r   
<listcomp>5   s     z&install_given_reqs.<locals>.<listcomp>zAttempting uninstall: %sT)auto_confirm)loggerinfojoinr   should_reinstallr   	uninstallinstall	Exceptioninstall_succeededrollbackcommitappendr   )

to_installinstall_optionsglobal_optionsargskwargs	installedrequirementuninstalled_pathsetshould_rollbackshould_commitr   r   r   r   $   sJ    )r   )
__future__r   loggingpip._internal.utils.loggingr   pip._internal.utils.typingr   req_filer   req_installr   req_setr   typingr	   r
   r   __all__	getLoggerr   r   objectr   r   r   r   r   r   <module>   s"     
 