Skip to content

Commit 99d77fc

Browse files
committed
Properly import ThingServerInterface in thing
ThingServerInterface is used as a type hint for `Thing._thing_server_interface`. It was previously imported with an `if TYPE_CHECKING` guard, but as I've now explicitly type hinted and documented that attribute, any time `get_type_hints` is called on a `Thing` subclass (which is every time one is defined) it will cause an error. I've now imported it unconditionally, which fixes the problem. This does not cause any interdependency issues, as `thing_server_interface` has few onward dependencies.
1 parent 932b14f commit 99d77fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/labthings_fastapi/thing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
from .utilities.introspection import get_summary, get_docstring
3030
from .websockets import websocket_endpoint
3131
from .exceptions import PropertyNotObservableError
32+
from .thing_server_interface import ThingServerInterface
3233

3334

3435
if TYPE_CHECKING:
3536
from .server import ThingServer
3637
from .actions import ActionManager
37-
from .thing_server_interface import ThingServerInterface
3838

3939
_LOGGER = logging.getLogger(__name__)
4040

0 commit comments

Comments
 (0)