mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-12 01:02:39 +03:00
Add parallel compile from pybind11
This commit is contained in:
parent
d730e60078
commit
2059e06005
|
@ -1,6 +1,7 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
build-backend = "backend"
|
build-backend = "backend"
|
||||||
requires = [
|
requires = [
|
||||||
|
"pybind11",
|
||||||
"setuptools>=77",
|
"setuptools>=77",
|
||||||
]
|
]
|
||||||
backend-path = [
|
backend-path = [
|
||||||
|
|
5
setup.py
5
setup.py
|
@ -18,9 +18,12 @@ import warnings
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from pybind11.setup_helpers import ParallelCompile
|
||||||
from setuptools import Extension, setup
|
from setuptools import Extension, setup
|
||||||
from setuptools.command.build_ext import build_ext
|
from setuptools.command.build_ext import build_ext
|
||||||
|
|
||||||
|
ParallelCompile("MAX_CONCURRENCY", default=0).install()
|
||||||
|
|
||||||
|
|
||||||
def get_version() -> str:
|
def get_version() -> str:
|
||||||
version_file = "src/PIL/_version.py"
|
version_file = "src/PIL/_version.py"
|
||||||
|
@ -1048,12 +1051,12 @@ ext_modules = [
|
||||||
Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]),
|
Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# parse configuration from _custom_build/backend.py
|
# parse configuration from _custom_build/backend.py
|
||||||
while sys.argv[-1].startswith("--pillow-configuration="):
|
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)
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
setup(
|
setup(
|
||||||
cmdclass={"build_ext": pil_build_ext},
|
cmdclass={"build_ext": pil_build_ext},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user