From ed331d19707bd3ce2242b44464d819367cecb6ec Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Wed, 24 Apr 2024 03:42:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Bump=20pylint=20to=20v3.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This version supports Python 3.12 officially. As a part of this patch, `pylint-pytest` is also updated with the bugfixes needed to stop capping it. An alpha version of the plugin is used due to a bug when running `pylint` in parallel mode [[1]]. [1]: https://github.com/pylint-dev/pylint-pytest/issues/61 --- .pre-commit-config.yaml | 8 ++++++-- .pylintrc | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 632dc47446..19a59cead7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -258,7 +258,7 @@ repos: $ - repo: https://github.com/PyCQA/pylint.git - rev: v2.15.9 + rev: v3.1.0 hooks: - id: pylint additional_dependencies: @@ -267,11 +267,15 @@ repos: - jaraco.text - more_itertools - portend - - pylint-pytest < 1.1.0 + - pylint-pytest ~= 2.0.0a0 + - pyOpenSSL # needed by pylint-pytest since it picks up pytest's args - pypytools + - pytest-cov # needed by pylint-pytest since it picks up pytest's args + - pytest-xdist # needed by pylint-pytest since it picks up pytest's args - requests_toolbelt - requests_unixsocket - Sphinx + - trustme # needed by pylint-pytest since it picks up pytest's args - repo: local hooks: diff --git a/.pylintrc b/.pylintrc index 37ac11fd46..24a0751574 100644 --- a/.pylintrc +++ b/.pylintrc @@ -32,7 +32,10 @@ ignore-patterns= # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). -#init-hook= +# This patch injects the project directory into the import path so that the +# local `pytest` plugin can be imported when `pylint-pytest` invokes it when +# exploring the fixtures available: +init-hook="import os, sys; sys.path[:0] = [os.getcwd()]; os.environ['PYTHONPATH'] = sys.path[0]" # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the # number of processors available to use. @@ -635,7 +638,7 @@ preferred-modules= [EXCEPTIONS] # Exceptions that will emit a warning when being caught. Defaults to -# "BaseException, Exception". +# "builtins.BaseException, builtins.Exception". overgeneral-exceptions= - BaseException, - Exception, + builtins.BaseException, + builtins.Exception,