diff --git a/requirements.txt b/requirements.txt index 78b7d1142..80f0bdb47 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,6 +14,5 @@ httpx-socks[asyncio]==0.7.7 setproctitle==1.3.3 redis==5.0.2 markdown-it-py==3.0.0 -typing_extensions==4.9.0 fasttext-predict==0.9.2.2 pytomlpp==1.0.13 diff --git a/searx/enginelib/traits.py b/searx/enginelib/traits.py index 6402fde22..16e320e75 100644 --- a/searx/enginelib/traits.py +++ b/searx/enginelib/traits.py @@ -14,8 +14,7 @@ from __future__ import annotations import json import dataclasses import types -from typing import Dict, Iterable, Union, Callable, Optional, TYPE_CHECKING -from typing_extensions import Literal, Self +from typing import Dict, Literal, Iterable, Union, Callable, TypeVar, Optional, TYPE_CHECKING from searx import locales from searx.data import data_dir, ENGINE_TRAITS @@ -24,6 +23,9 @@ if TYPE_CHECKING: from . import Engine +Self = TypeVar("Self", bound="EngineTraits") # Python 3.11, to replace by typing.Self + + class EngineTraitsEncoder(json.JSONEncoder): """Encodes :class:`EngineTraits` to a serializable object, see :class:`json.JSONEncoder`.""" diff --git a/searx/search/checker/background.py b/searx/search/checker/background.py index aec2a1790..f16e4c25c 100644 --- a/searx/search/checker/background.py +++ b/searx/search/checker/background.py @@ -8,8 +8,7 @@ import time import threading import os import signal -from typing import Dict, Union, List, Any, Tuple, Optional -from typing_extensions import TypedDict, Literal +from typing import Any, Dict, List, Literal, Optional, Tuple, TypedDict, Union import redis.exceptions