Skip to content

The agent that grows with you

fix(packaging): include wheel in PEP 517 build-system requires

Olympusbuildza300a7fa79e6
diff --git a/pyproject.toml b/pyproject.toml
index a3f22c96389..2ad3dbd62b1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -381,7 +381,11 @@ all = [
]
[build-system]
-requires = ["setuptools==83.0.0"]
+# setuptools.build_meta + our setup.py bdist_wheel guard import wheel during
+# PEP 517 isolated builds (uv sync / uv pip install -e .). Without wheel in
+# requires, the isolation sandbox only gets setuptools and Windows installer
+# fails with ModuleNotFoundError: wheel.cli (#96488).
+requires = ["setuptools==83.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[project.scripts]
@@ -419,7 +423,7 @@ exclude-newer = "14 days"
# risk — their newest releases are years old — and unbricks resolvers that
# cannot see upload dates.
#
-# setuptools, pillow, mcp: exact-pinned bricks (#78227, #75992, #76020). uv
+# setuptools, wheel, pillow, mcp: build/core pin bricks (#78227, #75992, #76020, #96488). uv
# applies exclude-newer to build-system.requires and core deps too; when a
# resolver cannot see an upload date (old uv, mirror index, stale HTTP cache)
# it filters the pinned version and the package cannot even BUILD
@@ -433,7 +437,7 @@ exclude-newer = "14 days"
# firecrawl-anydoc: same exact-pin shape (==0.2.4, hosted-OCR wiring PR).
# The pin bump WAS the review; exclude-newer adds zero float protection to
# an exact pin and would only delay the reviewed version 14 days.
-exclude-newer-package = { vercel = false, nemo-relay = false, huggingface_hub = false, h2 = false, aiohttp = false, cryptography = false, defusedxml = false, python-olm = false, unpaddedbase64 = false, setuptools = false, pillow = false, mcp = false, firecrawl-anydoc = false }
+exclude-newer-package = { vercel = false, nemo-relay = false, huggingface_hub = false, h2 = false, aiohttp = false, cryptography = false, defusedxml = false, python-olm = false, unpaddedbase64 = false, setuptools = false, wheel = false, pillow = false, mcp = false, firecrawl-anydoc = false }
[tool.setuptools]
# Top-level single-file modules (not packages). Without this, uv2nix's
diff --git a/tests/test_packaging_metadata.py b/tests/test_packaging_metadata.py
index 7580c91e1fc..376faf4ebc2 100644
--- a/tests/test_packaging_metadata.py
+++ b/tests/test_packaging_metadata.py
@@ -288,6 +288,28 @@ def test_build_system_requires_exempt_from_exclude_newer():
+
+def test_build_system_requires_wheel_for_isolated_builds():
+ """Regression for #96488 — PEP 517 isolation must include wheel.
+
+ ``setuptools.build_meta`` and our ``setup.py`` bdist_wheel guard import
+ ``wheel`` during editable builds. uv's build-isolation sandbox is seeded
+ only from ``[build-system].requires``; without ``wheel`` there, Windows
+ ``uv sync`` / ``uv pip install -e .`` fails with
+ ``ModuleNotFoundError: No module named 'wheel.cli'`` even when the real
+ venv already has wheel installed.
+ """
+ data = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text(encoding="utf-8"))
+ names = {
+ _distribution_name(req)
+ for req in data.get("build-system", {}).get("requires", [])
+ }
+ assert "wheel" in names, (
+ "wheel must be listed in [build-system].requires so PEP 517 isolated "
+ "builds can import wheel.cli / bdist_wheel — see #96488"
+ )
+
+
def _lazy_deps_by_feature():
"""Parse LAZY_DEPS into {feature_name: [spec, ...]} via AST.