Skip to content

Commit 18cb2c1

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]]. This patch removes `wheel` from said `requires` list fallback. [1]: https://github.com/pypa/setuptools/blob/v40.8.0/setuptools/build_meta.py#L130 [2]: pypa/setuptools#3056
1 parent ee4a880 commit 18cb2c1

File tree

8 files changed

+20
-11
lines changed

8 files changed

+20
-11
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Changelog
33
+++++++++
44

5+
6+
next release
7+
============
8+
9+
- Stopped injecting ``wheel`` as a build dependency automatically, in the
10+
case of missing ``pyproject.toml`` -- by :user:`webknjaz`.
11+
(:pr:`716`)
12+
13+
514
1.0.3 (2023-09-06)
615
==================
716

src/build/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
_DEFAULT_BACKEND = {
5151
'build-backend': 'setuptools.build_meta:__legacy__',
52-
'requires': ['setuptools >= 40.8.0', 'wheel'],
52+
'requires': ['setuptools >= 40.8.0'],
5353
}
5454

5555

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ['setuptools >= 42.0.0', 'wheel >= 0.36.0', 'this is invalid']
2+
requires = ['setuptools >= 42.0.0', 'this is invalid']
33
build-backend = 'setuptools.build_meta'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[build-system]
22
build-backend = 'backend_no_prepare'
33
backend-path = ['.']
4-
requires = ['setuptools >= 42.0.0', 'wheel >= 0.36.0']
4+
requires = ['setuptools >= 42.0.0']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ['setuptools >= 42.0.0', 'wheel >= 0.36.0']
2+
requires = ['setuptools >= 42.0.0']
33
build-backend = 'setuptools.build_meta'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build_sytem]
2-
requires = ['setuptools >= 40.8.0', 'wheel']
2+
requires = ['setuptools >= 40.8.0']
33
build-backend = 'setuptools.build_meta'

tests/test_main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
230230
[],
231231
[
232232
'* Creating venv isolated environment...',
233-
'* Installing packages in isolated environment... (setuptools >= 42.0.0, wheel >= 0.36.0)',
233+
'* Installing packages in isolated environment... (setuptools >= 42.0.0)',
234234
'* Getting build dependencies for sdist...',
235235
'* Building sdist...',
236236
'* Building wheel from sdist',
237237
'* Creating venv isolated environment...',
238-
'* Installing packages in isolated environment... (setuptools >= 42.0.0, wheel >= 0.36.0)',
238+
'* Installing packages in isolated environment... (setuptools >= 42.0.0)',
239239
'* Getting build dependencies for wheel...',
240240
'* Installing packages in isolated environment... (wheel)',
241241
'* Building wheel...',
@@ -260,7 +260,7 @@ def test_build_package_via_sdist_invalid_distribution(tmp_dir, package_test_setu
260260
['--wheel'],
261261
[
262262
'* Creating venv isolated environment...',
263-
'* Installing packages in isolated environment... (setuptools >= 42.0.0, wheel >= 0.36.0)',
263+
'* Installing packages in isolated environment... (setuptools >= 42.0.0)',
264264
'* Getting build dependencies for wheel...',
265265
'* Installing packages in isolated environment... (wheel)',
266266
'* Building wheel...',
@@ -324,7 +324,7 @@ def main_reload_styles():
324324
'ERROR ',
325325
[
326326
'* Creating venv isolated environment...',
327-
'* Installing packages in isolated environment... (setuptools >= 42.0.0, this is invalid, wheel >= 0.36.0)',
327+
'* Installing packages in isolated environment... (setuptools >= 42.0.0, this is invalid)',
328328
'',
329329
'Traceback (most recent call last):',
330330
],
@@ -335,7 +335,7 @@ def main_reload_styles():
335335
[
336336
'\33[1m* Creating venv isolated environment...\33[0m',
337337
'\33[1m* Installing packages in isolated environment... '
338-
'(setuptools >= 42.0.0, this is invalid, wheel >= 0.36.0)\33[0m',
338+
'(setuptools >= 42.0.0, this is invalid)\33[0m',
339339
'',
340340
'\33[2mTraceback (most recent call last):',
341341
],

tests/test_projectbuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
DEFAULT_BACKEND = {
2323
'build-backend': 'setuptools.build_meta:__legacy__',
24-
'requires': ['setuptools >= 40.8.0', 'wheel'],
24+
'requires': ['setuptools >= 40.8.0'],
2525
}
2626

2727

0 commit comments

Comments
 (0)