From 45f5e121dacd4f78f6abc2bc12562119cb0bbdfb Mon Sep 17 00:00:00 2001 From: "Kacper Kowalik (Xarthisius)" Date: Wed, 5 Feb 2020 11:13:28 -0600 Subject: [PATCH 1/2] [setup] return 0 as number of cpus on windows to disable parallel build --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 001883db5f0..8f1122a32ed 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,8 @@ def _get_cpu_count(): if platform.system() != "Windows": return os.cpu_count() + return 0 + def _compile( self, sources, output_dir=None, macros=None, include_dirs=None, @@ -376,8 +378,9 @@ def finalize_options(self): def build_extensions(self): self.check_extensions_list(self.extensions) - if _get_cpu_count(): - with Pool(_get_cpu_count()) as pool: + ncpus = _get_cpu_count() + if ncpus > 0: + with Pool(ncpus) as pool: pool.map(self.build_extension, self.extensions) else: super().build_extensions() From d65aa2fb5120bbf1b32bdc5b80af5132cec04ef6 Mon Sep 17 00:00:00 2001 From: "Kacper Kowalik (Xarthisius)" Date: Wed, 5 Feb 2020 12:02:34 -0600 Subject: [PATCH 2/2] Drop unused import --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 8f1122a32ed..db45e97ca30 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ import os -import multiprocessing import platform from concurrent.futures import ThreadPoolExecutor as Pool import glob