From bd30b655fd1b8ae4f52777b8fef1a7d13e8a7f88 Mon Sep 17 00:00:00 2001 From: shouzy <82171453+realshouzy@users.noreply.github.com> Date: Wed, 24 Jan 2024 22:33:34 +0100 Subject: [PATCH] Use override decorator --- pip_review/_main.py | 6 ++++++ pyproject.toml | 3 +++ requirements.txt | 1 + 3 files changed, 10 insertions(+) diff --git a/pip_review/_main.py b/pip_review/_main.py index 6d4bf602..15758f3c 100755 --- a/pip_review/_main.py +++ b/pip_review/_main.py @@ -24,6 +24,11 @@ VERSION_PATTERN, ) +if sys.version_info >= (3, 12): # pragma: >=3.12 cover + from typing import override +else: # pragma: <3.12 cover + from typing_extensions import override + if TYPE_CHECKING: import re from collections.abc import Callable @@ -112,6 +117,7 @@ def _filter_forwards(args: list[str], exclude: set[str]) -> list[str]: class StdOutFilter(logging.Filter): + @override def filter(self, record: logging.LogRecord) -> bool: return record.levelno in {logging.DEBUG, logging.INFO} diff --git a/pyproject.toml b/pyproject.toml index a6bb5bc3..a3b8797c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,9 @@ ignore = [ "ERA001", "EM101", "TRY003", + "D107", + "UP035", + "UP036", ] fixable = ["ALL"] unfixable = [] diff --git a/requirements.txt b/requirements.txt index 748809f7..ce4cb6b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ packaging +typing_extensions>=4.6.0;python_version<"3.12"