diff --git a/src/poetry/console/commands/init.py b/src/poetry/console/commands/init.py index 3e93adc763d..d1b9438650e 100644 --- a/src/poetry/console/commands/init.py +++ b/src/poetry/console/commands/init.py @@ -173,7 +173,7 @@ def _init_pyproject( if not python: config = Config.create() python = ( - "^" + ">=" + EnvManager.get_python_version( precision=2, prefer_active_python=config.get("virtualenvs.prefer-active-python"), diff --git a/tests/console/commands/test_init.py b/tests/console/commands/test_init.py index 2f8ddbce675..edb5ad57e17 100644 --- a/tests/console/commands/test_init.py +++ b/tests/console/commands/test_init.py @@ -216,7 +216,7 @@ def test_empty_license(tester: CommandTester) -> None: readme = "README.md" [tool.poetry.dependencies] -python = "^{python}" +python = ">={python}" """ assert expected in tester.io.fetch_output() @@ -1066,7 +1066,7 @@ def mock_check_output(cmd: str, *_: Any, **__: Any) -> str: expected = f"""\ [tool.poetry.dependencies] -python = "^{python}" +python = ">={python}" """ assert expected in pyproject_file.read_text() diff --git a/tests/console/commands/test_new.py b/tests/console/commands/test_new.py index 3bd1da82fa7..5b9094d0f6f 100644 --- a/tests/console/commands/test_new.py +++ b/tests/console/commands/test_new.py @@ -225,7 +225,7 @@ def mock_check_output(cmd: str, *_: Any, **__: Any) -> str: expected = f"""\ [tool.poetry.dependencies] -python = "^{python}" +python = ">={python}" """ assert expected in pyproject_file.read_text()