forked from python-pillow/Pillow
-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Description
Summary
Please add first-class PEP 517 build support so pillow-simd builds cleanly in isolated environments (pip/Poetry) on Python 3.12+. The current sdist path relies on legacy setuptools behavior that imports distutils, which is removed in Python 3.12, causing builds to fail. Repo reference: https://github.com/uploadcare/pillow-simd
Environment
- Python: 3.12.x
- OS: Ubuntu 20.04 (glibc ~2.31)
- pip: 25.2
- Build mode: PEP 517 isolated (default for pip/Poetry)
Repro
- Any clean environment where only an sdist is available (no cp312 wheel):
Commands:
python -m venv .venv && . .venv/bin/activate
pip install --upgrade pip
pip wheel --no-cache-dir --use-pep517 "pillow-simd==9.5.0.post2"Error (excerpt):
Backend 'setuptools.build_meta:__legacy__' is not available
ModuleNotFoundError: No module named 'distutils'
Expected
pip install pillow-simdsucceeds under PEP 517 isolated builds on Python 3.12+.- sdist contains metadata and build hooks sufficient to compile C extensions without legacy distutils paths.
Actual
- sdist build falls back to legacy setuptools backend that imports distutils, which is not present in Python 3.12, causing the build to fail.
Why this matters
- Modern Python packaging defaults to PEP 517 isolated builds.
- Many users consume
pillow-simdvia Poetry/pip in containers/CI where prebuilt wheels may not be available; they need a reliable sdist path.
Proposed changes
- Add a
pyproject.tomlthat declares a modern backend and build requirements.
Minimal example:
[build-system]
requires = [
"setuptools>=70", # ensures setuptools’ vendored distutils
"wheel",
"cython>=3.0",
"numpy>=2.0",
]
build-backend = "setuptools.build_meta"
[project]
name = "Pillow-SIMD"
dynamic = ["version", "description"] # or set explicitly
requires-python = ">=3.8"
[tool.setuptools]
# if using src/ layout, otherwise omit/change
# package-dir = {"" = "src"}- Ensure
pyproject.tomlis included in the sdist. - Optionally, publish cp312 wheels for manylinux_2_17 (manylinux2014) to avoid source builds on common glibc baselines.
Workarounds (not ideal)
- Install with
--no-build-isolationandSETUPTOOLS_USE_DISTUTILS=local. - Use stock
pillowwhen wheels aren’t available.
Acceptance criteria
pip wheel --use-pep517 pillow-simd==<new-version>succeeds on Python 3.12+ in a clean venv.- Building from sdist works without relying on stdlib
distutils. - New sdist includes
pyproject.toml; wheels are built with the declared backend.
Reference: https://github.com/uploadcare/pillow-simd
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels