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

Function main

Lib/compileall.py:323–475  ·  view source on GitHub ↗

Script main program.

()

Source from the content-addressed store, hash-verified

321
322
323def main():
324 """Script main program."""
325 import argparse
326
327 parser = argparse.ArgumentParser(
328 description='Utilities to support installing Python libraries.',
329 color=True,
330 )
331 parser.add_argument('-l', action='store_const', const=0,
332 default=None, dest='maxlevels',
333 help="don't recurse into subdirectories")
334 parser.add_argument('-r', type=int, dest='recursion',
335 help=('control the maximum recursion level. '
336 'if `-l` and `-r` options are specified, '
337 'then `-r` takes precedence.'))
338 parser.add_argument('-f', action='store_true', dest='force',
339 help='force rebuild even if timestamps are up to date')
340 parser.add_argument('-q', action='count', dest='quiet', default=0,
341 help='output only error messages; -qq will suppress '
342 'the error messages as well.')
343 parser.add_argument('-b', action='store_true', dest='legacy',
344 help='use legacy (pre-PEP3147) compiled file locations')
345 parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
346 help=('directory to prepend to file paths for use in '
347 'compile-time tracebacks and in runtime '
348 'tracebacks in cases where the source file is '
349 'unavailable'))
350 parser.add_argument('-s', metavar='STRIPDIR', dest='stripdir',
351 default=None,
352 help=('part of path to left-strip from path '
353 'to source file - for example buildroot. '
354 '`-d` and `-s` options cannot be '
355 'specified together.'))
356 parser.add_argument('-p', metavar='PREPENDDIR', dest='prependdir',
357 default=None,
358 help=('path to add as prefix to path '
359 'to source file - for example / to make '
360 'it absolute when some part is removed '
361 'by `-s` option. '
362 '`-d` and `-p` options cannot be '
363 'specified together.'))
364 parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
365 help=('skip files matching the regular expression; '
366 'the regexp is searched for in the full path '
367 'of each file considered for compilation'))
368 parser.add_argument('-i', metavar='FILE', dest='flist',
369 help=('add all the files and directories listed in '
370 'FILE to the list considered for compilation; '
371 'if "-", names are read from stdin'))
372 parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
373 help=('zero or more file and directory names '
374 'to compile; if no arguments given, defaults '
375 'to the equivalent of -l sys.path'))
376 parser.add_argument('-j', '--workers', default=1,
377 type=int, help='Run compileall concurrently')
378 invalidation_modes = [mode.name.lower().replace('_', '-')
379 for mode in py_compile.PycInvalidationMode]
380 parser.add_argument('--invalidation-mode',

Callers 1

compileall.pyFile · 0.70

Calls 15

parse_argsMethod · 0.95
errorMethod · 0.95
compile_fileFunction · 0.85
compile_dirFunction · 0.85
compile_pathFunction · 0.85
openFunction · 0.70
add_argumentMethod · 0.45
replaceMethod · 0.45
lowerMethod · 0.45
compileMethod · 0.45
appendMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…