diff --git a/docs/conf.py b/docs/conf.py index add10ce..4c9bb0e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,9 +13,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os -import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/hbmqtt/broker.py b/hbmqtt/broker.py index 6d5dcaf..b5c5b39 100644 --- a/hbmqtt/broker.py +++ b/hbmqtt/broker.py @@ -7,7 +7,7 @@ import websockets import asyncio import sys import re -from asyncio import Queue, CancelledError +from asyncio import CancelledError from collections import deque from functools import partial diff --git a/hbmqtt/client.py b/hbmqtt/client.py index a5bf8d9..b213ef5 100644 --- a/hbmqtt/client.py +++ b/hbmqtt/client.py @@ -14,7 +14,7 @@ from hbmqtt.mqtt.connect import * from hbmqtt.mqtt.protocol.client_handler import ClientProtocolHandler from hbmqtt.adapters import StreamReaderAdapter, StreamWriterAdapter, WebSocketsReader, WebSocketsWriter from hbmqtt.plugins.manager import PluginManager, BaseContext -from hbmqtt.mqtt.protocol.handler import EVENT_MQTT_PACKET_SENT, EVENT_MQTT_PACKET_RECEIVED, ProtocolHandlerException +from hbmqtt.mqtt.protocol.handler import ProtocolHandlerException from hbmqtt.mqtt.constants import * import websockets from websockets.uri import InvalidURI diff --git a/hbmqtt/mqtt/connack.py b/hbmqtt/mqtt/connack.py index a19f2b7..074fd8e 100644 --- a/hbmqtt/mqtt/connack.py +++ b/hbmqtt/mqtt/connack.py @@ -3,7 +3,7 @@ # See the file license.txt for copying permission. import asyncio from hbmqtt.mqtt.packet import CONNACK, MQTTPacket, MQTTFixedHeader, MQTTVariableHeader -from hbmqtt.codecs import int_to_bytes, read_or_raise, bytes_to_int +from hbmqtt.codecs import read_or_raise, bytes_to_int from hbmqtt.errors import HBMQTTException from hbmqtt.adapters import ReaderAdapter diff --git a/hbmqtt/mqtt/protocol/client_handler.py b/hbmqtt/mqtt/protocol/client_handler.py index d29767f..5e37f2f 100644 --- a/hbmqtt/mqtt/protocol/client_handler.py +++ b/hbmqtt/mqtt/protocol/client_handler.py @@ -5,7 +5,6 @@ import asyncio from asyncio import futures import sys from hbmqtt.mqtt.protocol.handler import ProtocolHandler, EVENT_MQTT_PACKET_RECEIVED -from hbmqtt.mqtt.packet import * from hbmqtt.mqtt.disconnect import DisconnectPacket from hbmqtt.mqtt.pingreq import PingReqPacket from hbmqtt.mqtt.pingresp import PingRespPacket diff --git a/hbmqtt/mqtt/subscribe.py b/hbmqtt/mqtt/subscribe.py index 1878aa9..0a2a9b2 100644 --- a/hbmqtt/mqtt/subscribe.py +++ b/hbmqtt/mqtt/subscribe.py @@ -2,7 +2,7 @@ # # See the file license.txt for copying permission. from hbmqtt.mqtt.packet import MQTTPacket, MQTTFixedHeader, SUBSCRIBE, PacketIdVariableHeader, MQTTPayload, MQTTVariableHeader -from hbmqtt.errors import HBMQTTException, MQTTException +from hbmqtt.errors import HBMQTTException from hbmqtt.codecs import * diff --git a/tests/plugins/test_manager.py b/tests/plugins/test_manager.py index 312e2ec..92e54cf 100644 --- a/tests/plugins/test_manager.py +++ b/tests/plugins/test_manager.py @@ -4,7 +4,7 @@ import unittest import logging import asyncio -from hbmqtt.plugins.manager import PluginManager, BaseContext +from hbmqtt.plugins.manager import PluginManager formatter = "[%(asctime)s] %(name)s {%(filename)s:%(lineno)d} %(levelname)s - %(message)s" logging.basicConfig(level=logging.INFO, format=formatter) diff --git a/tests/plugins/test_persistence.py b/tests/plugins/test_persistence.py index 580fbbf..de259d6 100644 --- a/tests/plugins/test_persistence.py +++ b/tests/plugins/test_persistence.py @@ -9,7 +9,6 @@ import asyncio import sqlite3 from hbmqtt.plugins.manager import BaseContext from hbmqtt.plugins.persistence import SQLitePlugin -from hbmqtt.session import Session formatter = "[%(asctime)s] %(name)s {%(filename)s:%(lineno)d} %(levelname)s - %(message)s" logging.basicConfig(level=logging.DEBUG, format=formatter) diff --git a/tests/test_broker.py b/tests/test_broker.py index 407fd1d..fa031df 100644 --- a/tests/test_broker.py +++ b/tests/test_broker.py @@ -2,7 +2,7 @@ # # See the file license.txt for copying permission. import unittest -from unittest.mock import patch, call, MagicMock +from unittest.mock import patch, call from hbmqtt.broker import * from hbmqtt.mqtt.constants import * from hbmqtt.client import MQTTClient, ConnectException diff --git a/tests/test_client.py b/tests/test_client.py index 0050385..905ade8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -8,7 +8,6 @@ import logging from hbmqtt.client import MQTTClient, ConnectException from hbmqtt.broker import Broker from hbmqtt.mqtt.constants import * -from hbmqtt.errors import HBMQTTException formatter = "[%(asctime)s] %(name)s {%(filename)s:%(lineno)d} %(levelname)s - %(message)s" logging.basicConfig(level=logging.ERROR, format=formatter) diff --git a/tox.ini b/tox.ini index a549f08..d6c9d0e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,5 @@ [flake8] ignore = - F401, # 'x' imported but unused (~12 warnings) F403, # 'from x import *' used; unable to detect undefined names (~29 warnings) F821, # undefined name 'x' (~1 warnings) F841, # local variable 'wildcard_pattern' is assigned to but never used (~17 warnings)