Coverage for pipxl/pip_cli.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-11-28 20:56 +0100

1# SPDX-FileCopyrightText: 2022-present Jeroen van Zundert <mail@jeroenvanzundert.nl> 

2# 

3# SPDX-License-Identifier: MIT 

4 

5import subprocess 

6import sys 

7 

8 

9def pip_cli(cmd: list[str], py_executable: str = sys.executable) -> subprocess.CompletedProcess[str]: 

10 # https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program 

11 return subprocess.run([py_executable, "-m", "pip"] + cmd, capture_output=True, timeout=60, text=True)