How to use the pipx.util.run_subprocess function in pipx

To help you get started, we’ve selected a few pipx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pipxproject / pipx / src / pipx / venv.py View on Github external
def list_installed_packages(self) -> Set[str]:
        cmd_run = run_subprocess(
            [str(self.python_path), "-m", "pip", "list", "--format=json"]
        )
        pip_list = json.loads(cmd_run.stdout.strip())
        return set([x["name"] for x in pip_list])
github pipxproject / pipx / src / pipx / venv.py View on Github external
def get_python_version(self) -> str:
        return run_subprocess([str(self.python_path), "--version"]).stdout.strip()
github pipxproject / pipx / src / pipx / venv.py View on Github external
def pip_search(self, search_term: str, pip_search_args: List[str]) -> str:
        cmd_run = run_subprocess(
            [str(self.python_path), "-m", "pip", "search"]
            + pip_search_args
            + [search_term]
        )
        return cmd_run.stdout.strip()