Skip to content

Commit

Permalink
Merge pull request #10485 from pradyunsg/drop-build-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored Oct 5, 2021
2 parents e1dd4b4 + 62ead58 commit 3bbf6e9
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 61 deletions.
1 change: 1 addition & 0 deletions news/10485.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the ``--build-dir`` option and aliases, one last time.
15 changes: 0 additions & 15 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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, "
Expand Down
12 changes: 0 additions & 12 deletions src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/pip/_internal/commands/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 0 additions & 2 deletions src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion src/pip/_internal/commands/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
30 changes: 0 additions & 30 deletions tests/functional/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import re
import sys
from os.path import exists

import pytest

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3bbf6e9

Please sign in to comment.