From 466a01b0c6c40d2b57c4a3e14359f5cf20325550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20P=C3=A9rez?= Date: Wed, 4 Dec 2024 00:53:25 -0500 Subject: [PATCH] Update pylint pre-commit hook to support py3.13 venvs Without this change, running `pre-commit` inside a Python 3.13 venv results in errors as described in pylint-dev/pylint#10000 e.g.: ``` ************* Module telegram._bot telegram/_bot.py:26:0: E0611: No name 'Sequence' in module 'collections.abc' (no-name-in-module) ``` Bumping this hook required ignoring a new check added in pylint 3.3.0: `too-many-positional-arguments` as there's a significant amount of violations and picking a value for `--max-positional-arguments` seems non-trivial as there are functions with 80+ args (e.g., `Message::__init__()` in `telegram/_message.py`) --- .pre-commit-config.yaml | 2 +- AUTHORS.rst | 1 + pyproject.toml | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 99e1312da01..7788fb1f797 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/PyCQA/pylint - rev: v3.2.4 + rev: v3.3.2 hooks: - id: pylint files: ^(?!(tests|docs)).*\.py$ diff --git a/AUTHORS.rst b/AUTHORS.rst index 74b80ac091e..52ed5f66a29 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -81,6 +81,7 @@ The following wonderful people contributed directly or indirectly to this projec - `LRezende `_ - `Luca Bellanti `_ - `Lucas Molinari `_ +- `Luis Pérez `_ - `macrojames `_ - `Matheus Lemos `_ - `Michael Dix `_ diff --git a/pyproject.toml b/pyproject.toml index cb98f0057aa..0a63d90f45e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -149,7 +149,8 @@ enable = ["useless-suppression"] disable = ["duplicate-code", "too-many-arguments", "too-many-public-methods", "too-few-public-methods", "broad-exception-caught", "too-many-instance-attributes", "fixme", "missing-function-docstring", "missing-class-docstring", "too-many-locals", - "too-many-lines", "too-many-branches", "too-many-statements", "cyclic-import" + "too-many-lines", "too-many-branches", "too-many-statements", "cyclic-import", + "too-many-positional-arguments", ] [tool.pylint.main]