HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/pip/_internal/commands/__pycache__/uninstall.cpython-310.pyc
o

@%Ne�
�@s�ddlZddlmZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
ddlmZdd	lmZdd
lmZmZddlmZe�e�ZGdd
�d
ee
�ZdS)�N)�Values)�List)�canonicalize_name)�Command)�SessionCommandMixin�warn_if_run_as_root)�SUCCESS)�InstallationError)�parse_requirements)�install_req_from_line�#install_req_from_parsed_requirement)�(protect_pip_from_modification_on_windowsc@s8eZdZdZdZddd�Zdedeede	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] <package> ...
      %prog [options] -r <requirements file> ...�returnNc	CsD|jjddddgddd�|jjdd	d
dd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)�cmd_opts�
add_option�parser�insert_option_group)�self�r�B/usr/lib/python3/dist-packages/pip/_internal/commands/uninstall.py�add_options$s"��zUninstallCommand.add_options�options�argsc
Cs�|�|�}i}|D]}t||jd�}|jr||t|j�<q	t�d|�q	|jD]}t|||d�D]}t	||jd�}|jrC||t|j�<q0q'|sTt
d|j�d|j�d���td|vd�|��D]}|j
|j|jd	kd
�}	|	rr|	��q_t�tS)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_confirm�verbose)�get_default_sessionr�
isolated_mode�namer�logger�warningrr
rr	r
�values�	uninstallr�	verbosity�commitrr)
rr"r#r%�reqs_to_uninstallr,�req�filename�
parsed_req�uninstall_pathsetrrr �run;sV
��

����
�����zUninstallCommand.run)rN)�__name__�
__module__�__qualname__�__doc__�usager!rr�str�intr8rrrr rs


r)�logging�optparser�typingr�pip._vendor.packaging.utilsr�pip._internal.cli.base_commandr�pip._internal.cli.req_commandrr�pip._internal.cli.status_codesr�pip._internal.exceptionsr	�pip._internal.reqr
�pip._internal.req.constructorsrr�pip._internal.utils.miscr
�	getLoggerr9r-rrrrr �<module>s