diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index 24dc9d14107..f71c0b02011 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -824,6 +824,15 @@ def _handle_no_use_pep517(option, opt, value, parser): "directory path, be sure to use absolute path.", ) # type: Callable[..., Option] +build_options = partial( + Option, + "--build-option", + dest="build_options", + metavar="options", + action="append", + help="Extra arguments to be supplied to 'setup.py bdist_wheel'.", +) # type: Callable[..., Option] + global_options = partial( Option, "--global-option", @@ -831,7 +840,7 @@ def _handle_no_use_pep517(option, opt, value, parser): action="append", metavar="options", help="Extra global options to be supplied to the setup.py " - "call before the install command.", + "call before the install or bdist_wheel command.", ) # type: Callable[..., Option] no_clean = partial( diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py index 842988ba570..ff47dbac51c 100644 --- a/src/pip/_internal/commands/wheel.py +++ b/src/pip/_internal/commands/wheel.py @@ -54,13 +54,6 @@ def add_options(self): self.cmd_opts.add_option(cmdoptions.no_binary()) self.cmd_opts.add_option(cmdoptions.only_binary()) self.cmd_opts.add_option(cmdoptions.prefer_binary()) - self.cmd_opts.add_option( - '--build-option', - dest='build_options', - metavar='options', - action='append', - help="Extra arguments to be supplied to 'setup.py bdist_wheel'.", - ) self.cmd_opts.add_option(cmdoptions.no_build_isolation()) self.cmd_opts.add_option(cmdoptions.use_pep517()) self.cmd_opts.add_option(cmdoptions.no_use_pep517()) @@ -81,13 +74,8 @@ def add_options(self): help="Don't verify if built wheel is valid.", ) - self.cmd_opts.add_option( - '--global-option', - dest='global_options', - action='append', - metavar='options', - help="Extra global options to be supplied to the setup.py " - "call before the 'bdist_wheel' command.") + self.cmd_opts.add_option(cmdoptions.build_options()) + self.cmd_opts.add_option(cmdoptions.global_options()) self.cmd_opts.add_option( '--pre',