Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
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:
Expand All @@ -31,9 +39,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
Expand Down Expand Up @@ -1052,11 +1057,6 @@ def debug_build() -> bool:
]


# 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},
Expand Down
Loading