From 30cb46003917e6cec1e7d2f9a4bbbf3a0fc0db5a Mon Sep 17 00:00:00 2001 From: finswimmer Date: Sun, 3 Mar 2024 18:31:42 +0100 Subject: [PATCH] feat: make use of Python in init and new command --- src/poetry/console/commands/init.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/poetry/console/commands/init.py b/src/poetry/console/commands/init.py index 3e93adc763d..504191f4ae5 100644 --- a/src/poetry/console/commands/init.py +++ b/src/poetry/console/commands/init.py @@ -16,6 +16,7 @@ from poetry.console.commands.command import Command from poetry.console.commands.env_command import EnvCommand from poetry.utils.dependency_specification import RequirementsParser +from poetry.utils.env.python_manager import Python if TYPE_CHECKING: @@ -96,7 +97,6 @@ def _init_pyproject( from poetry.config.config import Config from poetry.layouts import layout from poetry.pyproject.toml import PyProjectTOML - from poetry.utils.env import EnvManager is_interactive = self.io.is_interactive() and allow_interactive @@ -174,11 +174,7 @@ def _init_pyproject( config = Config.create() python = ( "^" - + EnvManager.get_python_version( - precision=2, - prefer_active_python=config.get("virtualenvs.prefer-active-python"), - io=self.io, - ).to_string() + + Python.get_preferred_python(config, self.io).minor_version.to_string() ) if is_interactive: