Skip to content

Commit ecd264f

Browse files
committed
Use "parallel" config setting and 4 as defaults
1 parent a549c55 commit ecd264f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121
from setuptools import Extension, setup
2222
from setuptools.command.build_ext import build_ext
2323

24-
ParallelCompile("MAX_CONCURRENCY").install()
24+
configuration: dict[str, list[str]] = {}
25+
26+
# parse configuration from _custom_build/backend.py
27+
while sys.argv[-1].startswith("--pillow-configuration="):
28+
_, key, value = sys.argv.pop().split("=", 2)
29+
configuration.setdefault(key, []).append(value)
30+
31+
default = int(configuration.get("parallel", ["4"])[-1])
32+
ParallelCompile("MAX_CONCURRENCY", default).install()
2533

2634

2735
def get_version() -> str:
@@ -30,9 +38,6 @@ def get_version() -> str:
3038
return f.read().split('"')[1]
3139

3240

33-
configuration: dict[str, list[str]] = {}
34-
35-
3641
PILLOW_VERSION = get_version()
3742
AVIF_ROOT = None
3843
FREETYPE_ROOT = None
@@ -1047,11 +1052,6 @@ def debug_build() -> bool:
10471052
]
10481053

10491054

1050-
# parse configuration from _custom_build/backend.py
1051-
while sys.argv[-1].startswith("--pillow-configuration="):
1052-
_, key, value = sys.argv.pop().split("=", 2)
1053-
configuration.setdefault(key, []).append(value)
1054-
10551055
try:
10561056
setup(
10571057
cmdclass={"build_ext": pil_build_ext},

0 commit comments

Comments
 (0)