diff options
author | Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com> | 2020-12-02 00:49:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 00:49:29 +0000 |
commit | 30eeb9ceb10bf76316f091e8615a9c3d8025fff0 (patch) | |
tree | 77af013c8bf59f2accb61f50448bb23f66dbdb1b | |
parent | dce6b34abb0f283d765032434adc620a91134c88 (diff) | |
parent | 31a2e1a586d2ccfee1f30b5cebfa5acfc6197662 (diff) | |
download | pip-30eeb9ceb10bf76316f091e8615a9c3d8025fff0.tar.gz |
Merge pull request #9198 from sbidoul/restore-build-dir-sbi
Restore --build-dir, as a no-op option
-rw-r--r-- | news/9193.removal.rst | 2 | ||||
-rw-r--r-- | src/pip/_internal/cli/base_command.py | 14 | ||||
-rw-r--r-- | src/pip/_internal/cli/cmdoptions.py | 8 | ||||
-rw-r--r-- | src/pip/_internal/commands/download.py | 1 | ||||
-rw-r--r-- | src/pip/_internal/commands/install.py | 2 | ||||
-rw-r--r-- | src/pip/_internal/commands/wheel.py | 1 |
6 files changed, 28 insertions, 0 deletions
diff --git a/news/9193.removal.rst b/news/9193.removal.rst new file mode 100644 index 000000000..5957a5583 --- /dev/null +++ b/news/9193.removal.rst @@ -0,0 +1,2 @@ +The --build-dir option has been restored as a no-op, to soften the transition +for tools that still used it. diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index c1522d639..7f05efb85 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -199,6 +199,20 @@ class Command(CommandContextMixIn): ) 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.1", + issue=8333, + ) + if '2020-resolver' in options.features_enabled and not PY2: 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 07d612a6f..3543ed48b 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -695,6 +695,14 @@ no_deps = partial( help="Don't install package dependencies.", ) # type: Callable[..., Option] +build_dir = partial( + PipOption, + '-b', '--build', '--build-dir', '--build-directory', + dest='build_dir', + type='path', + metavar='dir', + help=SUPPRESS_HELP, +) # type: Callable[..., Option] ignore_requires_python = partial( Option, diff --git a/src/pip/_internal/commands/download.py b/src/pip/_internal/commands/download.py index a2d3bf7d9..7405870ae 100644 --- a/src/pip/_internal/commands/download.py +++ b/src/pip/_internal/commands/download.py @@ -43,6 +43,7 @@ class DownloadCommand(RequirementCommand): # type: () -> 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 38f9f063d..a4e10f260 100644 --- a/src/pip/_internal/commands/install.py +++ b/src/pip/_internal/commands/install.py @@ -129,6 +129,8 @@ class InstallCommand(RequirementCommand): help="Installation prefix where lib, bin and other top-level " "folders are placed") + 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 2d654338d..39fd2bf81 100644 --- a/src/pip/_internal/commands/wheel.py +++ b/src/pip/_internal/commands/wheel.py @@ -78,6 +78,7 @@ class WheelCommand(RequirementCommand): 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( |