Skip to content

Commit

Permalink
Reinstate and simplify parallel auto-detection
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Oct 7, 2019
1 parent 19ce978 commit 8280943
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup.py
Expand Up @@ -326,6 +326,15 @@ def finalize_options(self):
if self.debug:
global DEBUG
DEBUG = True
if not self.parallel:
# If --parallel (or -j) wasn't specified, we want to reproduce the same
# behavior as before, that is, auto-detect the number of jobs.
try:
self.parallel = int(
os.environ.get("MAX_CONCURRENCY", min(4, os.cpu_count()))
)
except TypeError:
self.parallel = None
for x in self.feature:
if getattr(self, "disable_%s" % x):
setattr(self.feature, x, False)
Expand Down

0 comments on commit 8280943

Please sign in to comment.