U ��.e� �@svddlmZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z ddlmZGd d �d ee�Zd S) �)�absolute_import)�canonicalize_name)�Command)�SessionCommandMixin)�InstallationError)�parse_requirements)�install_req_from_line)�(protect_pip_from_modification_on_windowscs,eZdZdZdZ�fdd�Zdd�Z�ZS)�UninstallCommandaB Uninstall packages. pip is able to uninstall most installed packages. Known exceptions are: - Pure distutils packages installed with ``python setup.py install``, which leave behind no metadata to determine what files were installed. - Script wrappers installed by ``python setup.py develop``. zU %prog [options] ... %prog [options] -r ...c sVtt|�j||�|jjddddgddd�|jjdd d d d d �|j�d|j�dS)Nz-rz --requirement� requirements�append�filezjUninstall all the packages listed in the given requirements file. This option can be used multiple times.)�dest�action�default�metavar�helpz-yz--yes�yes� store_truez2Don't ask for confirmation of uninstall deletions.)rrrr)�superr �__init__Zcmd_optsZ add_option�parserZinsert_option_group)�self�args�kw�� __class__��D/usr/lib/python3.8/site-packages/pip/_internal/commands/uninstall.pyrs$� �zUninstallCommand.__init__c Cs�|�|�}i}|D]&}t||jd�}|jr||t|j�<q|jD],}t|||d�D]}|jrR||t|j�<qRq@|s�tdt|jd���t d|kd�|� �D]&}|j |j |j dkd�}|r�|��q�dS) N)�isolated)�options�sessionzLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))�nameZpip)Z modifying_pipr)Z auto_confirm�verbose)Zget_default_sessionrZ isolated_moder"rr rr�dictr �valuesZ uninstallr� verbosityZcommit) rr rr!Zreqs_to_uninstallr"Zreq�filenameZuninstall_pathsetrrr�run2sB � �  ��� �zUninstallCommand.run)�__name__� __module__� __qualname__�__doc__Zusagerr(� __classcell__rrrrr s  r N)Z __future__rZpip._vendor.packaging.utilsrZpip._internal.cli.base_commandrZpip._internal.cli.req_commandrZpip._internal.exceptionsrZpip._internal.reqrZpip._internal.req.constructorsrZpip._internal.utils.miscr r rrrr�s