mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Handle build dir normalization in cmdoptions
Technically this changes behavior in DownloadCommand, which does not make build_dir absolute, but given that it is used the same way as in InstallCommand and WheelCommand (which do make it absolute), it should not have any visible impact.
This commit is contained in:
parent
b6e007c6a8
commit
95c3f632e3
1 changed files with 11 additions and 0 deletions
|
@ -679,11 +679,22 @@ no_deps = partial(
|
|||
help="Don't install package dependencies.",
|
||||
) # 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(
|
||||
Option,
|
||||
'-b', '--build', '--build-dir', '--build-directory',
|
||||
dest='build_dir',
|
||||
type='str',
|
||||
metavar='dir',
|
||||
action='callback',
|
||||
callback=_handle_build_dir,
|
||||
help='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 '
|
||||
|
|
Loading…
Reference in a new issue