Skip to content

Commit e86f27f

Browse files
authored
Merge pull request #11493 from pradyunsg/remove-2020-resolver-opt-in
2 parents 1fcc3ce + 7662593 commit e86f27f

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

news/11493.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove ``--use-feature=2020-resolver`` opt-in flag. This was supposed to be removed in 21.0, but missed during that release cycle.

src/pip/_internal/cli/base_command.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ def _main(self, args: List[str]) -> int:
151151
)
152152
options.cache_dir = None
153153

154-
if "2020-resolver" in options.features_enabled:
155-
logger.warning(
156-
"--use-feature=2020-resolver no longer has any effect, "
157-
"since it is now the default dependency resolver in pip. "
158-
"This will become an error in pip 21.0."
159-
)
160-
161154
def intercepts_unhandled_exc(
162155
run_func: Callable[..., int]
163156
) -> Callable[..., int]:

src/pip/_internal/cli/cmdoptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,6 @@ def check_list_path_option(options: Values) -> None:
983983
action="append",
984984
default=[],
985985
choices=[
986-
"2020-resolver",
987986
"fast-deps",
988987
"truststore",
989988
"no-binary-enable-wheel-cache",

tests/unit/test_req_file.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,16 @@ def test_use_feature(
459459
self, line_processor: LineProcessor, options: mock.Mock
460460
) -> None:
461461
"""--use-feature can be set in requirements files."""
462-
line_processor("--use-feature=2020-resolver", "filename", 1, options=options)
463-
assert "2020-resolver" in options.features_enabled
462+
line_processor("--use-feature=fast-deps", "filename", 1, options=options)
463+
464+
def test_use_feature_with_error(
465+
self, line_processor: LineProcessor, options: mock.Mock
466+
) -> None:
467+
"""--use-feature triggers error when parsing requirements files."""
468+
with pytest.raises(RequirementsFileParseError):
469+
line_processor(
470+
"--use-feature=2020-resolver", "filename", 1, options=options
471+
)
464472

465473
def test_relative_local_find_links(
466474
self,

0 commit comments

Comments
 (0)