From db9369f854cd0395f5cf03d21a883269a51a2f0a Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 28 Oct 2024 12:13:40 +0100 Subject: [PATCH] define the minimum supported Python version as 3.6 --- .github/workflows/scriptcheck.yml | 6 +++--- cmake/findDependencies.cmake | 12 +++++++++--- readme.md | 2 ++ tools/donate-cpu.py | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml index e3ef5f234ba..3ffe65eac6b 100644 --- a/.github/workflows/scriptcheck.yml +++ b/.github/workflows/scriptcheck.yml @@ -18,7 +18,7 @@ permissions: jobs: build: - # 'ubuntu-22.04' removes Python 3.5 and 3.6 so keep the previous LTS version + # 'ubuntu-22.04' removes Python 3.6 so keep the previous LTS version runs-on: ubuntu-20.04 steps: @@ -44,7 +44,7 @@ jobs: scriptcheck: needs: build - # 'ubuntu-22.04' removes Python 3.5 and 3.6 so keep the previous LTS version + # 'ubuntu-22.04' removes Python 3.6 so keep the previous LTS version runs-on: ubuntu-20.04 strategy: matrix: @@ -101,7 +101,7 @@ jobs: if: matrix.python-latest run: | shopt -s globstar - pylint --jobs $(nproc) addons/**/*.py htmlreport/cppcheck-htmlreport htmlreport/**/*.py test/**/*.py tools/**/*.py + pylint --jobs $(nproc) --py-version 3.6 addons/**/*.py htmlreport/cppcheck-htmlreport htmlreport/**/*.py test/**/*.py tools/**/*.py - name: check .json files if: matrix.python-latest diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 98421a02ee4..20441101111 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -64,9 +64,15 @@ else() endif() endif() -if(NOT Python_Interpreter_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off") - message(WARNING "No python interpreter found - disabling matchcompiler.") - set(USE_MATCHCOMPILER_OPT "Off") +if(NOT Python_Interpreter_FOUND) + if(NOT USE_MATCHCOMPILER_OPT STREQUAL "Off") + message(WARNING "No python interpreter found - disabling matchcompiler.") + set(USE_MATCHCOMPILER_OPT "Off") + endif() +else() + if(${Python_VERSION} VERSION_LESS 3.6) + message(FATAL_ERROR "The minimum supported Python version is 3.6 - found ${Python_VERSION}") + endif() endif() if(NOT USE_BUNDLED_TINYXML2) diff --git a/readme.md b/readme.md index 29f5c2e1fd1..f7f1d8552b1 100644 --- a/readme.md +++ b/readme.md @@ -47,6 +47,8 @@ There are multiple compilation choices: * GCC (g++) * Clang (clang++) +The minimum required Python version is 3.6. + ### CMake The minimum required version is CMake 3.5. diff --git a/tools/donate-cpu.py b/tools/donate-cpu.py index c59f9ed6f0a..35ae295d20c 100755 --- a/tools/donate-cpu.py +++ b/tools/donate-cpu.py @@ -125,10 +125,10 @@ print('Unhandled argument: ' + arg) sys.exit(1) -if sys.version_info.major < 3 or (sys.version_info.major == 3 and sys.version_info.minor < 4): +if sys.version_info.major < 3 or (sys.version_info.major == 3 and sys.version_info.minor < 6): print("#" * 80) print("IMPORTANT") - print("Please run the client with at least Python 3.4, thanks!") + print("Please run the client with at least Python 3.6, thanks!") print("#" * 80) time.sleep(2) sys.exit(1)