From d1458a6116705b69c484902391b217273e84b662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Wed, 22 Mar 2023 03:57:23 +0000 Subject: [PATCH] utils.env: add run_pip_install helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- src/poetry/utils/env.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/poetry/utils/env.py b/src/poetry/utils/env.py index d5755d152c3..4a6d99997d3 100644 --- a/src/poetry/utils/env.py +++ b/src/poetry/utils/env.py @@ -1516,6 +1516,15 @@ def run_python_script(self, content: str, **kwargs: Any) -> int | str: **kwargs, ) + def run_pip_install(self, *packages: str) -> int | str: + return self.run_pip( + "install", + "--disable-pip-version-check", + "--ignore-installed", + "--no-input", + *packages, + ) + def _run(self, cmd: list[str], **kwargs: Any) -> int | str: """ Run a command inside the Python environment.