U ʗRe`@sddlZddlmZddlmZddlmZddlmZddl m Z ddl m Z m Z ddlmZdd lmZdd lmZdd lmZmZdd lmZeeZGd dde e ZdS)N)Values)List)canonicalize_name) cmdoptions)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@s8eZdZdZdZddddZeeee ddd 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 ...N)returnc CsT|jjddddgddd|jjdd d d d d |jt|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)cmd_opts add_optionrroot_user_actionparserinsert_option_group)selfr!/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/commands/uninstall.py add_options%s$ zUninstallCommand.add_options)optionsargsrc Cs||}i}|D]4}t||jd}|jr:||t|j<qtd|q|jD]:}t|||dD]&}t ||jd}|jr`||t|j<q`qN|st d|jd|jdt d|kd| D]&}|j |j|jd kd } | r| q|jd krttS) N)isolatedzSInvalid requirement: %r ignored - the uninstall command expects named requirements.)r$sessionz*You must give at least one requirement to z (see "pip help z")pip) modifying_pipr) auto_confirmverbosewarn)get_default_sessionr isolated_modenamerloggerwarningrr r r rvalues uninstallr verbositycommitrrr ) r r$r%r'Zreqs_to_uninstallr/reqfilename parsed_reqZuninstall_pathsetr!r!r"run<sT      zUninstallCommand.run) __name__ __module__ __qualname____doc__usager#rrstrintr9r!r!r!r"rs r)loggingoptparsertypingrpip._vendor.packaging.utilsrZpip._internal.clirpip._internal.cli.base_commandrpip._internal.cli.req_commandrrpip._internal.cli.status_codesr pip._internal.exceptionsr pip._internal.reqr pip._internal.req.constructorsr r pip._internal.utils.miscr getLoggerr:r0rr!r!r!r"s