From ece62141ae3cfab29481053d295af90fe760921b Mon Sep 17 00:00:00 2001 From: the Mulhern Date: Mon, 28 Sep 2026 20:06:01 -0400 Subject: [PATCH 1/4] Add PyFlakes to ruff linter emulators Signed-off-by: the Mulhern Assisted-by: Claude:claude-sonnet-4-5 --- pyproject.toml | 2 +- src/dbus_python_client_gen/__init__.py | 28 ++++++++++++-------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 75d90c1..9981709 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ target-version = "py312" line-length = 88 [tool.ruff.lint] -select = ["PL"] +select = ["F", "PL"] [tool.ruff.lint.isort] known-first-party = ["into-dbus-python"] diff --git a/src/dbus_python_client_gen/__init__.py b/src/dbus_python_client_gen/__init__.py index acfd826..0f4f35e 100644 --- a/src/dbus_python_client_gen/__init__.py +++ b/src/dbus_python_client_gen/__init__.py @@ -5,18 +5,16 @@ Top-level classes and methods. """ -from ._errors import ( - DPClientError, - DPClientGenerationError, - DPClientGetPropertyContext, - DPClientInvalidArgError, - DPClientInvocationContext, - DPClientInvocationError, - DPClientKeywordError, - DPClientMarshallingError, - DPClientMethodCallContext, - DPClientRuntimeError, - DPClientSetPropertyContext, -) -from ._invokers import make_class -from ._version import __version__ +from ._errors import DPClientError as DPClientError +from ._errors import DPClientGenerationError as DPClientGenerationError +from ._errors import DPClientGetPropertyContext as DPClientGetPropertyContext +from ._errors import DPClientInvalidArgError as DPClientInvalidArgError +from ._errors import DPClientInvocationContext as DPClientInvocationContext +from ._errors import DPClientInvocationError as DPClientInvocationError +from ._errors import DPClientKeywordError as DPClientKeywordError +from ._errors import DPClientMarshallingError as DPClientMarshallingError +from ._errors import DPClientMethodCallContext as DPClientMethodCallContext +from ._errors import DPClientRuntimeError as DPClientRuntimeError +from ._errors import DPClientSetPropertyContext as DPClientSetPropertyContext +from ._invokers import make_class as make_class +from ._version import __version__ as __version__ From f880a1c3f1c59e4d52b491b9a3def4f5dc53a84f Mon Sep 17 00:00:00 2001 From: the Mulhern Date: Mon, 28 Sep 2026 20:10:25 -0400 Subject: [PATCH 2/4] Access attribute via . operator when name is known Signed-off-by: the Mulhern Assisted-by: Claude:claude-sonnet-4-5 --- tests/test_generated.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_generated.py b/tests/test_generated.py index 0cb16d0..7ca4887 100644 --- a/tests/test_generated.py +++ b/tests/test_generated.py @@ -51,7 +51,7 @@ def _test_property(self, klass, prop): self.assertTrue(hasattr(prop_klass, "Get")) with self.assertRaises(AttributeError): - getattr(prop_klass, "Get")(None) + prop_klass.Get(None) if "write" in access: self.assertTrue(hasattr(prop_klass, "Set")) @@ -63,14 +63,14 @@ def _test_property(self, klass, prop): pass else: with self.assertRaises(DPClientMarshallingError): - getattr(prop_klass, "Set")(None, None) + prop_klass.Set(None, None) if "readwrite" in access: self.assertTrue(hasattr(prop_klass, "Get")) self.assertTrue(hasattr(prop_klass, "Set")) with self.assertRaises(AttributeError): - getattr(prop_klass, "Get")(None) + prop_klass.Get(None) def _test_method(self, klass, method): """ @@ -95,8 +95,8 @@ def _test_klasses(self): self.assertTrue(hasattr(klass, "Properties")) self.assertTrue(hasattr(klass, "Methods")) - properties = getattr(klass, "Properties") - methods = getattr(klass, "Methods") + properties = klass.Properties + methods = klass.Methods for method in spec.findall("./method"): self._test_method(methods, method) From 09e318bce741e1ed79a0f185121878105d6c444f Mon Sep 17 00:00:00 2001 From: the Mulhern Date: Mon, 28 Sep 2026 20:13:20 -0400 Subject: [PATCH 3/4] Do not make DPClientInvocationContext abstract Doing so has no effect Signed-off-by: the Mulhern --- src/dbus_python_client_gen/_errors.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dbus_python_client_gen/_errors.py b/src/dbus_python_client_gen/_errors.py index 8b4ee3e..19aaa77 100644 --- a/src/dbus_python_client_gen/_errors.py +++ b/src/dbus_python_client_gen/_errors.py @@ -5,10 +5,8 @@ Exception hierarchy for this package. """ -from abc import ABC - -class DPClientInvocationContext(ABC): +class DPClientInvocationContext: """ Identifies the context in which an invocation error occurred. From 4fe97bd5d7392ab7881c4d6c9e162125cd6852c2 Mon Sep 17 00:00:00 2001 From: the Mulhern Date: Mon, 28 Sep 2026 20:14:03 -0400 Subject: [PATCH 4/4] Include bugbear among ruff linter emulators Signed-off-by: the Mulhern --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9981709..7db6fb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ target-version = "py312" line-length = 88 [tool.ruff.lint] -select = ["F", "PL"] +select = ["B", "F", "PL"] [tool.ruff.lint.isort] known-first-party = ["into-dbus-python"]