Skip to content

Commit 2059e06

Browse files
committed
Add parallel compile from pybind11
1 parent d730e60 commit 2059e06

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build-system]
22
build-backend = "backend"
33
requires = [
4+
"pybind11",
45
"setuptools>=77",
56
]
67
backend-path = [

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
from collections.abc import Iterator
1919
from typing import Any
2020

21+
from pybind11.setup_helpers import ParallelCompile
2122
from setuptools import Extension, setup
2223
from setuptools.command.build_ext import build_ext
2324

25+
ParallelCompile("MAX_CONCURRENCY", default=0).install()
26+
2427

2528
def get_version() -> str:
2629
version_file = "src/PIL/_version.py"
@@ -1048,12 +1051,12 @@ def debug_build() -> bool:
10481051
Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]),
10491052
]
10501053

1051-
10521054
# parse configuration from _custom_build/backend.py
10531055
while sys.argv[-1].startswith("--pillow-configuration="):
10541056
_, key, value = sys.argv.pop().split("=", 2)
10551057
configuration.setdefault(key, []).append(value)
10561058

1059+
10571060
try:
10581061
setup(
10591062
cmdclass={"build_ext": pil_build_ext},

0 commit comments

Comments
 (0)