Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13983)

Delta Between Two Patch Sets: Doc/library/compileall.rst

Issue 16104: Use multiprocessing in compileall script
Left Patch Set: Created 5 years, 4 months ago
Right Patch Set: Created 5 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Lib/compileall.py » ('j') | Lib/compileall.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 :mod:`compileall` --- Byte-compile Python libraries 1 :mod:`compileall` --- Byte-compile Python libraries
2 =================================================== 2 ===================================================
3 3
4 .. module:: compileall 4 .. module:: compileall
5 :synopsis: Tools for byte-compiling all Python source files in a directory tr ee. 5 :synopsis: Tools for byte-compiling all Python source files in a directory tr ee.
6 6
7 7
8 This module provides some utility functions to support installing Python 8 This module provides some utility functions to support installing Python
9 libraries. These functions compile Python source files in a directory tree. 9 libraries. These functions compile Python source files in a directory tree.
10 This module can be used to create the cached byte-code files at library 10 This module can be used to create the cached byte-code files at library
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 files and directories to compile. If ``list`` is ``-``, read lines from 59 files and directories to compile. If ``list`` is ``-``, read lines from
60 ``stdin``. 60 ``stdin``.
61 61
62 .. cmdoption:: -b 62 .. cmdoption:: -b
63 63
64 Write the byte-code files to their legacy locations and names, which may 64 Write the byte-code files to their legacy locations and names, which may
65 overwrite byte-code files created by another version of Python. The default 65 overwrite byte-code files created by another version of Python. The default
66 is to write files to their :pep:`3147` locations and names, which allows 66 is to write files to their :pep:`3147` locations and names, which allows
67 byte-code files from multiple versions of Python to coexist. 67 byte-code files from multiple versions of Python to coexist.
68 68
69 .. cmdoption:: -r
70
71 Control the maximum recursion level for subdirectories.
72 If this is given, then ``-l`` option will not be taken into account.
73 :program:`python -m compileall <directory> -r 0` is equivalent to
74 :program:`python -m compileall <directory> -l`.
75
69 .. cmdoption:: -j N 76 .. cmdoption:: -j N
70 77
71 Use *N* workers to compile the files within the given directory. 78 Use *N* workers to compile the files within the given directory.
72 If ``0`` is used, then the result of :func:`os.cpu_count()` 79 If ``0`` is used, then the result of :func:`os.cpu_count()`
73 will be used. 80 will be used.
74 81
75 .. versionchanged:: 3.2 82 .. versionchanged:: 3.2
76 Added the ``-i``, ``-b`` and ``-h`` options. 83 Added the ``-i``, ``-b`` and ``-h`` options.
77 84
78 .. versionchanged:: 3.5 85 .. versionchanged:: 3.5
79 Added the ``-j`` option. 86 Added the ``-j`` and ``-r`` options.
87
80 88
81 There is no command-line option to control the optimization level used by the 89 There is no command-line option to control the optimization level used by the
82 :func:`compile` function, because the Python interpreter itself already 90 :func:`compile` function, because the Python interpreter itself already
83 provides the option: :program:`python -O -m compileall`. 91 provides the option: :program:`python -O -m compileall`.
84 92
85 Public functions 93 Public functions
86 ---------------- 94 ----------------
87 95
88 .. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, qu iet=False, legacy=False, optimize=-1, workers=1) 96 .. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, qu iet=False, legacy=False, optimize=-1, workers=1)
89 97
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 189
182 # Perform same compilation, excluding files in .svn directories. 190 # Perform same compilation, excluding files in .svn directories.
183 import re 191 import re
184 compileall.compile_dir('Lib/', rx=re.compile(r'[/\\][.]svn'), force=True) 192 compileall.compile_dir('Lib/', rx=re.compile(r'[/\\][.]svn'), force=True)
185 193
186 194
187 .. seealso:: 195 .. seealso::
188 196
189 Module :mod:`py_compile` 197 Module :mod:`py_compile`
190 Byte-compile a single source file. 198 Byte-compile a single source file.
LEFTRIGHT
« no previous file | Lib/compileall.py » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+