MCPcopy Create free account
hub / github.com/FastLED/FastLED / check_meson_installed

Function check_meson_installed

ci/meson/compiler.py:38–58  ·  view source on GitHub ↗

Check if Meson is installed and accessible.

()

Source from the content-addressed store, hash-verified

36
37
38def check_meson_installed() -> bool:
39 """Check if Meson is installed and accessible."""
40 meson_exe = get_meson_executable()
41 # Fast path: if get_meson_executable() returned an absolute venv path, it
42 # already confirmed the file exists - no need for a subprocess round-trip.
43 meson_path = Path(meson_exe)
44 if meson_path.is_absolute() and meson_path.exists():
45 return True
46 # Slow path: venv meson not found; verify the system-PATH "meson" works.
47 try:
48 result = subprocess.run(
49 [meson_exe, "--version"],
50 capture_output=True,
51 text=True,
52 encoding="utf-8",
53 errors="replace",
54 timeout=5,
55 )
56 return result.returncode == 0
57 except (subprocess.SubprocessError, FileNotFoundError):
58 return False
59
60
61def get_meson_version() -> str:

Callers 2

run_meson_build_and_testFunction · 0.90
run_meson_examplesFunction · 0.90

Calls 2

get_meson_executableFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected