Rename function that reject location install options

Since it no longer shows a deprecation warning, the previous name
doesn't fit.
This commit is contained in:
Chris Hunt 2020-07-07 18:31:54 -04:00
parent 89572a7d40
commit f878fcdeec
2 changed files with 7 additions and 7 deletions

View File

@ -289,7 +289,7 @@ class InstallCommand(RequirementCommand):
try:
reqs = self.get_requirements(args, options, finder, session)
warn_deprecated_install_options(
reject_location_related_install_options(
reqs, options.install_options
)
@ -605,7 +605,7 @@ def decide_user_install(
return True
def warn_deprecated_install_options(requirements, options):
def reject_location_related_install_options(requirements, options):
# type: (List[InstallRequirement], Optional[List[str]]) -> None
"""If any location-changing --install-option arguments were passed for
requirements or on the command-line, then show a deprecation warning.

View File

@ -7,7 +7,7 @@ from pip._vendor.packaging.requirements import Requirement
from pip._internal.commands.install import (
create_env_error_message,
decide_user_install,
warn_deprecated_install_options,
reject_location_related_install_options,
)
from pip._internal.exceptions import CommandError
from pip._internal.req.req_install import InstallRequirement
@ -45,15 +45,15 @@ class TestDecideUserInstall:
assert decide_user_install(use_user_site=None) is result
def test_deprecation_notice_for_pip_install_options():
def test_rejection_for_pip_install_options():
install_options = ["--prefix=/hello"]
with pytest.raises(CommandError) as e:
warn_deprecated_install_options([], install_options)
reject_location_related_install_options([], install_options)
assert "['--prefix'] from command line" in str(e.value)
def test_deprecation_notice_for_requirement_options():
def test_rejection_for_location_requirement_options():
install_options = []
bad_named_req_options = ["--home=/wow"]
@ -68,7 +68,7 @@ def test_deprecation_notice_for_requirement_options():
)
with pytest.raises(CommandError) as e:
warn_deprecated_install_options(
reject_location_related_install_options(
[bad_named_req, bad_unnamed_req], install_options
)