mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 16:52:29 +03:00
Use "parallel" config setting and 4 as defaults
This commit is contained in:
parent
a549c5528a
commit
ecd264fffc
18
setup.py
18
setup.py
|
@ -21,7 +21,15 @@ from pybind11.setup_helpers import ParallelCompile
|
|||
from setuptools import Extension, setup
|
||||
from setuptools.command.build_ext import build_ext
|
||||
|
||||
ParallelCompile("MAX_CONCURRENCY").install()
|
||||
configuration: dict[str, list[str]] = {}
|
||||
|
||||
# parse configuration from _custom_build/backend.py
|
||||
while sys.argv[-1].startswith("--pillow-configuration="):
|
||||
_, key, value = sys.argv.pop().split("=", 2)
|
||||
configuration.setdefault(key, []).append(value)
|
||||
|
||||
default = int(configuration.get("parallel", ["4"])[-1])
|
||||
ParallelCompile("MAX_CONCURRENCY", default).install()
|
||||
|
||||
|
||||
def get_version() -> str:
|
||||
|
@ -30,9 +38,6 @@ def get_version() -> str:
|
|||
return f.read().split('"')[1]
|
||||
|
||||
|
||||
configuration: dict[str, list[str]] = {}
|
||||
|
||||
|
||||
PILLOW_VERSION = get_version()
|
||||
AVIF_ROOT = None
|
||||
FREETYPE_ROOT = None
|
||||
|
@ -1047,11 +1052,6 @@ ext_modules = [
|
|||
]
|
||||
|
||||
|
||||
# parse configuration from _custom_build/backend.py
|
||||
while sys.argv[-1].startswith("--pillow-configuration="):
|
||||
_, key, value = sys.argv.pop().split("=", 2)
|
||||
configuration.setdefault(key, []).append(value)
|
||||
|
||||
try:
|
||||
setup(
|
||||
cmdclass={"build_ext": pil_build_ext},
|
||||
|
|
Loading…
Reference in New Issue
Block a user