Skip to content

Commit 6ff621b

Browse files
committed
Stop injecting wheel as a build dep fallback
PEP 517 doesn't mandate depending on `wheel` when a `__legacy__` setuptools fallback is used. Historically, it used to be assumed as necessary, but later it turned out to be wrong. The reason is that `setuptools`' `get_requires_for_build_wheel()` hook already injects this dependency when building wheels is requested [[1]]. It also used to have this hint in the docs, but it was corrected earlier [[2]]. It could be argued that this is an optimization as `pip` will request building wheels anyway. However, it also shows up in the docs, giving the readers a wrong impression of what to put into `[build-system].requires` when they start a new project using setuptools. This patch removes `wheel` from said `requires` list fallback in the docs and the actual runtime. [1]: https://github.com/pypa/setuptools/blob/v40.8.0/setuptools/build_meta.py#L130 [2]: pypa/setuptools#3056
1 parent e88d39a commit 6ff621b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docs/html/reference/build-system/pyproject-toml.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ section, it will be assumed to have the following backend settings:
135135

136136
```toml
137137
[build-system]
138-
requires = ["setuptools>=40.8.0", "wheel"]
138+
requires = ["setuptools>=40.8.0"]
139139
build-backend = "setuptools.build_meta:__legacy__"
140140
```
141141

news/12449.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Removed ``wheel`` from the ``[build-system].requires`` list fallback
2+
that is used when ``pyproject.toml`` is absent.

src/pip/_internal/pyproject.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def load_pyproject_toml(
123123
# a version of setuptools that supports that backend.
124124

125125
build_system = {
126-
"requires": ["setuptools>=40.8.0", "wheel"],
126+
"requires": ["setuptools>=40.8.0"],
127127
"build-backend": "setuptools.build_meta:__legacy__",
128128
}
129129

0 commit comments

Comments
 (0)