From bc98892d0bac171f76da0a2e8103ca84e772ed91 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sat, 18 Sep 2021 10:13:41 +0100 Subject: [PATCH 1/2] Drop --build-dir from the CLI This was restored as a no-op for PyCharm, as a way to soften the migration for them. It is no longer necessary, since the migration has completed. --- src/pip/_internal/cli/base_command.py | 15 ------------- src/pip/_internal/cli/cmdoptions.py | 12 ----------- src/pip/_internal/commands/download.py | 1 - src/pip/_internal/commands/install.py | 2 -- src/pip/_internal/commands/wheel.py | 1 - tests/functional/test_wheel.py | 30 -------------------------- 6 files changed, 61 deletions(-) diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index 5932eedc2e9..0afe7e75d46 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -27,7 +27,6 @@ PreviousBuildDirError, UninstallationError, ) -from pip._internal.utils.deprecation import deprecated from pip._internal.utils.filesystem import check_path_owner from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging from pip._internal.utils.misc import get_prog, normalize_path @@ -149,20 +148,6 @@ def _main(self, args: List[str]) -> int: ) options.cache_dir = None - if getattr(options, "build_dir", None): - deprecated( - reason=( - "The -b/--build/--build-dir/--build-directory " - "option is deprecated and has no effect anymore." - ), - replacement=( - "use the TMPDIR/TEMP/TMP environment variable, " - "possibly combined with --no-clean" - ), - gone_in="21.3", - issue=8333, - ) - if "2020-resolver" in options.features_enabled: logger.warning( "--use-feature=2020-resolver no longer has any effect, " diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index c15c68b6de4..626fd00427c 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -731,18 +731,6 @@ def _handle_no_cache_dir( help="Don't install package dependencies.", ) -build_dir: Callable[..., Option] = partial( - PipOption, - "-b", - "--build", - "--build-dir", - "--build-directory", - dest="build_dir", - type="path", - metavar="dir", - help=SUPPRESS_HELP, -) - ignore_requires_python: Callable[..., Option] = partial( Option, "--ignore-requires-python", diff --git a/src/pip/_internal/commands/download.py b/src/pip/_internal/commands/download.py index 2f6aac29e83..7de207f1365 100644 --- a/src/pip/_internal/commands/download.py +++ b/src/pip/_internal/commands/download.py @@ -37,7 +37,6 @@ class DownloadCommand(RequirementCommand): def add_options(self) -> None: self.cmd_opts.add_option(cmdoptions.constraints()) self.cmd_opts.add_option(cmdoptions.requirements()) - self.cmd_opts.add_option(cmdoptions.build_dir()) self.cmd_opts.add_option(cmdoptions.no_deps()) self.cmd_opts.add_option(cmdoptions.global_options()) self.cmd_opts.add_option(cmdoptions.no_binary()) diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py index 3d87e1af12d..eedb1ff5d64 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -135,8 +135,6 @@ def add_options(self) -> None: ), ) - self.cmd_opts.add_option(cmdoptions.build_dir()) - self.cmd_opts.add_option(cmdoptions.src()) self.cmd_opts.add_option( diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py index 1fb5007a705..cea81ee5195 100644 --- a/src/pip/_internal/commands/wheel.py +++ b/src/pip/_internal/commands/wheel.py @@ -65,7 +65,6 @@ def add_options(self) -> None: self.cmd_opts.add_option(cmdoptions.src()) self.cmd_opts.add_option(cmdoptions.ignore_requires_python()) self.cmd_opts.add_option(cmdoptions.no_deps()) - self.cmd_opts.add_option(cmdoptions.build_dir()) self.cmd_opts.add_option(cmdoptions.progress_bar()) self.cmd_opts.add_option( diff --git a/tests/functional/test_wheel.py b/tests/functional/test_wheel.py index 17d94e85314..eec50765a40 100644 --- a/tests/functional/test_wheel.py +++ b/tests/functional/test_wheel.py @@ -2,7 +2,6 @@ import os import re import sys -from os.path import exists import pytest @@ -240,35 +239,6 @@ def test_pip_wheel_fail(script, data): assert result.returncode != 0 -def test_no_clean_option_blocks_cleaning_after_wheel( - script, - data, - resolver_variant, -): - """ - Test --no-clean option blocks cleaning after wheel build - """ - build = script.venv_path / "build" - result = script.pip( - "wheel", - "--no-clean", - "--no-index", - "--build", - build, - f"--find-links={data.find_links}", - "simple", - expect_temp=True, - # TODO: allow_stderr_warning is used for the --build deprecation, - # remove it when removing support for --build - allow_stderr_warning=True, - ) - - if resolver_variant == "legacy": - build = build / "simple" - message = f"build/simple should still exist {result}" - assert exists(build), message - - def test_pip_wheel_source_deps(script, data): """ Test 'pip wheel' finds and builds source archive dependencies From 62ead586652f8b19bb26141ca504629b7a42f889 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Mon, 4 Oct 2021 23:13:50 +0100 Subject: [PATCH 2/2] :newspaper: --- news/10485.removal.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/10485.removal.rst diff --git a/news/10485.removal.rst b/news/10485.removal.rst new file mode 100644 index 00000000000..0de88795027 --- /dev/null +++ b/news/10485.removal.rst @@ -0,0 +1 @@ +Remove the ``--build-dir`` option and aliases, one last time.