Skip to content

Commit 30eeb9c

Browse files
authored
Merge pull request #9198 from sbidoul/restore-build-dir-sbi
Restore --build-dir, as a no-op option
2 parents dce6b34 + 31a2e1a commit 30eeb9c

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

news/9193.removal.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The --build-dir option has been restored as a no-op, to soften the transition
2+
for tools that still used it.

src/pip/_internal/cli/base_command.py

+14
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,20 @@ def _main(self, args):
199199
)
200200
options.cache_dir = None
201201

202+
if getattr(options, "build_dir", None):
203+
deprecated(
204+
reason=(
205+
"The -b/--build/--build-dir/--build-directory "
206+
"option is deprecated and has no effect anymore."
207+
),
208+
replacement=(
209+
"use the TMPDIR/TEMP/TMP environment variable, "
210+
"possibly combined with --no-clean"
211+
),
212+
gone_in="21.1",
213+
issue=8333,
214+
)
215+
202216
if '2020-resolver' in options.features_enabled and not PY2:
203217
logger.warning(
204218
"--use-feature=2020-resolver no longer has any effect, "

src/pip/_internal/cli/cmdoptions.py

+8
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,14 @@ def _handle_no_cache_dir(option, opt, value, parser):
695695
help="Don't install package dependencies.",
696696
) # type: Callable[..., Option]
697697

698+
build_dir = partial(
699+
PipOption,
700+
'-b', '--build', '--build-dir', '--build-directory',
701+
dest='build_dir',
702+
type='path',
703+
metavar='dir',
704+
help=SUPPRESS_HELP,
705+
) # type: Callable[..., Option]
698706

699707
ignore_requires_python = partial(
700708
Option,

src/pip/_internal/commands/download.py

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def add_options(self):
4343
# type: () -> None
4444
self.cmd_opts.add_option(cmdoptions.constraints())
4545
self.cmd_opts.add_option(cmdoptions.requirements())
46+
self.cmd_opts.add_option(cmdoptions.build_dir())
4647
self.cmd_opts.add_option(cmdoptions.no_deps())
4748
self.cmd_opts.add_option(cmdoptions.global_options())
4849
self.cmd_opts.add_option(cmdoptions.no_binary())

src/pip/_internal/commands/install.py

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ def add_options(self):
129129
help="Installation prefix where lib, bin and other top-level "
130130
"folders are placed")
131131

132+
self.cmd_opts.add_option(cmdoptions.build_dir())
133+
132134
self.cmd_opts.add_option(cmdoptions.src())
133135

134136
self.cmd_opts.add_option(

src/pip/_internal/commands/wheel.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def add_options(self):
7878
self.cmd_opts.add_option(cmdoptions.src())
7979
self.cmd_opts.add_option(cmdoptions.ignore_requires_python())
8080
self.cmd_opts.add_option(cmdoptions.no_deps())
81+
self.cmd_opts.add_option(cmdoptions.build_dir())
8182
self.cmd_opts.add_option(cmdoptions.progress_bar())
8283

8384
self.cmd_opts.add_option(

0 commit comments

Comments
 (0)