Skip to content

Commit 47eb5c4

Browse files
committed
setup.py: Build concurrently by default
Because why not? It will be faster - on my machine ~4x faster.
1 parent 4645c4b commit 47eb5c4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docs/installation.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ threads used to build the driver and any C extensions:
7676
$ # installing from pip
7777
$ CASS_DRIVER_BUILD_CONCURRENCY=8 pip install scylla-driver
7878
79+
Note that by default (when CASS_DRIVER_BUILD_CONCURRENCY is not specified), concurrency will be equal to the number of
80+
logical cores on your machine.
81+
7982
OSX Installation Error
8083
^^^^^^^^^^^^^^^^^^^^^^
8184
If you're installing on OSX and have XCode 5.1 installed, you may see an error like this::

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ def eval_env_var_as_array(varname):
206206
sys.argv = [a for a in sys.argv if a not in ("--no-murmur3", "--no-libev", "--no-cython", "--no-extensions")]
207207

208208
build_concurrency = int(os.environ.get('CASS_DRIVER_BUILD_CONCURRENCY', '0'))
209+
if build_concurrency == 0:
210+
build_concurrency = None
211+
209212
CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST = bool(os.environ.get('CASS_DRIVER_BUILD_EXTENSIONS_ARE_MUST', 'no') == 'yes')
210213

211214
class NoPatchExtension(Extension):
@@ -292,7 +295,7 @@ def run(self):
292295

293296

294297
def build_extensions(self):
295-
if build_concurrency > 1:
298+
if build_concurrency is None or build_concurrency > 1:
296299
self.check_extensions_list(self.extensions)
297300

298301
import multiprocessing.pool
@@ -431,7 +434,6 @@ def run_setup(extensions):
431434

432435
setup(**kw)
433436

434-
435437
run_setup(None)
436438

437439
if has_cqlengine:

0 commit comments

Comments
 (0)