[llvm] [mlir] [mlir python] Add nanobind support for standalone dialects. (PR #117922)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 12:44:49 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r 866755f8da588ec2efbcac60679b9d9f5c4636a9...bdee4180687b1485ad4a950ebcf840c853856263 mlir/examples/standalone/python/mlir_standalone/dialects/standalone_pybind11.py mlir/python/mlir/dialects/python_pybind11_test.py mlir/examples/standalone/test/python/smoketest.py mlir/examples/standalone/python/mlir_standalone/dialects/standalone_nanobind.py mlir/python/mlir/dialects/python_nanobind_test.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- examples/standalone/test/python/smoketest.py	2024-11-27 20:40:17.000000 +0000
+++ examples/standalone/test/python/smoketest.py	2024-11-27 20:44:23.463984 +0000
@@ -4,15 +4,15 @@
 import sys
 from mlir_standalone.ir import *
 from mlir_standalone.dialects import builtin as builtin_d
 
 if sys.argv[1] == "pybind11":
-  from mlir_standalone.dialects import standalone_pybind11 as standalone_d
+    from mlir_standalone.dialects import standalone_pybind11 as standalone_d
 elif sys.argv[1] == "nanobind":
-  from mlir_standalone.dialects import standalone_nanobind as standalone_d
+    from mlir_standalone.dialects import standalone_nanobind as standalone_d
 else:
-  raise ValueError("Expected either pybind11 or nanobind as arguments")
+    raise ValueError("Expected either pybind11 or nanobind as arguments")
 
 
 with Context():
     standalone_d.register_dialect()
     module = Module.parse(

``````````

</details>


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


More information about the llvm-commits mailing list