summaryrefslogtreecommitdiff
path: root/Cython/Distutils
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2017-10-01 20:19:54 +0200
committerStefan Behnel <stefan_ml@behnel.de>2017-10-01 20:19:54 +0200
commit1c4f32b93570b41de3c8028711549a32e15b31f1 (patch)
tree6b494bc2d0fad38e1f18baf20f3c3b16f3aa7eec /Cython/Distutils
parent14058944830295f3b5522dd8a29f32cfd3aaa5a8 (diff)
downloadcython-1c4f32b93570b41de3c8028711549a32e15b31f1.tar.gz
Run cythonize() in parallel in "new_build_ext" if threaded distutils build was requested.
Diffstat (limited to 'Cython/Distutils')
-rw-r--r--Cython/Distutils/build_ext.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Distutils/build_ext.py b/Cython/Distutils/build_ext.py
index 0f3ef633f..8ca29b236 100644
--- a/Cython/Distutils/build_ext.py
+++ b/Cython/Distutils/build_ext.py
@@ -14,9 +14,11 @@ else:
class new_build_ext(_build_ext, object):
def finalize_options(self):
if self.distribution.ext_modules:
+ nthreads = getattr(self, 'parallel', None) # -j option in Py3.5+
+ nthreads = int(nthreads) if nthreads else None
from Cython.Build.Dependencies import cythonize
self.distribution.ext_modules[:] = cythonize(
- self.distribution.ext_modules)
+ self.distribution.ext_modules, nthreads=nthreads)
super(new_build_ext, self).finalize_options()
# This will become new_build_ext in the future.