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

Maksim Levental llvmlistbot at llvm.org
Thu Apr 18 13:55:32 PDT 2024


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

>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 1/2] [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",
         [

>From 1849054f2eb3f2a7782c30915676ac2ba6e89a17 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Thu, 18 Apr 2024 15:55:25 -0500
Subject: [PATCH 2/2] Update mlir/test/lit.cfg.py

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

diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py
index 07a6d13dfa6a0b..4740e7d137e8d3 100644
--- a/mlir/test/lit.cfg.py
+++ b/mlir/test/lit.cfg.py
@@ -204,7 +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", "")
+    config.environment["PYTHONPATH"] = os.getenv("MLIR_LIT_PYTHONPATH", "")
     llvm_config.with_environment(
         "PYTHONPATH",
         [



More information about the Mlir-commits mailing list