Skip to content

Commit

Permalink
utils.env: add run_pip_install helper
Browse files Browse the repository at this point in the history
Signed-off-by: Filipe Laíns <[email protected]>
  • Loading branch information
FFY00 committed Mar 22, 2023
1 parent 71b3d6e commit d1458a6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d1458a6

Please sign in to comment.