mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 08:42:35 +03:00
Removed default limit of 4
This commit is contained in:
parent
ecd264fffc
commit
23ed906b62
|
@ -276,10 +276,9 @@ Build options
|
||||||
|
|
||||||
* Config setting: ``-C parallel=n``. Can also be given
|
* Config setting: ``-C parallel=n``. Can also be given
|
||||||
with environment variable: ``MAX_CONCURRENCY=n``. Pillow can use
|
with environment variable: ``MAX_CONCURRENCY=n``. Pillow can use
|
||||||
multiprocessing to build the extension. Setting ``-C parallel=n``
|
multiprocessing to build the extensions. Setting ``-C parallel=n``
|
||||||
sets the number of CPUs to use to ``n``, or can disable parallel building by
|
sets the number of CPUs to use to ``n``, or can disable parallel building by
|
||||||
using a setting of 1. By default, it uses 4 CPUs, or if 4 are not
|
using a setting of 1. By default, it uses as many CPUs as are present.
|
||||||
available, as many as are present.
|
|
||||||
|
|
||||||
* Config settings: ``-C zlib=disable``, ``-C jpeg=disable``,
|
* Config settings: ``-C zlib=disable``, ``-C jpeg=disable``,
|
||||||
``-C tiff=disable``, ``-C freetype=disable``, ``-C raqm=disable``,
|
``-C tiff=disable``, ``-C freetype=disable``, ``-C raqm=disable``,
|
||||||
|
|
6
setup.py
6
setup.py
|
@ -28,7 +28,7 @@ while sys.argv[-1].startswith("--pillow-configuration="):
|
||||||
_, key, value = sys.argv.pop().split("=", 2)
|
_, key, value = sys.argv.pop().split("=", 2)
|
||||||
configuration.setdefault(key, []).append(value)
|
configuration.setdefault(key, []).append(value)
|
||||||
|
|
||||||
default = int(configuration.get("parallel", ["4"])[-1])
|
default = int(configuration.get("parallel", ["0"])[-1])
|
||||||
ParallelCompile("MAX_CONCURRENCY", default).install()
|
ParallelCompile("MAX_CONCURRENCY", default).install()
|
||||||
|
|
||||||
|
|
||||||
|
@ -394,9 +394,7 @@ class pil_build_ext(build_ext):
|
||||||
cpu_count = os.cpu_count()
|
cpu_count = os.cpu_count()
|
||||||
if cpu_count is not None:
|
if cpu_count is not None:
|
||||||
try:
|
try:
|
||||||
self.parallel = int(
|
self.parallel = int(os.environ.get("MAX_CONCURRENCY", cpu_count))
|
||||||
os.environ.get("MAX_CONCURRENCY", min(4, cpu_count))
|
|
||||||
)
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
pass
|
pass
|
||||||
for x in self.feature:
|
for x in self.feature:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user