diff --git a/src/poetry/utils/env.py b/src/poetry/utils/env.py
index afc1e7581a1..6bf07e92c2a 100644
--- a/src/poetry/utils/env.py
+++ b/src/poetry/utils/env.py
@@ -536,15 +536,15 @@ def _detect_active_python(self, io: IO) -> str | None:
executable = None
try:
- io.write_line(
+ io.write_error_line(
"Trying to detect current active python executable as specified in the"
" config.",
verbosity=Verbosity.VERBOSE,
)
executable = self._full_python_path("python")
- io.write_line(f"Found: {executable}", verbosity=Verbosity.VERBOSE)
+ io.write_error_line(f"Found: {executable}", verbosity=Verbosity.VERBOSE)
except CalledProcessError:
- io.write_line(
+ io.write_error_line(
"Unable to detect the current active python executable. Falling back to"
" default.",
verbosity=Verbosity.VERBOSE,
@@ -651,7 +651,9 @@ def deactivate(self, io: IO) -> None:
env = envs.get(name)
if env is not None:
venv = venv_path / f"{name}-py{env['minor']}"
- io.write_line(f"Deactivating virtualenv: {venv}")
+ io.write_error_line(
+ f"Deactivating virtualenv: {venv}"
+ )
del envs[name]
envs_file.write(envs)
@@ -911,7 +913,7 @@ def create_venv(
python = "python" + python_to_try
if io.is_debug():
- io.write_line(f"Trying {python}")
+ io.write_error_line(f"Trying {python}")
try:
python_patch = decode(
@@ -930,7 +932,7 @@ def create_venv(
continue
if supported_python.allows(Version.parse(python_patch)):
- io.write_line(f"Using {python} ({python_patch})")
+ io.write_error_line(f"Using {python} ({python_patch})")
executable = python
python_minor = ".".join(python_patch.split(".")[:2])
break
@@ -955,7 +957,7 @@ def create_venv(
if not venv.exists():
if create_venv is False:
- io.write_line(
+ io.write_error_line(
""
"Skipping virtualenv creation, "
"as specified in config file."
@@ -964,7 +966,7 @@ def create_venv(
return self.get_system_env()
- io.write_line(
+ io.write_error_line(
f"Creating virtualenv {name}> in"
f" {venv_path if not WINDOWS else get_real_windows_path(venv_path)!s}"
)
@@ -976,11 +978,11 @@ def create_venv(
f"The virtual environment found in {env.path} seems to"
" be broken."
)
- io.write_line(f"Recreating virtualenv {name}> in {venv!s}")
+ io.write_error_line(f"Recreating virtualenv {name}> in {venv!s}")
self.remove_venv(venv)
create_venv = True
elif io.is_very_verbose():
- io.write_line(f"Virtualenv {name}> already exists.")
+ io.write_error_line(f"Virtualenv {name}> already exists.")
if create_venv:
self.build_venv(
@@ -1917,14 +1919,14 @@ def build_environment(
if io:
if not overwrite:
- io.write_line("")
+ io.write_error_line("")
requires = [
f"{requirement}"
for requirement in poetry.pyproject.build_system.requires
]
- io.overwrite(
+ io.overwrite_error(
"Preparing build environment with build-system requirements"
f" {', '.join(requires)}"
)
@@ -1938,7 +1940,7 @@ def build_environment(
if overwrite:
assert io is not None
- io.write_line("")
+ io.write_error_line("")
yield venv
else: