Skip to content

Commit 7056bf8

Browse files
committed
Fix unused imports
1 parent b663850 commit 7056bf8

23 files changed

+24
-35
lines changed

example/ui_showcase.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"""
2121
import random
2222
import enum
23-
from pathlib import Path
2423

2524
import markupsafe
2625

shc/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import inspect
1717
import logging
1818
import random
19-
from typing import Generic, List, Any, Tuple, Callable, Optional, Type, TypeVar, Awaitable, Union, Dict, Set
19+
from typing import Generic, List, Any, Tuple, Callable, Optional, Type, TypeVar, Awaitable, Union, Dict
2020

2121
from . import conversion
2222

shc/expressions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from . import conversion
2222
from .base import Readable, Subscribable, T, Connectable, Writable, S, LogicHandler, UninitializedError
23-
from .datatypes import RangeFloat1, RangeUInt8, HSVFloat1, RGBFloat1, RGBUInt8
23+
from .datatypes import RangeFloat1
2424

2525

2626
class ExpressionBuilder(Connectable[T], metaclass=abc.ABCMeta):

shc/interfaces/midi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import mido
1818

19-
from ..base import Subscribable, Writable, T
19+
from ..base import Subscribable, Writable
2020
from ..datatypes import RangeUInt8
2121
from ..supervisor import stop, AbstractInterface
2222

shc/interfaces/mqtt.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import itertools
1515
import json
1616
import logging
17-
from typing import List, Any, Generic, Type, Callable, Awaitable, Optional, Tuple, Union, Dict, Deque
17+
from typing import List, Any, Generic, Type, Callable, Awaitable, Optional, Union, Dict, Deque
1818

19-
from paho.mqtt.client import MQTTMessage, MQTTv311
19+
from paho.mqtt.client import MQTTMessage
2020
from asyncio_mqtt import Client, MqttError, ProtocolVersion
2121
from paho.mqtt.matcher import MQTTMatcher
2222

shc/interfaces/pulse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
if TYPE_CHECKING:
2020
from pulsectl import (
21-
PulseEventInfo, PulseSinkInfo, PulseSourceInfo, PulseServerInfo, PulseVolumeInfo)
21+
PulseEventInfo, PulseSinkInfo, PulseSourceInfo, PulseServerInfo)
2222
from pulsectl_asyncio import PulseAsync
2323

2424
import shc.conversion
25-
from shc.base import Connectable, Subscribable, Readable, T, UninitializedError, Writable
25+
from shc.base import Subscribable, Readable, T, UninitializedError, Writable
2626
from shc.datatypes import RangeFloat1, Balance
2727
from shc.interfaces._helper import SupervisedClientInterface
2828

shc/interfaces/shc_client.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from ._helper import SupervisedClientInterface
2121
from ..base import T, Subscribable, Writable, Readable, UninitializedError, Reading
2222
from ..conversion import SHCJsonEncoder, from_json
23-
from ..supervisor import register_interface, stop
2423

2524
logger = logging.getLogger(__name__)
2625

shc/interfaces/tasmota.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import json
1717
import logging
1818
import re
19-
import time
2019
from typing import List, Any, Dict, Deque, Generic, Union, Type, TypeVar, Tuple, cast, Optional, NamedTuple
2120

2221
from paho.mqtt.client import MQTTMessage

shc/interfaces/telegram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import asyncio
33
import logging
44
import re
5-
from typing import Generic, TypeVar, Set, Type, Optional, List, Pattern, Tuple, Dict, Any, Callable
5+
from typing import Generic, TypeVar, Set, Type, Optional, List, Dict, Any, Callable
66

77
import aiogram
88
from aiogram.bot.api import TelegramAPIServer, TELEGRAM_PRODUCTION

shc/log/file_persistence.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import asyncio
2-
import io
32
import json
43
import logging
5-
from typing import IO, Any, Dict, Tuple, Optional, Generic, List, Type
4+
from typing import Any, Dict, Tuple, Optional, Generic, List, Type
65
from pathlib import Path
76

87
import aiofile

shc/misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from typing import Generic, Type, List, Any, Optional, Callable, Dict, Awaitable
1515

1616
from shc import conversion
17-
from shc.base import Readable, Subscribable, Writable, handler, T, ConnectableWrapper, UninitializedError, Reading, S
17+
from shc.base import Readable, Subscribable, Writable, T, ConnectableWrapper, UninitializedError, Reading, S
1818
from shc.datatypes import RangeFloat1, FadeStep
1919
from shc.expressions import ExpressionWrapper
2020
from shc.timer import Every

shc/supervisor.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
# specific language governing permissions and limitations under the License.
1111
import abc
1212
import asyncio
13-
import collections
1413
import enum
1514
import functools
1615
import logging
1716
import signal
18-
from typing import Set, NamedTuple, Dict, Any, Union, Iterable, Deque, Tuple
17+
from typing import Set, NamedTuple, Iterable
1918

2019
from .base import Readable
2120
from .timer import timer_supervisor

shc/util/check_shc.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
import argparse
2222
import enum
2323
import json
24-
import re
2524
import sys
2625
import urllib.request
2726
import urllib.error
28-
from typing import NamedTuple, Optional, Tuple, NoReturn, List
27+
from typing import NoReturn
2928

3029

3130
def main() -> None:

shc/variables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import asyncio
1313
import logging
1414
import warnings
15-
from typing import Generic, Type, Optional, List, Any, Union, Dict, NamedTuple
15+
from typing import Generic, Type, Optional, List, Any, Union, Dict
1616

1717
from .base import Writable, T, Readable, Subscribable, UninitializedError, Reading
1818
from .expressions import ExpressionWrapper

shc/web/log_widgets.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import datetime
2-
from pathlib import Path
32
from typing import Iterable, Optional, Generic, Union, Callable, NamedTuple, Tuple, List
43

5-
import jinja2
64
from markupsafe import Markup
75

86
from ..log.generic import PersistenceVariable, LoggingRawWebUIView, AggregationMethod, LoggingAggregatedWebUIView

shc/web/widgets.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Michael Thies <[email protected]>
1+
# Copyright 2020-2022 Michael Thies <[email protected]>
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
44
# the License. You may obtain a copy of the License at

test/interfaces/test_midi.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import time
32
import unittest
43
import unittest.mock
@@ -7,7 +6,7 @@
76
import shc.interfaces.midi
87
from shc.datatypes import RangeUInt8
98

10-
from .._helper import InterfaceThreadRunner, AsyncMock
9+
from .._helper import InterfaceThreadRunner
1110

1211

1312
try:

test/interfaces/test_shc_client.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1010
# specific language governing permissions and limitations under the License.
1111
import asyncio
12-
import datetime
1312
import logging
1413
import unittest
1514
import unittest.mock
@@ -21,7 +20,7 @@
2120
import shc.web
2221
import shc.interfaces.shc_client
2322
from test._helper import ExampleReadable, InterfaceThreadRunner, ExampleWritable, ExampleSubscribable, async_test, \
24-
ClockMock, AsyncMock
23+
AsyncMock
2524

2625

2726
class ExampleType(NamedTuple):

test/interfaces/test_tasmota.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import datetime
32
import json
43
import shutil
54
import subprocess

test/test_interfaces_stub.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
class InterfaceImportTest(unittest.TestCase):
55
def test_knx(self):
6-
import shc.interfaces.knx
6+
import shc.interfaces.knx # noqa: F401
77

88
def test_dmx(self):
9-
import shc.interfaces.dmx
9+
import shc.interfaces.dmx # noqa: F401
1010

1111
def test_midi(self):
12-
import shc.interfaces.midi
12+
import shc.interfaces.midi # noqa: F401

test/test_timer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from typing import Optional, List
77

88
import shc.base
9-
from shc import timer, base, datatypes
10-
from ._helper import ClockMock, async_test, ExampleSubscribable, AsyncMock, ExampleWritable, ExampleReadable
9+
from shc import timer, datatypes
10+
from ._helper import ClockMock, async_test, ExampleSubscribable, ExampleWritable, ExampleReadable
1111

1212

1313
class LogarithmicSleepTest(unittest.TestCase):

test/test_variables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import mypy.api
99

1010
from shc import variables, base, expressions
11-
from ._helper import async_test, ExampleReadable, ExampleWritable, AsyncMock
11+
from ._helper import async_test, ExampleReadable, ExampleWritable
1212

1313

1414
class SimpleVariableTest(unittest.TestCase):

test/test_web.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import shc.web.widgets
2525
from shc.datatypes import RangeFloat1, RGBUInt8, RangeUInt8
2626
from shc.interfaces._helper import ReadableStatusInterface
27-
from shc.supervisor import AbstractInterface, InterfaceStatus, ServiceStatus
28-
from ._helper import InterfaceThreadRunner, ExampleReadable, AsyncMock, async_test
27+
from shc.supervisor import InterfaceStatus, ServiceStatus
28+
from ._helper import InterfaceThreadRunner, ExampleReadable, async_test
2929

3030

3131
class StatusTestInterface(ReadableStatusInterface):

0 commit comments

Comments
 (0)