Skip to content
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

Restore --build-dir #9198

Merged
merged 1 commit into from
Dec 2, 2020
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
2 changes: 2 additions & 0 deletions news/9193.removal.rst
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 14 additions & 0 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,20 @@ def _main(self, args):
)
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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 21.0 instead? I don’t imagine PyCharm would need more than three months to release an upgrade.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They requested 6 months in the issue.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uranusjr We've already released upgrades of the IDE, but we'd like to have at least one extra release cycle before the option is removed so that most of them have updated naturally, not because something had broken down. Sorry for causing all this hassle, and postponing a long-expected refactoring in your codebase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification!

issue=8333,
)

if '2020-resolver' in options.features_enabled and not PY2:
logger.warning(
"--use-feature=2020-resolver no longer has any effect, "
Expand Down
8 changes: 8 additions & 0 deletions src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,14 @@ def _handle_no_cache_dir(option, opt, value, parser):
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,
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/commands/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def add_options(self):
# 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())
Expand Down
2 changes: 2 additions & 0 deletions src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def add_options(self):
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(
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/commands/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def add_options(self):
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(
Expand Down