[Mlir-commits] [mlir] [mlir][python] allow passing in PYTHONPATH to lit tests (PR #89296)

Maksim Levental llvmlistbot at llvm.org
Thu Apr 18 12:56:12 PDT 2024


https://github.com/makslevental created https://github.com/llvm/llvm-project/pull/89296

Right now there's no way to pass in the current PYTHONPATH to lit tests.

>From 55498e66d7441a3b9bc072b6d8104c0329ef001f Mon Sep 17 00:00:00 2001
From: max <maksim.levental at gmail.com>
Date: Thu, 18 Apr 2024 14:55:18 -0500
Subject: [PATCH] [mlir][python] allow passing in PYTHONPATH to lit tests

---
 mlir/test/lit.cfg.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 7636ef30c2d3ef..07a6d13dfa6a0b 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -204,6 +204,7 @@ def add_runtime(name):
 # binaries come from the build tree. This should be unified to the build tree
 # by copying/linking sources to build.
 if config.enable_bindings_python:
+    config.environment["PYTHONPATH"] = os.getenv("PYTHONPATH", "")
     llvm_config.with_environment(
         "PYTHONPATH",
         [



More information about the Mlir-commits mailing list