From 84a4ecde476269e62e0615bcffa0d57819115261 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Mon, 14 Sep 2026 22:59:12 +0200 Subject: [PATCH 1/2] [ci] Use Python 3.12 virtual env on Ubuntu 22 This is done because Python 3.10 will be end-of-life next month. --- .github/workflows/root-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml index 90c7e6664bc00..14b60a49bd153 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -402,6 +402,7 @@ jobs: overrides: ["CMAKE_BUILD_TYPE=Debug"] - image: alma10 - image: ubuntu22 + python_venv: "/py-venv-3.12/ROOT-CI" overrides: ["imt=Off", "CMAKE_BUILD_TYPE=Debug"] - image: ubuntu2404 overrides: ["CMAKE_BUILD_TYPE=Debug"] From e9d971a08b3e4fd52c00d7e0cb73ab931ed517b1 Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Mon, 14 Sep 2026 22:59:53 +0200 Subject: [PATCH 2/2] [CMake] Raise minimum required Python version to 3.11 We don't support Python versions that are end-of-life, and Python 3.10 will be end-of-life next month. --- .github/workflows/python_wheel_build.yml | 4 ++-- bindings/pyroot/pythonizations/CMakeLists.txt | 16 ++++++---------- bindings/tpython/CMakeLists.txt | 16 ++++++---------- cmake/modules/SearchInstalledSoftware.cmake | 2 +- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python_wheel_build.yml b/.github/workflows/python_wheel_build.yml index c32ca8d98cc28..0f55e22bc54a5 100644 --- a/.github/workflows/python_wheel_build.yml +++ b/.github/workflows/python_wheel_build.yml @@ -28,7 +28,7 @@ jobs: strategy: fail-fast: false matrix: - python: [cp310, cp311, cp312, cp313, cp314] + python: [cp311, cp312, cp313, cp314] config: # `label` is a unique artifact name for each build - runner: macos-15 @@ -75,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python: ["3.11", "3.12", "3.13", "3.14"] test_config: # each runner tests the wheel built on it - runner: macos-15 diff --git a/bindings/pyroot/pythonizations/CMakeLists.txt b/bindings/pyroot/pythonizations/CMakeLists.txt index 04aeb31ac581a..6a72b45733e55 100644 --- a/bindings/pyroot/pythonizations/CMakeLists.txt +++ b/bindings/pyroot/pythonizations/CMakeLists.txt @@ -21,16 +21,12 @@ set(libname ROOTPythonizations) add_library(${libname} SHARED ${cpp_sources}) -# Use what is in the limited API since Python 3.11, if we build with a lower -# Python version, we don't bother using the limited API. -if (Python3_VERSION VERSION_GREATER_EQUAL "3.11") - # On Windows we can't use the stable ABI yet: it requires linking against a - # different libpython, so as long as we don't build all translation units in - # the ROOT Pythonization library with the stable ABI we should not use it. - # Free-threaded (Py_GIL_DISABLED) interpreters don't support the limited API. - if(NOT MSVC AND NOT Python3_GIL_DISABLED) - target_compile_options(${libname} PRIVATE -DPy_LIMITED_API=0x030B0000) - endif() +# On Windows we can't use the stable ABI yet: it requires linking against a +# different libpython, so as long as we don't build all translation units in +# the ROOT Pythonization library with the stable ABI we should not use it. +# Free-threaded (Py_GIL_DISABLED) interpreters don't support the limited API. +if(NOT MSVC AND NOT Python3_GIL_DISABLED) + target_compile_options(${libname} PRIVATE -DPy_LIMITED_API=0x030B0000) endif() # Set the suffix to '.so' and the prefix to 'lib' diff --git a/bindings/tpython/CMakeLists.txt b/bindings/tpython/CMakeLists.txt index 728bb058efe72..ef759e5d064d3 100644 --- a/bindings/tpython/CMakeLists.txt +++ b/bindings/tpython/CMakeLists.txt @@ -30,16 +30,12 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTTPython Python3::Python ) -# Use what is in the limited API since Python 3.10, if we build with a lower -# Python version, we don't bother using the limited API. -if (Python3_VERSION VERSION_GREATER_EQUAL "3.10") - # On Windows we can't use the stable ABI yet: it requires linking against a - # different libpython, so as long as we don't build all translation units in - # the ROOT Pythonization library with the stable ABI we should not use it. - # Free-threaded (Py_GIL_DISABLED) interpreters don't support the limited API. - if(NOT MSVC AND NOT Python3_GIL_DISABLED) - target_compile_options(ROOTTPython PRIVATE -DPy_LIMITED_API=0x030A0000) - endif() +# On Windows we can't use the stable ABI yet: it requires linking against a +# different libpython, so as long as we don't build all translation units in +# the ROOT Pythonization library with the stable ABI we should not use it. +# Free-threaded (Py_GIL_DISABLED) interpreters don't support the limited API. +if(NOT MSVC AND NOT Python3_GIL_DISABLED) + target_compile_options(ROOTTPython PRIVATE -DPy_LIMITED_API=0x030A0000) endif() if(MSVC) diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 71b257e95ea7e..0787c3c68edac 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -481,7 +481,7 @@ endif() if(tmva-pymva) list(APPEND python_components NumPy) endif() -find_package(Python3 3.10 COMPONENTS ${python_components}) +find_package(Python3 3.11 COMPONENTS ${python_components}) # Detect whether the found Python interpreter is a free-threaded build # (Py_GIL_DISABLED is defined in pyconfig.h). The limited C API is not