From b5268a0ba2093e9606db8581a79ad7280ec8c563 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Mon, 24 Oct 2022 10:29:36 -0700 Subject: [PATCH 1/3] Require Python 3.8+ in CMake build --- python_bindings/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_bindings/CMakeLists.txt b/python_bindings/CMakeLists.txt index c09b0bcc1fd8..ebe722d5a910 100644 --- a/python_bindings/CMakeLists.txt +++ b/python_bindings/CMakeLists.txt @@ -30,11 +30,14 @@ set(PYBIND11_VER 2.6.2 CACHE STRING "The pybind11 version to use (or download)") # Dependencies ## +# Halide currently requires Python 3.8 or later +set(Halide_PYTHON_VERSION_MINIMUM 3.8) + # The plain Development component is the same as requesting both # Development.Module and Development.Embed. We don't need the Embed # part, so only requesting Module avoids failures when Embed is not # available, as is the case in the manylinux Docker images. -find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) +find_package(Python3 ${Halide_PYTHON_VERSION_MINIMUM} REQUIRED COMPONENTS Interpreter Development.Module) if (PYBIND11_USE_FETCHCONTENT) include(FetchContent) From 78cbf7014231ee127cfce9ad4e7b21c87c0d43c8 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Mon, 24 Oct 2022 15:37:36 -0700 Subject: [PATCH 2/3] Update CMakeLists.txt --- python_bindings/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_bindings/CMakeLists.txt b/python_bindings/CMakeLists.txt index ebe722d5a910..313c46f43842 100644 --- a/python_bindings/CMakeLists.txt +++ b/python_bindings/CMakeLists.txt @@ -31,7 +31,7 @@ set(PYBIND11_VER 2.6.2 CACHE STRING "The pybind11 version to use (or download)") ## # Halide currently requires Python 3.8 or later -set(Halide_PYTHON_VERSION_MINIMUM 3.8) +set(Halide_PYTHON_VERSION_MINIMUM 3.8.0) # The plain Development component is the same as requesting both # Development.Module and Development.Embed. We don't need the Embed From f7dbea824bb9355477e56027d95185cec794b7ab Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Mon, 24 Oct 2022 16:00:55 -0700 Subject: [PATCH 3/3] Update CMakeLists.txt --- python_bindings/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python_bindings/CMakeLists.txt b/python_bindings/CMakeLists.txt index 313c46f43842..15bea455725d 100644 --- a/python_bindings/CMakeLists.txt +++ b/python_bindings/CMakeLists.txt @@ -30,14 +30,14 @@ set(PYBIND11_VER 2.6.2 CACHE STRING "The pybind11 version to use (or download)") # Dependencies ## -# Halide currently requires Python 3.8 or later -set(Halide_PYTHON_VERSION_MINIMUM 3.8.0) - # The plain Development component is the same as requesting both # Development.Module and Development.Embed. We don't need the Embed # part, so only requesting Module avoids failures when Embed is not # available, as is the case in the manylinux Docker images. -find_package(Python3 ${Halide_PYTHON_VERSION_MINIMUM} REQUIRED COMPONENTS Interpreter Development.Module) +find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module) +if (Python3_VERSION VERSION_LESS "3.8") + message(FATAL_ERROR "Halide requires Python v3.8 or later, but found ${Python3_VERSION}.") +endif () if (PYBIND11_USE_FETCHCONTENT) include(FetchContent)