diff --git a/pyproject.toml b/pyproject.toml index 74a4a37..0548285 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,6 +106,7 @@ warn_redundant_casts = true warn_return_any = true check_untyped_defs = true no_implicit_optional = true +disallow_untyped_defs = true [[tool.mypy.overrides]] # Third-party deps without inline type stubs. @@ -113,8 +114,9 @@ module = ["kokoro_onnx", "sounddevice", "soundfile"] ignore_missing_imports = true [[tool.mypy.overrides]] -# Tests use pytest-mock's mocker.patch which returns Any-heavy values; don't -# require full strictness there. +# Tests rely on pytest-mock's `mocker` (Any-heavy) and pytest fixtures with +# implicit Any-typed kwargs. Strict untyped-def bans buy little here, so +# tests stay on the looser config. module = "tests.*" disallow_untyped_defs = false diff --git a/stackvox/daemon.py b/stackvox/daemon.py index e25c5ac..299f126 100644 --- a/stackvox/daemon.py +++ b/stackvox/daemon.py @@ -130,7 +130,10 @@ def _read_default_device() -> int: last_device = [_read_default_device()] - def _on_device_change(obj_id: int, n: int, addrs, data) -> int: + def _on_device_change(obj_id: int, n: int, addrs: Any, data: Any) -> int: + # `addrs` is a ctypes.POINTER(_PropAddr); `data` is a c_void_p — neither + # is needed because we already know which property fired (only one is + # registered) and we re-read the device ID directly. try: current = _read_default_device() if current and current != last_device[0]: