fix: clear all mypy errors

Annotate untyped containers and Optional attributes, type the stdlib-shaped
metric dicts in the client plugins, and add types-PyYAML/types-psutil to the
dev extras plus a mypy override for nio/mattermostdriver (no stubs).

Behaviour fixes found on the way: enable_kernel_timestamps() now returns False
when SO_TIMESTAMP is unknown instead of raising TypeError, send_shutdown is
defined at module level so cleanup() cannot hit a NameError, and a failed
subprocess returncode falls back to UNKNOWN.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 05:04:54 -04:00
co-authored by Claude Sonnet 5.5
parent 748349a7b9
commit 445ff6b474
20 changed files with 63 additions and 49 deletions
+4 -3
View File
@@ -8,6 +8,7 @@ import time
import json
import copy
import queue
from typing import Any, Dict
num = 0
@@ -24,7 +25,7 @@ def log(host, m):
class Connection:
# map of addrs to names
htab = {}
htab: Dict[str, Any] = {}
UNKNOWN = "unknown"
UP = "up"
DOWN = "down"
@@ -278,8 +279,8 @@ class Connection:
#
class Host:
# Table of Hosts
hosts = {}
dnsQ = queue.Queue()
hosts: Dict[str, "Host"] = {}
dnsQ: "queue.Queue[Any]" = queue.Queue()
def __init__(self, name):
global num