From 1c4f32b93570b41de3c8028711549a32e15b31f1 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 1 Oct 2017 20:19:54 +0200 Subject: Run cythonize() in parallel in "new_build_ext" if threaded distutils build was requested. --- Cython/Distutils/build_ext.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Cython/Distutils') 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. -- cgit v1.2.1