3 PfD @s`ddlmZddlZddlmZddlmZmZmZddl m Z ddl m Z Gddde Z dS) )absolute_importN) WheelCache)InstallRequirementRequirementSetparse_requirements)Command)InstallationErrorcs4eZdZdZdZdZdZfddZddZZ 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 sVtt|j|||jjddddgddd|jjdd d d d d |jjd|jdS)Nz-rz --requirement requirementsappendfilezjUninstall all the packages listed in the given requirements file. This option can be used multiple times.)destactiondefaultmetavarhelpz-yz--yesyes store_truez2Don't ask for confirmation of uninstall deletions.)rrrr)superr __init__Zcmd_optsZ add_optionparserZinsert_option_group)selfargskw) __class__/usr/lib/python3.6/uninstall.pyrszUninstallCommand.__init__c Cs|j|}tjjtt}t|j|}tddd|j||d}x$|D]}|j t j ||j|dqFWx2|j D](}x"t ||||dD]} |j | qWqnW|jstdt|jd|j|jdWdQRXdS)N)Z build_dirZsrc_dirZ download_dirisolatedsession wheel_cache)rr )optionsrr zLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))name)Z auto_confirm)Z_build_sessionpipindexZ FormatControlsetr cache_dirrZ isolated_modeZadd_requirementrZ from_liner rZhas_requirementsrdictr"r r) rr!rrZformat_controlr Zrequirement_setr"filenameZreqrrrrun-s6     zUninstallCommand.run) __name__ __module__ __qualname____doc__r"ZusageZsummaryrr) __classcell__rr)rrr s   r )Z __future__rr#Z pip.wheelrZpip.reqrrrZpip.basecommandrZpip.exceptionsrr rrrrs