3
ÝPfD ã @ s` d dl mZ d dlZd dlmZ d dlmZmZmZ d dl m
Z
d dlmZ G dd„ de
ƒZ
dS ) é )Úabsolute_importN)Ú
WheelCache)ÚInstallRequirementÚRequirementSetÚparse_requirements)ÚCommand)ÚInstallationErrorc s4 e Zd ZdZdZdZdZ‡ fdd„Zdd„ Z‡ Z S ) Ú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``.
Ú uninstallzU
%prog [options] ...
%prog [options] -r ...zUninstall packages.c sV t t| ƒj||Ž | jjddddg ddd� | jjdd d
ddd
� | jjd| jƒ d S )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.)r r r r )Úsuperr Ú__init__Zcmd_optsZ
add_optionÚparserZinsert_option_group)ÚselfÚargsÚkw)Ú __class__© ú/usr/lib/python3.6/uninstall.pyr s zUninstallCommand.__init__c
C sÐ | j |ƒ�¼}tjjtƒ tƒ ƒ}t|j|ƒ}td d d |j||d�}x$|D ]}|j t
j||j|d�ƒ qFW x2|jD ](}x"t
||||d�D ]} |j | ƒ q„W qnW |js´tdt| jd� ƒ‚|j|jd� W d Q R X d S )N)Z build_dirZsrc_dirZdownload_dirÚisolatedÚsessionÚwheel_cache)r r )Úoptionsr r zLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))Úname)Zauto_confirm)Z_build_sessionÚpipÚindexZ
FormatControlÚsetr Ú cache_dirr Z
isolated_modeZadd_requirementr Z from_liner r Zhas_requirementsr Údictr" r
r )
r r! r r Zformat_controlr Zrequirement_setr" ÚfilenameZreqr r r Úrun- s6
zUninstallCommand.run)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r" ZusageZsummaryr r) Ú
__classcell__r r )r r r
s r )Z
__future__r r# Z pip.wheelr Zpip.reqr r r Zpip.basecommandr Zpip.exceptionsr r r r r r Ú s