|
|
@@ -87,13 +87,23 @@ def _select_cocotb_python() -> Path | None:
|
|
|
|
|
|
|
|
|
def _sdk_python() -> Path:
|
|
|
- for cand in (
|
|
|
+ cands = [
|
|
|
Path(os.environ.get("HTH_SDK_PYTHON", "")),
|
|
|
HOST / ".venv-sdk" / "bin" / "python3",
|
|
|
+ HOST / ".venv-sdk" / "bin" / "python",
|
|
|
+ Path("/opt/python-3.12/bin/python3.12"),
|
|
|
Path("/usr/bin/python3.13"),
|
|
|
Path(sys.executable),
|
|
|
- ):
|
|
|
- if cand.is_file():
|
|
|
+ ]
|
|
|
+ for cand in cands:
|
|
|
+ if not cand.is_file():
|
|
|
+ continue
|
|
|
+ r = subprocess.run(
|
|
|
+ [str(cand), "-c", "import grpc"],
|
|
|
+ stdout=subprocess.DEVNULL,
|
|
|
+ stderr=subprocess.DEVNULL,
|
|
|
+ )
|
|
|
+ if r.returncode == 0:
|
|
|
return cand
|
|
|
return Path(sys.executable)
|
|
|
|