Skip to content

Request: Provide support for PEP517 builds #154

@DHolmanCoding

Description

@DHolmanCoding

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-simd succeeds 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-simd via Poetry/pip in containers/CI where prebuilt wheels may not be available; they need a reliable sdist path.

Proposed changes

  • Add a pyproject.toml that 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.toml is 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-isolation and SETUPTOOLS_USE_DISTUTILS=local.
  • Use stock pillow when 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions