1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Rename custom option class for future expansion

This commit is contained in:
Tzu-ping Chung 2020-01-07 10:50:51 +05:30
parent 9c04298d5b
commit 32ecd727d5

View file

@ -135,7 +135,7 @@ def _path_option_check(option, opt, value):
return os.path.expanduser(value)
class _PathOption(Option):
class PipOption(Option):
TYPES = Option.TYPES + ("path",)
TYPE_CHECKER = Option.TYPE_CHECKER.copy()
TYPE_CHECKER["path"] = _path_option_check
@ -228,7 +228,7 @@ progress_bar = partial(
) # type: Callable[..., Option]
log = partial(
_PathOption,
PipOption,
"--log", "--log-file", "--local-log",
dest="log",
metavar="path",
@ -303,7 +303,7 @@ def exists_action():
cert = partial(
_PathOption,
PipOption,
'--cert',
dest='cert',
type='path',
@ -312,7 +312,7 @@ cert = partial(
) # type: Callable[..., Option]
client_cert = partial(
_PathOption,
PipOption,
'--client-cert',
dest='client_cert',
type='path',
@ -432,7 +432,7 @@ def _handle_src(option, opt_str, value, parser):
src = partial(
_PathOption,
PipOption,
'--src', '--source', '--source-dir', '--source-directory',
dest='src_dir',
type='path',
@ -638,7 +638,7 @@ def prefer_binary():
cache_dir = partial(
_PathOption,
PipOption,
"--cache-dir",
dest="cache_dir",
default=USER_CACHE_DIR,
@ -703,7 +703,7 @@ def _handle_build_dir(option, opt, value, parser):
build_dir = partial(
_PathOption,
PipOption,
'-b', '--build', '--build-dir', '--build-directory',
dest='build_dir',
type='path',
@ -887,7 +887,7 @@ require_hashes = partial(
list_path = partial(
_PathOption,
PipOption,
'--path',
dest='path',
type='path',