Merge pull request #9075 from pradyunsg/move-logging-of-resolver-warning

Change where the 2020 resolver warning is logged
This commit is contained in:
Pradyun Gedam 2020-10-31 14:48:42 +05:30 committed by GitHub
commit 90dac0d829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -10,6 +10,8 @@ import platform
import sys
import traceback
from pip._vendor.six import PY2
from pip._internal.cli import cmdoptions
from pip._internal.cli.command_context import CommandContextMixIn
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
@ -204,6 +206,13 @@ class Command(CommandContextMixIn):
)
sys.exit(ERROR)
if '2020-resolver' in options.features_enabled and not PY2:
logger.warning(
"--use-feature=2020-resolver no longer has any effect, "
"since it is now the default dependency resolver in pip. "
"This will become an error in pip 21.0."
)
try:
status = self.run(options, args)
assert isinstance(status, int)

View File

@ -208,14 +208,6 @@ class RequirementCommand(IndexGroupCommand):
else:
return "legacy"
# Warn about the options that are gonna be removed.
if '2020-resolver' in options.features_enabled:
logger.warning(
"--use-feature=2020-resolver no longer has any effect, "
"since it is now the default dependency resolver in pip. "
"This will become an error in pip 21.0."
)
if "legacy-resolver" in options.deprecated_features_enabled:
return "legacy"