From 6421ab59d57522714183c731c05179e530cfcbc5 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 7 Oct 2022 11:56:34 +0100 Subject: [PATCH 1/2] Remove the opt-in for `2020-resolver` This has been the default for quite some time now. --- src/pip/_internal/cli/base_command.py | 7 ------- src/pip/_internal/cli/cmdoptions.py | 1 - tests/unit/test_req_file.py | 12 ++++++++++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index 0774f26081f..5bd7e67e649 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -151,13 +151,6 @@ def _main(self, args: List[str]) -> int: ) options.cache_dir = None - 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." - ) - def intercepts_unhandled_exc( run_func: Callable[..., int] ) -> Callable[..., int]: diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index 9ff7a3d07de..b4e2560dea2 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -983,7 +983,6 @@ def check_list_path_option(options: Values) -> None: action="append", default=[], choices=[ - "2020-resolver", "fast-deps", "truststore", "no-binary-enable-wheel-cache", diff --git a/tests/unit/test_req_file.py b/tests/unit/test_req_file.py index fde0cb2f712..228d0aaa49c 100644 --- a/tests/unit/test_req_file.py +++ b/tests/unit/test_req_file.py @@ -459,8 +459,16 @@ def test_use_feature( self, line_processor: LineProcessor, options: mock.Mock ) -> None: """--use-feature can be set in requirements files.""" - line_processor("--use-feature=2020-resolver", "filename", 1, options=options) - assert "2020-resolver" in options.features_enabled + line_processor("--use-feature=fast-deps", "filename", 1, options=options) + + def test_use_feature_with_error( + self, line_processor: LineProcessor, options: mock.Mock + ) -> None: + """--use-feature triggers error when parsing requirements files.""" + with pytest.raises(RequirementsFileParseError): + line_processor( + "--use-feature=2020-resolver", "filename", 1, options=options + ) def test_relative_local_find_links( self, From 7662593941cf5a3519741b5c99973f0a9c5b50b1 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 7 Oct 2022 11:59:08 +0100 Subject: [PATCH 2/2] :newspaper: --- news/11493.removal.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/11493.removal.rst diff --git a/news/11493.removal.rst b/news/11493.removal.rst new file mode 100644 index 00000000000..de559e899bb --- /dev/null +++ b/news/11493.removal.rst @@ -0,0 +1 @@ +Remove ``--use-feature=2020-resolver`` opt-in flag. This was supposed to be removed in 21.0, but missed during that release cycle.