Skip to content

Commit

Permalink
Reduce min Python version from 3.8 to 3.6 (#610)
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
bartlettroscoe committed Oct 9, 2024
1 parent c591413 commit 6fb7d5e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions test/core/TestingFunctionMacro_UnitTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,23 @@ 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()


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()


Expand All @@ -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()


Expand All @@ -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()


Expand Down
2 changes: 1 addition & 1 deletion tribits/core/package_arch/TribitsFindPythonInterp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
8 changes: 4 additions & 4 deletions tribits/doc/guides/TribitsGuidesBody.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 6fb7d5e

Please sign in to comment.