mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Issue #5309: distutils' build and build_ext commands now accept a `-j`
option to enable parallel building of extension modules.
This commit is contained in:
parent
7e23d82cec
commit
2c0a916061
6 changed files with 117 additions and 28 deletions
|
|
@ -36,6 +36,8 @@ class build(Command):
|
|||
"(default: %s)" % get_platform()),
|
||||
('compiler=', 'c',
|
||||
"specify the compiler type"),
|
||||
('parallel=', 'j',
|
||||
"number of parallel build jobs"),
|
||||
('debug', 'g',
|
||||
"compile extensions and libraries with debugging information"),
|
||||
('force', 'f',
|
||||
|
|
@ -65,6 +67,7 @@ class build(Command):
|
|||
self.debug = None
|
||||
self.force = 0
|
||||
self.executable = None
|
||||
self.parallel = None
|
||||
|
||||
def finalize_options(self):
|
||||
if self.plat_name is None:
|
||||
|
|
@ -116,6 +119,12 @@ class build(Command):
|
|||
if self.executable is None:
|
||||
self.executable = os.path.normpath(sys.executable)
|
||||
|
||||
if isinstance(self.parallel, str):
|
||||
try:
|
||||
self.parallel = int(self.parallel)
|
||||
except ValueError:
|
||||
raise DistutilsOptionError("parallel should be an integer")
|
||||
|
||||
def run(self):
|
||||
# Run all relevant sub-commands. This will be some subset of:
|
||||
# - build_py - pure Python modules
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue