From 860af28ca2dc1fe84c370bc1161db6fd8f410e6e Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 4 Sep 2026 16:45:38 -0400 Subject: [PATCH 1/3] fix: make mypy tolerant of optional integrations --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8d4f0a5..12aa3d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,6 +67,8 @@ strict = true packages = ["logsight"] follow_imports = "skip" disallow_untyped_decorators = false +ignore_missing_imports = true +warn_unused_ignores = false [tool.bandit] exclude_dirs = ["tests", "work"] From e92d5a6f878180dd4513614a1a230ee62245da41 Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 4 Sep 2026 16:45:44 -0400 Subject: [PATCH 2/3] fix: satisfy strict mypy return types --- logsight/storage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/logsight/storage.py b/logsight/storage.py index 5c1ca5b..3f1146f 100644 --- a/logsight/storage.py +++ b/logsight/storage.py @@ -9,7 +9,7 @@ import json import urllib.parse import urllib.request -from typing import Any +from typing import Any, cast class ClickHouseStore: @@ -26,7 +26,7 @@ def execute(self, query: str, data: str | None = None) -> bytes: method="POST", ) with urllib.request.urlopen(request, timeout=10) as response: # nosec B310 - return response.read() + return cast(bytes, response.read()) def insert_events(self, events: list[dict[str, Any]]) -> None: if not events: @@ -52,4 +52,4 @@ def upsert(self, points: list[dict[str, Any]]) -> dict[str, Any]: method="PUT", ) with urllib.request.urlopen(request, timeout=10) as response: # nosec B310 - return json.loads(response.read().decode()) + return cast(dict[str, Any], json.loads(response.read().decode())) From 049a143b162620feb280b28d569175f28312065d Mon Sep 17 00:00:00 2001 From: Corey Leath Date: Fri, 4 Sep 2026 16:45:53 -0400 Subject: [PATCH 3/3] fix: satisfy strict mypy webhook return type --- logsight/enterprise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logsight/enterprise.py b/logsight/enterprise.py index a3adc8f..9ea0934 100644 --- a/logsight/enterprise.py +++ b/logsight/enterprise.py @@ -144,6 +144,6 @@ def send(self, payload: dict[str, Any]) -> bool: ) try: with urllib.request.urlopen(request, timeout=self.timeout) as response: # nosec B310 - return 200 <= response.status < 300 + return bool(200 <= response.status < 300) except (OSError, ValueError): return False