From 9a6e18d9559e26c89cccf27134c96e091c9a8d3d Mon Sep 17 00:00:00 2001 From: finswimmer Date: Mon, 14 Jun 2021 06:25:18 +0200 Subject: [PATCH] add flag `--use-env` to specify the python executable to use --- poetry/console/application.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/poetry/console/application.py b/poetry/console/application.py index 42cc4377043..ca9f8c1ace8 100644 --- a/poetry/console/application.py +++ b/poetry/console/application.py @@ -265,7 +265,7 @@ def configure_env( poetry = command.poetry env_manager = EnvManager(poetry) - env = env_manager.create_venv(io) + env = env_manager.create_venv(io, executable=event.io.input.option("use-env")) if env.is_venv() and io.is_verbose(): io.write_line(f"Using virtualenv: {env.path}") @@ -327,6 +327,11 @@ def _default_definition(self) -> "Definition": definition.add_option( Option("--no-plugins", flag=True, description="Disables plugins.") ) + definition.add_option( + Option( + "--use-env", flag=False, description="The python executable to use." + ), + ) return definition