From 6fb7d5e6e078bf6b9d25e80e8c386c2000eb5723 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 9 Oct 2024 08:38:42 -0600 Subject: [PATCH] Reduce min Python version from 3.8 to 3.6 (#610) The default version of `python3` on RHEL8 machines in Python 3.6.8. (I am not sure where I got Python 3.8 from.) But note that RHEL8 machines also seem to have Python 3.11 and 3.12 installed as well. I am wondering if it would not be more wise to be pro-active and push the version of Python being required to a higher version that will be supported for longer. (Python 3.6 ended support at the end of 2021.) --- .../core/TestingFunctionMacro_UnitTests.cmake | 24 +++++++++---------- .../TribitsFindPythonInterp.cmake | 2 +- tribits/doc/guides/TribitsGuidesBody.rst | 8 +++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/core/TestingFunctionMacro_UnitTests.cmake b/test/core/TestingFunctionMacro_UnitTests.cmake index 0f0aad3ac..baabce657 100644 --- a/test/core/TestingFunctionMacro_UnitTests.cmake +++ b/test/core/TestingFunctionMacro_UnitTests.cmake @@ -195,10 +195,10 @@ function(tribits_find_python_interp_uses_python_empty) message("tribits_find_python_interp(): ${PROJECT_NAME}_USES_PYTHON=''") global_set(MESSAGE_WRAPPER_INPUT "") set(${PROJECT_NAME}_USES_PYTHON "") - set(Python3_EXECUTABLE_UNITTEST_VAL /path/to/python3.8) + set(Python3_EXECUTABLE_UNITTEST_VAL /path/to/python3.6) tribits_find_python_interp() unittest_compare_const(MESSAGE_WRAPPER_INPUT - "-- ;Python3_EXECUTABLE='/path/to/python3.8'") + "-- ;Python3_EXECUTABLE='/path/to/python3.6'") endfunction() @@ -206,12 +206,12 @@ function(tribits_find_python_interp_uses_python_true) message("tribits_find_python_interp(): ${PROJECT_NAME}_USES_PYTHON=TRUE") global_set(MESSAGE_WRAPPER_INPUT) set(${PROJECT_NAME}_USES_PYTHON TRUE) - global_set(Python3_EXECUTABLE_UNITTEST_VAL /path/to/python3.8) + global_set(Python3_EXECUTABLE_UNITTEST_VAL /path/to/python3.6) tribits_find_python_interp() unittest_compare_const(MESSAGE_WRAPPER_INPUT - "-- ;Python3_EXECUTABLE='/path/to/python3.8'") + "-- ;Python3_EXECUTABLE='/path/to/python3.6'") unittest_compare_const(FIND_Python3_ARGS - "Python3;3.8") + "Python3;3.6") endfunction() @@ -220,23 +220,23 @@ function(tribits_find_python_interp_requires_python_true) global_set(MESSAGE_WRAPPER_INPUT) set(${PROJECT_NAME}_USES_PYTHON FALSE) set(${PROJECT_NAME}_REQUIRES_PYTHON TRUE) - set(Python3_EXECUTABLE_UNITTEST_VAL /path/to/python3.8) + set(Python3_EXECUTABLE_UNITTEST_VAL /path/to/python3.6) tribits_find_python_interp() unittest_compare_const(MESSAGE_WRAPPER_INPUT - "-- ;Python3_EXECUTABLE='/path/to/python3.8'") + "-- ;Python3_EXECUTABLE='/path/to/python3.6'") unittest_compare_const(FIND_Python3_ARGS - "Python3;3.8;REQUIRED") + "Python3;3.6;REQUIRED") endfunction() function(tribits_find_python_interp_find_version_too_low) - message("tribits_find_python_interp(): ${PROJECT_NAME}_Python3_FIND_VERSION=3.7 (too low)") + message("tribits_find_python_interp(): ${PROJECT_NAME}_Python3_FIND_VERSION=3.5 (too low)") global_set(MESSAGE_WRAPPER_INPUT) - set(${PROJECT_NAME}_Python3_FIND_VERSION 3.7) + set(${PROJECT_NAME}_Python3_FIND_VERSION 3.5) set(Python3_EXECUTABLE_UNITTEST_VAL /dummy) tribits_find_python_interp() unittest_compare_const(MESSAGE_WRAPPER_INPUT - "FATAL_ERROR;Error,; ${PROJECT_NAME}_Python3_FIND_VERSION=3.7 < 3.8; is not allowed!;-- ;Python3_EXECUTABLE='/dummy'") + "FATAL_ERROR;Error,; ${PROJECT_NAME}_Python3_FIND_VERSION=3.5 < 3.6; is not allowed!;-- ;Python3_EXECUTABLE='/dummy'") endfunction() @@ -262,7 +262,7 @@ function(tribits_find_python_interp_python_executable_backward_compatible) unittest_compare_const(MESSAGE_WRAPPER_INPUT "DEPRECATION;Python3_EXECUTABLE being set by default to PYTHON_EXECUTABLE = '/path/to/python3.10.2' is deprecated!;\n\nNOTE: To Make these warnings go away, set -D; TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE (see the build reference guide).;-- ;Python3_EXECUTABLE='/path/to/python3.10.2'") unittest_compare_const(FIND_Python3_ARGS - "Python3;3.8") + "Python3;3.6") endfunction() diff --git a/tribits/core/package_arch/TribitsFindPythonInterp.cmake b/tribits/core/package_arch/TribitsFindPythonInterp.cmake index 4e40facf2..209fbd47e 100644 --- a/tribits/core/package_arch/TribitsFindPythonInterp.cmake +++ b/tribits/core/package_arch/TribitsFindPythonInterp.cmake @@ -42,7 +42,7 @@ endmacro() macro(tribits_find_python_set_python3_find_version) # Get minimum version of Python to find - set(${PROJECT_NAME}_Python3_FIND_VERSION_MIN "3.8") + set(${PROJECT_NAME}_Python3_FIND_VERSION_MIN "3.6") if ("${${PROJECT_NAME}_Python3_FIND_VERSION_DEFAULT}" STREQUAL "") set(${PROJECT_NAME}_Python3_FIND_VERSION_DEFAULT "${${PROJECT_NAME}_Python3_FIND_VERSION_MIN}") diff --git a/tribits/doc/guides/TribitsGuidesBody.rst b/tribits/doc/guides/TribitsGuidesBody.rst index 963755c88..18507eddb 100644 --- a/tribits/doc/guides/TribitsGuidesBody.rst +++ b/tribits/doc/guides/TribitsGuidesBody.rst @@ -7003,9 +7003,9 @@ Python Support TriBITS Core does not require anything other than raw CMake. However, Python Utils, TriBITS CI Support, and other extended TriBITS components require -Python. These extra TriBITS tools only require Python 3.8+. By default, when +Python. These extra TriBITS tools only require Python 3.6+. By default, when a TriBITS project starts to configure using CMake, it will try to find Python -3.8+ on the system (see `Full Processing of TriBITS Project Files`_). If +3.6+ on the system (see `Full Processing of TriBITS Project Files`_). If Python is found, it will set the global cache variable ``Python3_EXECUTABLE``. If it is not found, then it will print a warning and ``Python3_EXECUTABLE`` will be empty. With this default behavior, if Python is found, then the @@ -7022,9 +7022,9 @@ many TriBITS projects, some TriBITS projects need different behavior such as: can't be found. In this case, the TriBITS project would set `${PROJECT_NAME}_REQUIRES_PYTHON`_ to ``TRUE``. -3. Some TriBITS projects may require a version of Python more recent than 3.8. +3. Some TriBITS projects may require a version of Python more recent than 3.6. In this case, the TriBITS project would set - `${PROJECT_NAME}_Python3_FIND_VERSION`_ to some value higher than ``3.8``. + `${PROJECT_NAME}_Python3_FIND_VERSION`_ to some value higher than ``3.6``. For example, may newer systems have higher versions of Python installed by default, and projects developed on such a system typically require this version or higher.