diff --git a/plumbum/colorlib/styles.py b/plumbum/colorlib/styles.py index 4aec1bf9..a2605334 100644 --- a/plumbum/colorlib/styles.py +++ b/plumbum/colorlib/styles.py @@ -16,7 +16,7 @@ import sys from abc import ABCMeta, abstractmethod from copy import copy -from typing import IO +from typing import IO, ClassVar from .names import ( FindNearest, @@ -343,7 +343,9 @@ class Style(metaclass=ABCMeta): """The class of color to use. Never hardcode ``Color`` call when writing a Style method.""" - attribute_names: dict[str, str] | dict[str, int] + # These must be defined by subclasses + # pylint: disable-next=declare-non-slot + attribute_names: ClassVar[dict[str, str] | dict[str, int]] _stdout: IO | None = None end = "\n" diff --git a/plumbum/commands/base.py b/plumbum/commands/base.py index 29638ce1..8511ec33 100644 --- a/plumbum/commands/base.py +++ b/plumbum/commands/base.py @@ -437,9 +437,11 @@ def verify(proc, retcode, timeout, stdout, stderr): class BaseRedirection(BaseCommand): __slots__ = ("cmd", "file") - SYM: ClassVar[str] - KWARG: ClassVar[str] - MODE: ClassVar[str] + + # These must be defined by subclasses + SYM: ClassVar[str] # pylint: disable=declare-non-slot + KWARG: ClassVar[str] # pylint: disable=declare-non-slot + MODE: ClassVar[str] # pylint: disable=declare-non-slot def __init__(self, cmd, file): self.cmd = cmd @@ -563,9 +565,11 @@ def popen(self, args=(), **kwargs): class ConcreteCommand(BaseCommand): - QUOTE_LEVEL: ClassVar[int] __slots__ = ("executable",) + # These must be defined by subclasses + QUOTE_LEVEL: ClassVar[int] # pylint: disable=declare-non-slot + def __init__(self, executable, encoding): self.executable = executable self.custom_encoding = encoding diff --git a/pyproject.toml b/pyproject.toml index 772b81d5..306a175a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,9 +125,9 @@ optional_tests = """ [tool.pylint] -master.py-version = "3.8" -master.jobs = "0" -master.load-plugins = ["pylint.extensions.no_self_use"] +py-version = "3.8" +jobs = "0" +load-plugins = ["pylint.extensions.no_self_use"] reports.output-format = "colorized" similarities.ignore-imports = "yes" messages_control.enable = [ @@ -162,6 +162,7 @@ messages_control.disable = [ "too-many-public-methods", "too-many-return-statements", "too-many-statements", + "too-many-positional-arguments", "unidiomatic-typecheck", # TODO: might be able to remove "unnecessary-lambda-assignment", # TODO: 4 instances "unused-import", # identical to flake8 but has typing false positives