Skip to content

Deprecate the setup.py bdist_wheel code path #13319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions news/13319.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Deprecate the legacy ``setup.py bdist_wheel`` mechanism. To silence the warning,
and future-proof their setup, users should enable ``--use-pep517`` or add a
``pyproject.toml`` file to the projects they control.
16 changes: 16 additions & 0 deletions src/pip/_internal/operations/build/wheel_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import List, Optional

from pip._internal.cli.spinners import open_spinner
from pip._internal.utils.deprecation import deprecated
from pip._internal.utils.setuptools_build import make_setuptools_bdist_wheel_args
from pip._internal.utils.subprocess import call_subprocess, format_command_args

Expand Down Expand Up @@ -68,6 +69,21 @@ def build_wheel_legacy(

Returns path to wheel if successfully built. Otherwise, returns None.
"""
deprecated(
reason=(
f"Building {name!r} using the legacy setup.py bdist_wheel mechanism, "
"which will be removed in a future version."
),
replacement=(
"to use the standardized build interface by "
"setting the `--use-pep517` option, "
"(possibly combined with `--no-build-isolation`), "
f"or adding a `pyproject.toml` file to the source tree of {name!r}"
),
gone_in="25.3",
issue=6334,
)

wheel_args = make_setuptools_bdist_wheel_args(
setup_py_path,
global_options=global_options,
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ def check_legacy_setup_py_options(
reason="--build-option and --global-option are deprecated.",
issue=11859,
replacement="to use --config-settings",
gone_in=None,
gone_in="25.3",
)
logger.warning(
"Implying --no-binary=:all: due to the presence of "
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/test_install_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def test_find_links_no_doctype(script: PipTestEnvironment, data: TestData) -> No
result = script.pip(
"install",
"simple==1.0",
"--use-pep517",
"--no-build-isolation",
"--no-index",
"--find-links",
script.scratch_path,
Expand Down