From 5bbbe5e40fedd3946c223c5587fd5d750809fbb8 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Mon, 29 Dec 2025 16:09:27 -0600 Subject: [PATCH] Remove unused imports Mechanically remove unused imports with: ruff check --select F401 --fix --extend-exclude grpc_protobuf --- apps/auracast.py | 1 - apps/pair.py | 1 - bumble/core.py | 1 - bumble/device.py | 1 - bumble/pandora/__init__.py | 2 +- bumble/profiles/vcs.py | 2 +- bumble/smp.py | 11 +---------- bumble/utils.py | 1 - examples/battery_server.py | 1 - examples/device_information_server.py | 1 - examples/heart_rate_server.py | 1 - examples/keyboard.py | 1 - examples/run_advertiser.py | 1 - tests/gatt_test.py | 4 ---- tools/rtk_util.py | 2 +- web/heart_rate_monitor/heart_rate_monitor.py | 1 - 16 files changed, 4 insertions(+), 28 deletions(-) diff --git a/apps/auracast.py b/apps/auracast.py index 70e290b..10e4011 100644 --- a/apps/auracast.py +++ b/apps/auracast.py @@ -23,7 +23,6 @@ import contextlib import dataclasses import functools import logging -import struct from typing import Any, AsyncGenerator, Coroutine, Optional import click diff --git a/apps/pair.py b/apps/pair.py index 5b1a5e7..efb899f 100644 --- a/apps/pair.py +++ b/apps/pair.py @@ -18,7 +18,6 @@ import asyncio import logging import os -import struct import click from prompt_toolkit.shortcuts import PromptSession diff --git a/bumble/core.py b/bumble/core.py index 284184b..1d1b98a 100644 --- a/bumble/core.py +++ b/bumble/core.py @@ -21,7 +21,6 @@ import dataclasses import enum import struct from typing import ( - TYPE_CHECKING, Any, ClassVar, Iterable, diff --git a/bumble/device.py b/bumble/device.py index 557602c..a0cca4a 100644 --- a/bumble/device.py +++ b/bumble/device.py @@ -25,7 +25,6 @@ import itertools import json import logging import secrets -import sys from collections.abc import Iterable, Sequence from contextlib import AsyncExitStack, asynccontextmanager, closing from dataclasses import dataclass, field diff --git a/bumble/pandora/__init__.py b/bumble/pandora/__init__.py index eae328f..51ff248 100644 --- a/bumble/pandora/__init__.py +++ b/bumble/pandora/__init__.py @@ -19,7 +19,7 @@ This module implement the Pandora Bluetooth test APIs for the Bumble stack. __version__ = "0.0.1" -from typing import Callable, List, Optional +from typing import Callable, Optional import grpc import grpc.aio diff --git a/bumble/profiles/vcs.py b/bumble/profiles/vcs.py index bf1298a..8acd141 100644 --- a/bumble/profiles/vcs.py +++ b/bumble/profiles/vcs.py @@ -22,7 +22,7 @@ import dataclasses import enum from typing import Sequence -from bumble import att, device, gatt, gatt_adapters, gatt_client, utils +from bumble import att, device, gatt, gatt_adapters, gatt_client # ----------------------------------------------------------------------------- # Constants diff --git a/bumble/smp.py b/bumble/smp.py index ab56ce7..0005957 100644 --- a/bumble/smp.py +++ b/bumble/smp.py @@ -28,16 +28,7 @@ import asyncio import enum import logging from dataclasses import dataclass, field -from typing import ( - TYPE_CHECKING, - Any, - Awaitable, - Callable, - ClassVar, - Optional, - TypeVar, - cast, -) +from typing import TYPE_CHECKING, Awaitable, Callable, ClassVar, Optional, TypeVar, cast from bumble import crypto, utils from bumble.colors import color diff --git a/bumble/utils.py b/bumble/utils.py index 17bb6c3..115975a 100644 --- a/bumble/utils.py +++ b/bumble/utils.py @@ -22,7 +22,6 @@ import collections import enum import functools import logging -import sys import warnings from typing import ( Any, diff --git a/examples/battery_server.py b/examples/battery_server.py index ce5e056..70e8604 100644 --- a/examples/battery_server.py +++ b/examples/battery_server.py @@ -17,7 +17,6 @@ # ----------------------------------------------------------------------------- import asyncio import random -import struct import sys import bumble.logging diff --git a/examples/device_information_server.py b/examples/device_information_server.py index 4fc93e1..9d3bc6d 100644 --- a/examples/device_information_server.py +++ b/examples/device_information_server.py @@ -16,7 +16,6 @@ # Imports # ----------------------------------------------------------------------------- import asyncio -import struct import sys import bumble.logging diff --git a/examples/heart_rate_server.py b/examples/heart_rate_server.py index 8084510..67494df 100644 --- a/examples/heart_rate_server.py +++ b/examples/heart_rate_server.py @@ -15,7 +15,6 @@ import asyncio import math import random -import struct # ----------------------------------------------------------------------------- # Imports diff --git a/examples/keyboard.py b/examples/keyboard.py index e93de2c..34d5ce5 100644 --- a/examples/keyboard.py +++ b/examples/keyboard.py @@ -17,7 +17,6 @@ # ----------------------------------------------------------------------------- import asyncio import json -import struct import sys import websockets.asyncio.server diff --git a/examples/run_advertiser.py b/examples/run_advertiser.py index af01903..2049075 100644 --- a/examples/run_advertiser.py +++ b/examples/run_advertiser.py @@ -16,7 +16,6 @@ # Imports # ----------------------------------------------------------------------------- import asyncio -import struct import sys import bumble.logging diff --git a/tests/gatt_test.py b/tests/gatt_test.py index 8b3a295..ecb489d 100644 --- a/tests/gatt_test.py +++ b/tests/gatt_test.py @@ -38,7 +38,6 @@ from bumble.att import ( ErrorCode, Opcode, ) -from bumble.controller import Controller from bumble.core import UUID from bumble.device import Device, Peer from bumble.gatt import ( @@ -65,9 +64,6 @@ from bumble.gatt_adapters import ( UTF8CharacteristicProxyAdapter, ) from bumble.gatt_client import CharacteristicProxy -from bumble.host import Host -from bumble.link import LocalLink -from bumble.transport.common import AsyncPipeSink from .test_utils import Devices, TwoDevices, async_barrier diff --git a/tools/rtk_util.py b/tools/rtk_util.py index a9043f3..d340e3c 100644 --- a/tools/rtk_util.py +++ b/tools/rtk_util.py @@ -21,7 +21,7 @@ import logging import click import bumble.logging -from bumble import company_ids, hci, transport +from bumble import transport from bumble.drivers import rtk from bumble.host import Host diff --git a/web/heart_rate_monitor/heart_rate_monitor.py b/web/heart_rate_monitor/heart_rate_monitor.py index 4ba8ef5..36e5619 100644 --- a/web/heart_rate_monitor/heart_rate_monitor.py +++ b/web/heart_rate_monitor/heart_rate_monitor.py @@ -15,7 +15,6 @@ # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- -import struct from bumble import data_types from bumble.core import AdvertisingData