MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / run_command

Function run_command

lean_py/utils.py:12–18  ·  view source on GitHub ↗

Run a command and return the trimmed stdout.

(args: list[str], **kwargs)

Source from the content-addressed store, hash-verified

10
11
12def run_command(args: list[str], **kwargs) -> str:
13 """Run a command and return the trimmed stdout."""
14 res = subprocess.run(args, capture_output=True, **kwargs)
15 if res.returncode != 0:
16 stderr = res.stderr.decode(errors="replace") if res.stderr else ""
17 raise RuntimeError(f"Command {args} exited with {res.returncode}: {stderr}")
18 return res.stdout.decode().strip()
19
20
21@lru_cache(maxsize=1)

Callers 6

buildMethod · 0.90
kernelMethod · 0.90
from_lakeMethod · 0.90
lean_toolchain_versionFunction · 0.85
lean_prefixFunction · 0.85
find_lean_dynlibFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected