Sfoglia il codice sorgente

bind-matrix-python-dependencies

root 3 mesi fa
parent
commit
2d9d7295ec
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      tools/run_verification_matrix.py

+ 6 - 0
tools/run_verification_matrix.py

@@ -111,6 +111,7 @@ def _run_visible_cmd(
     # Strip Anlogic libs for non-TD lanes so apt/python stay healthy.
     clean = os.environ.copy()
     keep_td = name == "td"
+    python_deps = os.environ.get("PROD2U_PYTHON_DEPS", "")
     if not keep_td:
         for key in (
             "LD_LIBRARY_PATH",
@@ -125,6 +126,11 @@ def _run_visible_cmd(
             "PERL_MM_OPT",
         ):
             clean.pop(key, None)
+        if python_deps:
+            dependency_root = Path(python_deps).resolve()
+            if not dependency_root.is_dir():
+                raise RuntimeError(f"configured Python dependency root is missing: {dependency_root}")
+            clean["PYTHONPATH"] = str(dependency_root)
     if env:
         clean.update(env)
     return run_visible(