mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-05-20 22:20:43 +02:00
fix: flake8 errors
This commit is contained in:
parent
f948605b58
commit
fe5b6c591d
@ -1,8 +1,15 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from abc import ABC
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Dict # noqa
|
||||
else:
|
||||
Dict = dict
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .callback_manager import CallbackManager
|
||||
from .data_service import DataService
|
||||
@ -13,4 +20,4 @@ class AbstractDataService(ABC):
|
||||
__root__: DataService
|
||||
_task_manager: TaskManager
|
||||
_callback_manager: CallbackManager
|
||||
_autostart_tasks: dict[str, tuple[Any]]
|
||||
_autostart_tasks: Dict[str, tuple[Any]]
|
||||
|
@ -4,10 +4,12 @@ import inspect
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Callable # noqa
|
||||
from typing import Callable, Dict # noqa
|
||||
else:
|
||||
from collections.abc import Callable
|
||||
|
||||
Dict = dict
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Union
|
||||
|
||||
from loguru import logger
|
||||
@ -43,7 +45,7 @@ class CallbackManager:
|
||||
This implementation follows the observer pattern, with the DataService instance as
|
||||
the "subject" and the callback functions as the "observers".
|
||||
"""
|
||||
_list_mapping: dict[int, DataServiceList] = {}
|
||||
_list_mapping: Dict[int, DataServiceList] = {}
|
||||
"""
|
||||
A dictionary mapping the id of the original lists to the corresponding
|
||||
DataServiceList instances.
|
||||
|
@ -2,8 +2,15 @@ import asyncio
|
||||
import inspect
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from enum import Enum
|
||||
from typing import Any, Dict, List, Optional, cast, get_type_hints
|
||||
from typing import Any, Optional, cast, get_type_hints
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Dict, List # noqa
|
||||
else:
|
||||
Dict = dict
|
||||
List = list
|
||||
|
||||
import rpyc
|
||||
from loguru import logger
|
||||
|
@ -1,11 +1,13 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 10):
|
||||
from typing import Callable
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Callable, List # noqa
|
||||
else:
|
||||
from collections.abc import Callable
|
||||
|
||||
from typing import Any, List, Union
|
||||
List = list
|
||||
|
||||
from typing import Any, Union
|
||||
|
||||
from pydase.utils.warnings import (
|
||||
warn_if_instance_class_does_not_inherit_from_DataService,
|
||||
|
@ -1,11 +1,19 @@
|
||||
import asyncio
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
import threading
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from enum import Enum
|
||||
from types import FrameType
|
||||
from typing import Any, Dict, List, Optional, Protocol, Type, TypedDict, Union
|
||||
from typing import Any, Optional, Protocol, TypedDict, Union
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Dict, List, Type # noqa
|
||||
else:
|
||||
Dict = dict
|
||||
List = list
|
||||
Type = type
|
||||
|
||||
import uvicorn
|
||||
from loguru import logger
|
||||
|
@ -1,5 +1,11 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, TypedDict, Union
|
||||
from typing import Any, TypedDict, Union
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Dict # noqa
|
||||
else:
|
||||
Dict = dict
|
||||
|
||||
import socketio
|
||||
from fastapi import FastAPI
|
||||
|
@ -1,6 +1,14 @@
|
||||
import re
|
||||
import sys
|
||||
from itertools import chain
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union, cast
|
||||
from typing import Any, Optional, Union, cast
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from typing import Dict, List, Tuple # noqa
|
||||
else:
|
||||
Dict = dict
|
||||
List = list
|
||||
Tuple = tuple
|
||||
|
||||
from loguru import logger
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user