From 002982f6eddd6411f3009ae9a8be104393e94062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 5 Apr 2025 14:56:39 +0200 Subject: [PATCH 1/3] Deprecate using setup.py bdist_wheel --- news/13319.removal.rst | 3 +++ .../_internal/operations/build/wheel_legacy.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 news/13319.removal.rst diff --git a/news/13319.removal.rst b/news/13319.removal.rst new file mode 100644 index 00000000000..f5348138888 --- /dev/null +++ b/news/13319.removal.rst @@ -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. diff --git a/src/pip/_internal/operations/build/wheel_legacy.py b/src/pip/_internal/operations/build/wheel_legacy.py index 3ee2a7058d3..473018173f5 100644 --- a/src/pip/_internal/operations/build/wheel_legacy.py +++ b/src/pip/_internal/operations/build/wheel_legacy.py @@ -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 @@ -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, From 1d18b5fd1934b68600ac389bccdba6c510ee1911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 5 Apr 2025 15:17:43 +0200 Subject: [PATCH 2/3] Update tests to use pep 517 --- tests/functional/test_install_index.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functional/test_install_index.py b/tests/functional/test_install_index.py index 72b0b9db7bd..73b122a6141 100644 --- a/tests/functional/test_install_index.py +++ b/tests/functional/test_install_index.py @@ -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, From d6cb790d364769747c7f3d5147b9a7ebe01d494a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 5 Apr 2025 16:52:13 +0200 Subject: [PATCH 3/3] Signal that --build-option and --global-option will be removed at the same time as bdist_wheel --- src/pip/_internal/req/req_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py index 3262d82658e..785fa3cb6a5 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py @@ -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 "