From 033e9b3f04007eab32d6be230ae7a5067588794d Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 1 May 2024 10:58:24 +0200 Subject: [PATCH 1/2] fixed #12682 - deprecated support for Python 2.7 --- cmake/findDependencies.cmake | 2 ++ releasenotes.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/cmake/findDependencies.cmake b/cmake/findDependencies.cmake index 05122062b42..67b4a2a3712 100644 --- a/cmake/findDependencies.cmake +++ b/cmake/findDependencies.cmake @@ -54,6 +54,8 @@ else() if(NOT PYTHONINTERP_FOUND AND NOT USE_MATCHCOMPILER_OPT STREQUAL "Off") message(WARNING "No python interpreter found - disabling matchcompiler.") set(USE_MATCHCOMPILER_OPT "Off") + else() + message(WARNING "Support for Python 2.7 is deprecated (it went EOL in January 2020) and will be removed in Cppcheck 2.16 - please use Python 3.x instead.") endif() endif() if(PYTHONINTERP_FOUND) diff --git a/releasenotes.txt b/releasenotes.txt index a04d884e540..3a3aa928936 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -13,6 +13,7 @@ Changed interface: - Deprecations: +- Support for Python 2.7 has been deprecated (it went EOL in January 2020) and will be removed in Cppcheck 2.16 - please use Python 3.x instead. - Other: From f62473721f29f62524b1f45a0d7fb2ecd8e15f06 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 1 May 2024 10:58:40 +0200 Subject: [PATCH 2/2] scriptcheck.yml: removed unused Python 2.7 leftovers --- .github/workflows/scriptcheck.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml index 5f702f2fb22..8e6d4859157 100644 --- a/.github/workflows/scriptcheck.yml +++ b/.github/workflows/scriptcheck.yml @@ -17,7 +17,7 @@ permissions: jobs: build: - # 'ubuntu-22.04' removes Python 2.7, 3.6 and 3.6 so keep the previous LTS version + # 'ubuntu-22.04' removes Python 3.5 and 3.6 so keep the previous LTS version runs-on: ubuntu-20.04 steps: @@ -43,8 +43,7 @@ jobs: scriptcheck: needs: build - # 'ubuntu-22.04' removes Python 2.7, 3.5 and 3.6 so keep the previous LTS version - # 'ubutunu-20.04' no longer works on 2.7 - TODO: re-added in a different way or remove support for it? + # 'ubuntu-22.04' removes Python 3.5 and 3.6 so keep the previous LTS version runs-on: ubuntu-20.04 strategy: matrix: @@ -75,16 +74,7 @@ jobs: sudo apt-get update sudo apt-get install tidy libxml2-utils - - name: Install missing software on ubuntu (Python 2) - if: matrix.python-version == '2.7' - run: | - python -m pip install pip --upgrade - python -m pip install pathlib - python -m pip install pytest - python -m pip install pygments - - name: Install missing software on ubuntu (Python 3) - if: matrix.python-version != '2.7' run: | # shellcheck cannot be installed via pip # ERROR: Could not find a version that satisfies the requirement shellcheck (from versions: none) @@ -124,7 +114,6 @@ jobs: make -j$(nproc) validateCFG validatePlatforms validateRules - name: check python syntax - if: matrix.python-version != '2.7' run: | python -m py_compile addons/*.py python -m py_compile htmlreport/cppcheck-htmlreport @@ -167,14 +156,12 @@ jobs: PYTHONPATH: ./tools - name: test donate_cpu_lib - if: matrix.python-version != '2.7' run: | python -m pytest -Werror --strict-markers -vv tools/donate_cpu_lib_test.py env: PYTHONPATH: ./tools - name: test donate_cpu_server - if: matrix.python-version != '2.7' run: | python -m pytest -Werror --strict-markers -vv tools/donate_cpu_server_test.py env: