o Ec @sddlZddlmZddlmZddlmZddlmZddl m Z m Z ddl m Z ddlmZdd lmZdd lmZmZdd lmZeeZGd d d ee ZdS)N)Values)List)canonicalize_name)Command)SessionCommandMixinwarn_if_run_as_root)SUCCESS)InstallationError)parse_requirements)install_req_from_line#install_req_from_parsed_requirement)(protect_pip_from_modification_on_windowsc@s8eZdZdZdZd ddZdedeede fd d Z dS) 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 ...returnNc CsD|jjddddgddd|jjdd d d d d |jd|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)Zcmd_optsZ add_optionparserZinsert_option_group)selfrS/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/commands/uninstall.py add_options$s" zUninstallCommand.add_optionsoptionsargsc Cs||}i}|D]}t||jd}|jr||t|j<q td|q |jD]}t|||dD]}t ||jd}|jrC||t|j<q0q'|sTt d|jd|jdt d|vd| D]}|j |j|jd kd } | rr| q_ttS) N)isolatedzSInvalid requirement: %r ignored - the uninstall command expects named requirements.)rsessionz*You must give at least one requirement to z (see "pip help z")Zpip)Z modifying_pipr)Z auto_confirmverbose)Zget_default_sessionr Z isolated_modenamerloggerZwarningrr r r r valuesZ uninstallr verbosityZcommitrr) rrr r"Zreqs_to_uninstallr$ZreqfilenameZ parsed_reqZuninstall_pathsetrrrrun;sV     zUninstallCommand.run)rN) __name__ __module__ __qualname____doc__Zusagerrrstrintr)rrrrrs  r)ZloggingZoptparsertypingrZpip._vendor.packaging.utilsrZpip._internal.cli.base_commandrZpip._internal.cli.req_commandrrZpip._internal.cli.status_codesrZpip._internal.exceptionsr Zpip._internal.reqr Zpip._internal.req.constructorsr r Zpip._internal.utils.miscr Z getLoggerr*r%rrrrrs