summaryrefslogtreecommitdiff
path: root/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/uninstall.py
diff options
context:
space:
mode:
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/uninstall.py')
-rw-r--r--venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/uninstall.py71
1 files changed, 0 insertions, 71 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/uninstall.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/uninstall.py
deleted file mode 100644
index 3bfa07f..0000000
--- a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_internal/commands/uninstall.py
+++ /dev/null
@@ -1,71 +0,0 @@
1from __future__ import absolute_import
2
3from pip._vendor.packaging.utils import canonicalize_name
4
5from pip._internal.basecommand import Command
6from pip._internal.exceptions import InstallationError
7from pip._internal.req import InstallRequirement, parse_requirements
8
9
10class UninstallCommand(Command):
11 """
12 Uninstall packages.
13
14 pip is able to uninstall most installed packages. Known exceptions are:
15
16 - Pure distutils packages installed with ``python setup.py install``, which
17 leave behind no metadata to determine what files were installed.
18 - Script wrappers installed by ``python setup.py develop``.
19 """
20 name = 'uninstall'
21 usage = """
22 %prog [options] <package> ...
23 %prog [options] -r <requirements file> ..."""
24 summary = 'Uninstall packages.'
25
26 def __init__(self, *args, **kw):
27 super(UninstallCommand, self).__init__(*args, **kw)
28 self.cmd_opts.add_option(
29 '-r', '--requirement',
30 dest='requirements',
31 action='append',
32 default=[],
33 metavar='file',
34 help='Uninstall all the packages listed in the given requirements '
35 'file. This option can be used multiple times.',
36 )
37 self.cmd_opts.add_option(
38 '-y', '--yes',
39 dest='yes',
40 action='store_true',
41 help="Don't ask for confirmation of uninstall deletions.")
42
43 self.parser.insert_option_group(0, self.cmd_opts)
44
45 def run(self, options, args):
46 with self._build_session(options) as session:
47 reqs_to_uninstall = {}
48 for name in args:
49 req = InstallRequirement.from_line(
50 name, isolated=options.isolated_mode,
51 )
52 if req.name:
53 reqs_to_uninstall[canonicalize_name(req.name)] = req
54 for filename in options.requirements:
55 for req in parse_requirements(
56 filename,
57 options=options,
58 session=session):
59 if req.name:
60 reqs_to_uninstall[canonicalize_name(req.name)] = req
61 if not reqs_to_uninstall:
62 raise InstallationError(
63 'You must give at least one requirement to %(name)s (see '
64 '"pip help %(name)s")' % dict(name=self.name)
65 )
66 for req in reqs_to_uninstall.values():
67 uninstall_pathset = req.uninstall(
68 auto_confirm=options.yes, verbose=self.verbosity > 0,
69 )
70 if uninstall_pathset:
71 uninstall_pathset.commit()