Skip to content

Commit 38253a6

Browse files
authored
Merge pull request #13319 from sbidoul
Deprecate the `setup.py bdist_wheel` code path
2 parents 2791a8b + d6cb790 commit 38253a6

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

news/13319.removal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Deprecate the legacy ``setup.py bdist_wheel`` mechanism. To silence the warning,
2+
and future-proof their setup, users should enable ``--use-pep517`` or add a
3+
``pyproject.toml`` file to the projects they control.

src/pip/_internal/operations/build/wheel_legacy.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import List, Optional
44

55
from pip._internal.cli.spinners import open_spinner
6+
from pip._internal.utils.deprecation import deprecated
67
from pip._internal.utils.setuptools_build import make_setuptools_bdist_wheel_args
78
from pip._internal.utils.subprocess import call_subprocess, format_command_args
89

@@ -68,6 +69,21 @@ def build_wheel_legacy(
6869
6970
Returns path to wheel if successfully built. Otherwise, returns None.
7071
"""
72+
deprecated(
73+
reason=(
74+
f"Building {name!r} using the legacy setup.py bdist_wheel mechanism, "
75+
"which will be removed in a future version."
76+
),
77+
replacement=(
78+
"to use the standardized build interface by "
79+
"setting the `--use-pep517` option, "
80+
"(possibly combined with `--no-build-isolation`), "
81+
f"or adding a `pyproject.toml` file to the source tree of {name!r}"
82+
),
83+
gone_in="25.3",
84+
issue=6334,
85+
)
86+
7187
wheel_args = make_setuptools_bdist_wheel_args(
7288
setup_py_path,
7389
global_options=global_options,

src/pip/_internal/req/req_install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def check_legacy_setup_py_options(
925925
reason="--build-option and --global-option are deprecated.",
926926
issue=11859,
927927
replacement="to use --config-settings",
928-
gone_in=None,
928+
gone_in="25.3",
929929
)
930930
logger.warning(
931931
"Implying --no-binary=:all: due to the presence of "

tests/functional/test_install_index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def test_find_links_no_doctype(script: PipTestEnvironment, data: TestData) -> No
2727
result = script.pip(
2828
"install",
2929
"simple==1.0",
30+
"--use-pep517",
31+
"--no-build-isolation",
3032
"--no-index",
3133
"--find-links",
3234
script.scratch_path,

0 commit comments

Comments
 (0)