mirror of https://github.com/pypa/pip
Remove --build-dir option, as per deprecation
This commit is contained in:
parent
b39aeeb6df
commit
40904e3a05
|
@ -197,20 +197,6 @@ 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."
|
||||
),
|
||||
replacement=(
|
||||
"use the TMPDIR/TEMP/TMP environment variable, "
|
||||
"possibly combined with --no-clean"
|
||||
),
|
||||
gone_in="20.3",
|
||||
issue=8333,
|
||||
)
|
||||
|
||||
if 'resolver' in options.unstable_features:
|
||||
logger.critical(
|
||||
"--unstable-feature=resolver is no longer supported, and "
|
||||
|
|
|
@ -685,29 +685,6 @@ no_deps = partial(
|
|||
) # type: Callable[..., Option]
|
||||
|
||||
|
||||
def _handle_build_dir(option, opt, value, parser):
|
||||
# type: (Option, str, str, OptionParser) -> None
|
||||
if value:
|
||||
value = os.path.abspath(value)
|
||||
setattr(parser.values, option.dest, value)
|
||||
|
||||
|
||||
build_dir = partial(
|
||||
PipOption,
|
||||
'-b', '--build', '--build-dir', '--build-directory',
|
||||
dest='build_dir',
|
||||
type='path',
|
||||
metavar='dir',
|
||||
action='callback',
|
||||
callback=_handle_build_dir,
|
||||
help='(DEPRECATED) '
|
||||
'Directory to unpack packages into and build in. Note that '
|
||||
'an initial build still takes place in a temporary directory. '
|
||||
'The location of temporary directories can be controlled by setting '
|
||||
'the TMPDIR environment variable (TEMP on Windows) appropriately. '
|
||||
'When passed, build directories are not cleaned in case of failures.'
|
||||
) # type: Callable[..., Option]
|
||||
|
||||
ignore_requires_python = partial(
|
||||
Option,
|
||||
'--ignore-requires-python',
|
||||
|
|
|
@ -43,7 +43,6 @@ 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())
|
||||
|
@ -97,13 +96,11 @@ class DownloadCommand(RequirementCommand):
|
|||
session=session,
|
||||
target_python=target_python,
|
||||
)
|
||||
build_delete = (not (options.no_clean or options.build_dir))
|
||||
|
||||
req_tracker = self.enter_context(get_requirement_tracker())
|
||||
|
||||
directory = TempDirectory(
|
||||
options.build_dir,
|
||||
delete=build_delete,
|
||||
delete=not options.no_clean,
|
||||
kind="download",
|
||||
globally_managed=True,
|
||||
)
|
||||
|
|
|
@ -129,8 +129,6 @@ 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(
|
||||
|
@ -277,14 +275,12 @@ class InstallCommand(RequirementCommand):
|
|||
target_python=target_python,
|
||||
ignore_requires_python=options.ignore_requires_python,
|
||||
)
|
||||
build_delete = (not (options.no_clean or options.build_dir))
|
||||
wheel_cache = WheelCache(options.cache_dir, options.format_control)
|
||||
|
||||
req_tracker = self.enter_context(get_requirement_tracker())
|
||||
|
||||
directory = TempDirectory(
|
||||
options.build_dir,
|
||||
delete=build_delete,
|
||||
delete=not options.no_clean,
|
||||
kind="install",
|
||||
globally_managed=True,
|
||||
)
|
||||
|
|
|
@ -78,7 +78,6 @@ 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(
|
||||
|
@ -115,7 +114,6 @@ class WheelCommand(RequirementCommand):
|
|||
session = self.get_default_session(options)
|
||||
|
||||
finder = self._build_package_finder(options, session)
|
||||
build_delete = (not (options.no_clean or options.build_dir))
|
||||
wheel_cache = WheelCache(options.cache_dir, options.format_control)
|
||||
|
||||
options.wheel_dir = normalize_path(options.wheel_dir)
|
||||
|
@ -124,8 +122,7 @@ class WheelCommand(RequirementCommand):
|
|||
req_tracker = self.enter_context(get_requirement_tracker())
|
||||
|
||||
directory = TempDirectory(
|
||||
options.build_dir,
|
||||
delete=build_delete,
|
||||
delete=not options.no_clean,
|
||||
kind="wheel",
|
||||
globally_managed=True,
|
||||
)
|
||||
|
|
|
@ -358,6 +358,10 @@ class InstallRequirement(object):
|
|||
|
||||
return self._temp_build_dir.path
|
||||
|
||||
# This is the only remaining place where we manually determine the path
|
||||
# for the temporary directory. It is only needed for editables where
|
||||
# it is the value of the --src option.
|
||||
|
||||
# When parallel builds are enabled, add a UUID to the build directory
|
||||
# name so multiple builds do not interfere with each other.
|
||||
dir_name = canonicalize_name(self.name)
|
||||
|
|
|
@ -134,6 +134,8 @@ class TempDirectory(object):
|
|||
# tempdir_registry says.
|
||||
delete = None
|
||||
|
||||
# The only time we specify path is in for editables where it
|
||||
# is the value of the --src option.
|
||||
if path is None:
|
||||
path = self._create(kind)
|
||||
|
||||
|
|
Loading…
Reference in New Issue