Skip to content

Commit 9868792

Browse files
AbhiPrasadclaude
andcommitted
fix(packaging): load the build backend from the tree
`backend-path = ["."]` with `build-backend = "setuptools.build_meta"` is rejected by pip (BackendUnavailable), because PEP 517 requires a backend named with backend-path to live in that path, breaking pip installs from a checkout, Git URL, or sdist. uv does not enforce this. Make _build_hooks the backend by re-exporting setuptools.build_meta, per setuptools' documented in-tree backend pattern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 0da5274 commit 9868792

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎py/_build_hooks.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
"""Setuptools build hooks: keep colocated tests out of the wheel."""
1+
"""In-tree PEP 517 backend: setuptools, minus colocated tests in the wheel.
2+
3+
pyproject.toml loads this module via ``backend-path``, which requires the
4+
backend itself to live in the tree, so it re-exports ``setuptools.build_meta``.
5+
"""
26

37
import fnmatch
48

9+
from setuptools.build_meta import * # noqa: F403
510
from setuptools.command.build_py import build_py as _build_py
611

712

‎py/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = ["setuptools>=82.0.1"]
3-
build-backend = "setuptools.build_meta"
3+
build-backend = "_build_hooks"
44
backend-path = ["."]
55

66
[project]

0 commit comments

Comments
 (0)