MCPcopy Index your code
hub / github.com/python/cpython / _main

Function _main

Lib/ensurepip/__init__.py:218–276  ·  view source on GitHub ↗
(argv=None)

Source from the content-addressed store, hash-verified

216
217
218def _main(argv=None):
219 import argparse
220 parser = argparse.ArgumentParser(color=True)
221 parser.add_argument(
222 "--version",
223 action="version",
224 version="pip {}".format(version()),
225 help="Show the version of pip that is bundled with this Python.",
226 )
227 parser.add_argument(
228 "-v", "--verbose",
229 action="count",
230 default=0,
231 dest="verbosity",
232 help=("Give more output. Option is additive, and can be used up to 3 "
233 "times."),
234 )
235 parser.add_argument(
236 "-U", "--upgrade",
237 action="store_true",
238 default=False,
239 help="Upgrade pip and dependencies, even if already installed.",
240 )
241 parser.add_argument(
242 "--user",
243 action="store_true",
244 default=False,
245 help="Install using the user scheme.",
246 )
247 parser.add_argument(
248 "--root",
249 default=None,
250 help="Install everything relative to this alternate root directory.",
251 )
252 parser.add_argument(
253 "--altinstall",
254 action="store_true",
255 default=False,
256 help=("Make an alternate install, installing only the X.Y versioned "
257 "scripts (Default: pipX, pipX.Y)."),
258 )
259 parser.add_argument(
260 "--default-pip",
261 action="store_true",
262 default=False,
263 help=("Make a default pip install, installing the unqualified pip "
264 "in addition to the versioned scripts."),
265 )
266
267 args = parser.parse_args(argv)
268
269 return _bootstrap(
270 root=args.root,
271 upgrade=args.upgrade,
272 user=args.user,
273 verbosity=args.verbosity,
274 altinstall=args.altinstall,
275 default_pip=args.default_pip,

Callers

nothing calls this directly

Calls 5

parse_argsMethod · 0.95
_bootstrapFunction · 0.85
versionFunction · 0.70
add_argumentMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…