From 1deba970cad21ccbec32287aaf1e81ac13c94f69 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sun, 18 Feb 2024 18:32:51 +0000 Subject: [PATCH 1/2] deprecate "installer.modern-installation false" --- src/poetry/installation/executor.py | 11 +++++++++++ tests/installation/test_executor.py | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/src/poetry/installation/executor.py b/src/poetry/installation/executor.py index 9a2aad10734..c0580bba2e6 100644 --- a/src/poetry/installation/executor.py +++ b/src/poetry/installation/executor.py @@ -68,6 +68,17 @@ def __init__( self._use_modern_installation = config.get( "installer.modern-installation", True ) + if not self._use_modern_installation: + self._io.write_line( + "Setting `installer.modern-installation` to `false` " + "is deprecated." + ) + self._io.write_line( + "The pip-based installer will be removed in a future release." + ) + self._io.write_line( + "See https://github.com/python-poetry/poetry/issues/8987." + ) if parallel is None: parallel = config.get("installer.parallel", True) diff --git a/tests/installation/test_executor.py b/tests/installation/test_executor.py index d73705ff405..a55f190634e 100644 --- a/tests/installation/test_executor.py +++ b/tests/installation/test_executor.py @@ -1169,6 +1169,12 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer( }) executor = Executor(env, pool, config, io) + warning_lines = io.fetch_output().splitlines() + assert warning_lines == [ + "Setting `installer.modern-installation` to `false` is deprecated.", + "The pip-based installer will be removed in a future release.", + "See https://github.com/python-poetry/poetry/issues/8987.", + ] directory_package = Package( "simple-project", From faebeae372caec1a6ede78a70a25ed7f3ba69b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:44:25 +0100 Subject: [PATCH 2/2] add "Warning" for unicolored output --- src/poetry/installation/executor.py | 2 +- tests/installation/test_executor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/poetry/installation/executor.py b/src/poetry/installation/executor.py index c0580bba2e6..84af089e445 100644 --- a/src/poetry/installation/executor.py +++ b/src/poetry/installation/executor.py @@ -70,7 +70,7 @@ def __init__( ) if not self._use_modern_installation: self._io.write_line( - "Setting `installer.modern-installation` to `false` " + "Warning: Setting `installer.modern-installation` to `false` " "is deprecated." ) self._io.write_line( diff --git a/tests/installation/test_executor.py b/tests/installation/test_executor.py index a55f190634e..b7c7f6a8ed8 100644 --- a/tests/installation/test_executor.py +++ b/tests/installation/test_executor.py @@ -1171,7 +1171,7 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer( executor = Executor(env, pool, config, io) warning_lines = io.fetch_output().splitlines() assert warning_lines == [ - "Setting `installer.modern-installation` to `false` is deprecated.", + "Warning: Setting `installer.modern-installation` to `false` is deprecated.", "The pip-based installer will be removed in a future release.", "See https://github.com/python-poetry/poetry/issues/8987.", ]