From 5caa7bfa9096541de1247b5bc93cdc822867cf1c Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Thu, 6 Feb 2025 17:05:56 -0500 Subject: [PATCH] fix type checker and linter errors --- bumble/audio/io.py | 6 +++--- pyproject.toml | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bumble/audio/io.py b/bumble/audio/io.py index 702e991c..4a00f887 100644 --- a/bumble/audio/io.py +++ b/bumble/audio/io.py @@ -210,7 +210,7 @@ class SoundDeviceAudioOutput(ThreadedAudioOutput): self._stream: sounddevice.RawOutputStream | None = None async def open(self, pcm_format: PcmFormat) -> None: - import sounddevice + import sounddevice # pylint: disable=import-error self._stream = sounddevice.RawOutputStream( samplerate=pcm_format.sample_rate, @@ -298,7 +298,7 @@ class SubprocessAudioOutput(AudioOutput): def check_audio_input(input: str) -> bool: if input == 'device' or input.startswith('device:'): try: - import sounddevice + import sounddevice # pylint: disable=import-error except ImportError as exc: raise ValueError( 'audio input not available (sounddevice python module not installed)' @@ -511,7 +511,7 @@ class SoundDeviceAudioInput(ThreadedAudioInput): self._stream: sounddevice.RawInputStream | None = None def _open(self) -> PcmFormat: - import sounddevice + import sounddevice # pylint: disable=import-error self._stream = sounddevice.RawInputStream( samplerate=self._pcm_format.sample_rate, diff --git a/pyproject.toml b/pyproject.toml index 5d916168..872085a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -192,6 +192,10 @@ ignore_missing_imports = true module = "serial_asyncio.*" ignore_missing_imports = true +[[tool.mypy.overrides]] +module = "sounddevice.*" +ignore_missing_imports = true + [[tool.mypy.overrides]] module = "usb.*" ignore_missing_imports = true