Lines Matching +full:- +full:- +full:force
1 """Module/script to byte-compile all .py files to .pyc files.
4 given as arguments recursively; the -l option prevents it from
9 packages -- for now, you'll have to deal with packages separately.)
11 See module py_compile for details of the actual byte-compilation.
45 yield from _walk_dir(fullname, maxlevels=maxlevels - 1,
48 def compile_dir(dir, maxlevels=None, ddir=None, force=False, argument
49 rx=None, quiet=0, legacy=False, optimize=-1, workers=1,
52 """Byte-compile all modules in the given directory tree.
56 dir: the directory to byte-compile
59 file as it is compiled into each byte-code file.
60 force: if True, force compilation, even if timestamps are up-to-date
64 optimize: int or list of optimization levels or -1 for level of
68 invalidation_mode: how the up-to-dateness of the pyc will be checked
69 stripdir: part of path to left-strip from source file path
104 ddir=ddir, force=force,
117 if not compile_file(file, ddir, force, rx, quiet,
125 def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, argument
126 legacy=False, optimize=-1,
129 """Byte-compile one file.
133 fullname: the file to byte-compile
135 byte-code file.
136 force: if True, force compilation, even if timestamps are up-to-date
140 optimize: int or list of optimization levels or -1 for level of
143 invalidation_mode: how the up-to-dateness of the pyc will be checked
144 stripdir: part of path to left-strip from source file path
219 head, tail = name[:-3], name[-3:]
221 if not force:
244 previous_cfile = opt_cfiles[optimize[index - 1]]
256 # escape non-printable characters in msg
274 def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0, argument
275 legacy=False, optimize=-1,
277 """Byte-compile all module on sys.path.
283 force: as for compile_dir() (default False)
286 optimize: as for compile_dir() (default -1)
299 force,
314 parser.add_argument('-l', action='store_const', const=0,
317 parser.add_argument('-r', type=int, dest='recursion',
319 'if `-l` and `-r` options are specified, '
320 'then `-r` takes precedence.'))
321 parser.add_argument('-f', action='store_true', dest='force',
322 help='force rebuild even if timestamps are up to date')
323 parser.add_argument('-q', action='count', dest='quiet', default=0,
324 help='output only error messages; -qq will suppress '
326 parser.add_argument('-b', action='store_true', dest='legacy',
327 help='use legacy (pre-PEP3147) compiled file locations')
328 parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None,
330 'compile-time tracebacks and in runtime '
333 parser.add_argument('-s', metavar='STRIPDIR', dest='stripdir',
335 help=('part of path to left-strip from path '
336 'to source file - for example buildroot. '
337 '`-d` and `-s` options cannot be '
339 parser.add_argument('-p', metavar='PREPENDDIR', dest='prependdir',
342 'to source file - for example / to make '
344 'by `-s` option. '
345 '`-d` and `-p` options cannot be '
347 parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
351 parser.add_argument('-i', metavar='FILE', dest='flist',
354 'if "-", names are read from stdin'))
358 'to the equivalent of -l sys.path'))
359 parser.add_argument('-j', '--workers', default=1,
361 invalidation_modes = [mode.name.lower().replace('_', '-')
363 parser.add_argument('--invalidation-mode',
366 '"checked-hash" if the SOURCE_DATE_EPOCH '
369 parser.add_argument('-o', action='append', type=int, dest='opt_levels',
371 'Default is -1 which uses the optimization level '
372 'of the Python interpreter itself (see -O).'))
373 parser.add_argument('-e', metavar='DIR', dest='limit_sl_dest',
375 parser.add_argument('--hardlink-dupes', action='store_true',
395 args.opt_levels = [-1]
404 parser.error("-d cannot be used in combination with -s or -p")
409 with (sys.stdin if args.flist=='-' else
410 open(args.flist, encoding="utf-8")) as f:
419 ivl_mode = args.invalidation_mode.replace('-', '_').upper()
429 if not compile_file(dest, args.ddir, args.force, args.rx,
440 args.force, args.rx, args.quiet,
451 return compile_path(legacy=args.legacy, force=args.force,