1 diff --git a/setup.py b/setup.py
2 index 0c8d8f16..565ef8ef 100644
5 @@ -172,21 +172,7 @@ class CMakeBuild(build_ext):
6 subprocess.check_call(cmake_build, cwd=build_folder)
8 def num_available_cpu_cores(ram_per_build_process_in_gb):
9 - if 'TRAVIS' in os.environ and os.environ['TRAVIS']=='true':
10 - # When building on travis-ci, just use 2 cores since travis-ci limits
11 - # you to that regardless of what the hardware might suggest.
14 - mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
15 - mem_gib = mem_bytes/(1024.**3)
16 - num_cores = multiprocessing.cpu_count()
17 - # make sure we have enough ram for each build process.
18 - mem_cores = int(floor(mem_gib/float(ram_per_build_process_in_gb)+0.5));
19 - # We are limited either by RAM or CPU cores. So pick the limiting amount
21 - return max(min(num_cores, mem_cores), 1)
23 - return 2 # just assume 2 if we can't get the os to tell us the right answer.
24 + return os.getenv("NIX_BUILD_CORES", 1)
27 from setuptools.command.test import test as TestCommand