MCPcopy Create free account
hub / github.com/pytorch/executorch / run

Method run

tools/cmake/buck_util.py:31–42  ·  view source on GitHub ↗

Runs buck2 with the given args and returns its stdout as a sequence of lines.

(self, args: Sequence[str])

Source from the content-addressed store, hash-verified

29 self._path = tool_path
30
31 def run(self, args: Sequence[str]) -> list[str]:
32 """Runs buck2 with the given args and returns its stdout as a sequence of lines."""
33 try:
34 cp: subprocess.CompletedProcess = subprocess.run(
35 [self._path] + args, # type: ignore[operator]
36 capture_output=True,
37 cwd=repo_root_dir(),
38 check=True,
39 )
40 return [line.strip().decode("utf-8") for line in cp.stdout.splitlines()]
41 except subprocess.CalledProcessError as ex:
42 raise RuntimeError(ex.stderr.decode("utf-8")) from ex
43
44
45def get_buck2_version(path: str) -> Optional[str]:

Callers 4

get_buck2_versionFunction · 0.95
run_cmakeMethod · 0.45
mainFunction · 0.45

Calls 2

repo_root_dirFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected