[Mlir-commits] [mlir] [mlir][Python] Bump MLIR Python minimum version to 3.10 (PR #163499)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Jan 4 17:12:40 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Maksim Levental (makslevental)

<details>
<summary>Changes</summary>

This PR bumps the minimum Python version required for MLIR to be Python 3.10.

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


1 Files Affected:

- (modified) mlir/cmake/modules/MLIRDetectPythonEnv.cmake (+4-3) 


``````````diff
diff --git a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
index fb0fbf3457ade..098d12aedeb91 100644
--- a/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
+++ b/mlir/cmake/modules/MLIRDetectPythonEnv.cmake
@@ -1,5 +1,6 @@
 # Macros and functions related to detecting details of the Python environment.
 
+set(MLIR_MINIMUM_PYTHON_VERSION 3.10)
 # Finds and configures python packages needed to build MLIR Python bindings.
 macro(mlir_configure_python_dev_packages)
   if(NOT MLIR_DISABLE_CONFIGURE_PYTHON_DEV_PACKAGES)
@@ -8,7 +9,7 @@ macro(mlir_configure_python_dev_packages)
       # package. This seems to work around cmake bugs searching only for
       # Development.Module in some environments. However, in other environments
       # it may interfere with the subsequent search for Development.Module.
-      find_package(Python3 ${LLVM_MINIMUM_PYTHON_VERSION}
+      find_package(Python3 ${MLIR_MINIMUM_PYTHON_VERSION}
         COMPONENTS Interpreter Development)
     endif()
 
@@ -19,7 +20,7 @@ macro(mlir_configure_python_dev_packages)
     # See https://pybind11.readthedocs.io/en/stable/compiling.html#findpython-mode
     set(_python_development_component Development.Module)
 
-    find_package(Python3 ${LLVM_MINIMUM_PYTHON_VERSION}
+    find_package(Python3 ${MLIR_MINIMUM_PYTHON_VERSION}
       COMPONENTS Interpreter ${_python_development_component} REQUIRED)
 
     # We look for both Python3 and Python, the search algorithm should be
@@ -39,7 +40,7 @@ macro(mlir_configure_python_dev_packages)
 
     # It's a little silly to detect Python a second time, but nanobind's cmake
     # code looks for Python_ not Python3_.
-    find_package(Python ${LLVM_MINIMUM_PYTHON_VERSION}
+    find_package(Python ${MLIR_MINIMUM_PYTHON_VERSION}
       COMPONENTS Interpreter ${_python_development_component} REQUIRED)
 
     unset(_python_development_component)

``````````

</details>


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


More information about the Mlir-commits mailing list