From 139ce4d37cfdc3126179bdb166ec61a095360c62 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 18 Jun 2026 23:48:23 +0200 Subject: [PATCH] GHA: separate pytype from other checkers and pips pytype is discontinued, does not receive further updates, and it requires older python, offered by Ubuntu 24.04 or older. Move it to its own GHA job to allow bumping the rest of checkers to. newer runner images. Also move it out from the shared `requirements.txt` and install directly from its separate GHA job, to avoid installing it unnecessarily from others. Since it does not receive update, it's fine to move out from Dependabot's view. Ref: https://pypi.org/project/pytype/ Cherry-picked from #22092 Closes #22096 --- .github/scripts/requirements.txt | 1 - .github/workflows/checksrc.yml | 26 +++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 5f50cb4b02..adf6d03ba4 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -4,6 +4,5 @@ cmakelang==0.6.13 codespell==2.4.2 -pytype==2024.10.11 reuse==6.2.0 ruff==0.15.16 diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index dad8ed48f5..83f5afe7a1 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -88,16 +88,32 @@ jobs: run: | scripts/perlcheck.sh - - name: 'pytype' - run: | - source ~/venv/bin/activate - find . -name '*.py' -exec pytype -j auto -k -- {} + - - name: 'ruff' run: | source ~/venv/bin/activate scripts/pythonlint.sh + pytype: + name: 'pytype' + runs-on: ubuntu-24.04-arm # pytype is discontinued and requires python 3.8-3.12 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: 'install prereqs' + run: | + python3 -m venv ~/venv + ~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary pytype==2024.10.11 \ + -r .github/scripts/requirements.txt \ + -r tests/http/requirements.txt \ + -r tests/requirements.txt + + - name: 'check' + run: | + source ~/venv/bin/activate + find . -name '*.py' -exec pytype -j auto -k -- {} + + complexity: name: 'complexity and function sizes' runs-on: ubuntu-slim