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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Maksim Levental (makslevental)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/89296.diff


1 Files Affected:

- (modified) mlir/test/lit.cfg.py (+1) 


``````````diff
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",
         [

``````````

</details>


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


More information about the Mlir-commits mailing list