[mod] drop: from __future__ import annotations

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2025-08-24 15:16:46 +02:00 committed by Markus Heiser
parent 57b9673efb
commit f24d85bc4b
67 changed files with 15 additions and 68 deletions

View file

@ -38,7 +38,6 @@ area:
""" """
from __future__ import annotations
__all__ = ["AnswererInfo", "Answerer", "AnswerStorage"] __all__ = ["AnswererInfo", "Answerer", "AnswerStorage"]

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=too-few-public-methods, missing-module-docstring # pylint: disable=too-few-public-methods, missing-module-docstring
from __future__ import annotations
import abc import abc
import importlib import importlib

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring # pylint: disable=missing-module-docstring
from __future__ import annotations
import hashlib import hashlib
import random import random

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring # pylint: disable=missing-module-docstring
from __future__ import annotations
from functools import reduce from functools import reduce
from operator import mul from operator import mul

View file

@ -4,7 +4,7 @@
Implementations used for bot detection. Implementations used for bot detection.
""" """
from __future__ import annotations
__all__ = ["init", "dump_request", "get_network", "too_many_requests", "ProxyFix"] __all__ = ["init", "dump_request", "get_network", "too_many_requests", "ProxyFix"]

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring, invalid-name # pylint: disable=missing-module-docstring, invalid-name
from __future__ import annotations
import typing as t import typing as t
__all__ = ["log_error_only_once", "dump_request", "get_network", "logger", "too_many_requests"] __all__ = ["log_error_only_once", "dump_request", "get_network", "logger", "too_many_requests"]

View file

@ -6,7 +6,7 @@ The :py:class:`Config` class implements a configuration that is based on
structured dictionaries. The configuration schema is defined in a dictionary structured dictionaries. The configuration schema is defined in a dictionary
structure and the configuration data is given in a dictionary structure. structure and the configuration data is given in a dictionary structure.
""" """
from __future__ import annotations
import typing import typing
import copy import copy

View file

@ -13,7 +13,7 @@ Accept_ header ..
""" """
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -14,7 +14,7 @@ bot if the Accept-Encoding_ header ..
""" """
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -11,7 +11,7 @@ if the Accept-Language_ header is unset.
""" """
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -11,7 +11,7 @@ the Connection_ header is set to ``close``.
""" """
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -22,7 +22,7 @@ Metadata`_. A request is filtered out in case of:
""" """
# pylint: disable=unused-argument # pylint: disable=unused-argument
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -12,7 +12,7 @@ the User-Agent_ header is unset or matches the regular expression
""" """
from __future__ import annotations
import re import re
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,

View file

@ -36,7 +36,7 @@ dropped.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
""" """
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -25,7 +25,7 @@ The ``ip_lists`` method implements :py:obj:`block-list <block_ip>` and
""" """
# pylint: disable=unused-argument # pylint: disable=unused-argument
from __future__ import annotations
from typing import Tuple from typing import Tuple
from ipaddress import ( from ipaddress import (
ip_network, ip_network,

View file

@ -34,7 +34,7 @@ And in the HTML template from flask a stylesheet link is needed (the value of
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
""" """
from __future__ import annotations
from ipaddress import ( from ipaddress import (
IPv4Network, IPv4Network,
IPv6Network, IPv6Network,

View file

@ -3,7 +3,7 @@
(:py:obj:`flask.request.remote_addr`) behind a proxy chain.""" (:py:obj:`flask.request.remote_addr`) behind a proxy chain."""
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
from __future__ import annotations
import typing as t import typing as t
from collections import abc from collections import abc

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Providing a Valkey database for the botdetection methods.""" """Providing a Valkey database for the botdetection methods."""
from __future__ import annotations
import valkey import valkey

View file

@ -5,8 +5,6 @@
---- ----
""" """
from __future__ import annotations
__all__ = ["ExpireCacheCfg", "ExpireCacheStats", "ExpireCache", "ExpireCacheSQLite"] __all__ = ["ExpireCacheCfg", "ExpireCacheStats", "ExpireCache", "ExpireCacheSQLite"]
import abc import abc

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring # pylint: disable=missing-module-docstring
from __future__ import annotations
import pathlib import pathlib

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Simple implementation to store currencies data in a SQL database.""" """Simple implementation to store currencies data in a SQL database."""
from __future__ import annotations
__all__ = ["CurrenciesDB"] __all__ = ["CurrenciesDB"]

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Simple implementation to store TrackerPatterns data in a SQL database.""" """Simple implementation to store TrackerPatterns data in a SQL database."""
from __future__ import annotations
import typing import typing
__all__ = ["TrackerPatternsDB"] __all__ = ["TrackerPatternsDB"]

View file

@ -9,7 +9,6 @@ To load traits from the persistence :py:obj:`EngineTraitsMap.from_data` can be
used. used.
""" """
from __future__ import annotations
import os import os
import json import json

View file

@ -10,7 +10,6 @@ intended monkey patching of the engine modules.
engine modules aren't converted to an engine class, these builtin types will engine modules aren't converted to an engine class, these builtin types will
still be needed. still be needed.
""" """
from __future__ import annotations
import logging import logging
from searx.enginelib import traits as _traits from searx.enginelib import traits as _traits

View file

@ -8,7 +8,6 @@ usage::
""" """
from __future__ import annotations
import typing as t import typing as t
import sys import sys

View file

@ -35,7 +35,6 @@ Implementation
============== ==============
""" """
from __future__ import annotations
from datetime import datetime, timedelta from datetime import datetime, timedelta
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -65,7 +65,6 @@ code lines are just relabeled (starting from 1) and appended (a disjoint set of
code blocks in a single file might be returned from the API). code blocks in a single file might be returned from the API).
""" """
from __future__ import annotations
import typing as t import typing as t
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -11,7 +11,6 @@
.. _data URLs: .. _data URLs:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
""" """
from __future__ import annotations
from urllib.parse import urlencode, urlparse, parse_qs from urllib.parse import urlencode, urlparse, parse_qs
from lxml import html from lxml import html

View file

@ -7,7 +7,6 @@ No public instance offer a public API now
- https://github.com/searxng/searxng/issues/2722#issuecomment-2884993248 - https://github.com/searxng/searxng/issues/2722#issuecomment-2884993248
""" """
from __future__ import annotations
import time import time
import random import random

View file

@ -26,7 +26,6 @@ Implementations
=============== ===============
""" """
from __future__ import annotations
import typing as t import typing as t
from urllib.parse import urlencode, quote_plus from urllib.parse import urlencode, quote_plus

View file

@ -37,7 +37,6 @@ Implementations
=============== ===============
""" """
from __future__ import annotations
import re import re

View file

@ -3,7 +3,6 @@
# #
# Engine is documented in: docs/dev/engines/online/openalex.rst # Engine is documented in: docs/dev/engines/online/openalex.rst
from __future__ import annotations
import typing as t import typing as t
from datetime import datetime from datetime import datetime

View file

@ -45,7 +45,6 @@ Implementations
=============== ===============
""" """
from __future__ import annotations
import time import time
import random import random

View file

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""SoundCloud is a German audio streaming service.""" """SoundCloud is a German audio streaming service."""
from __future__ import annotations
import re import re
import datetime import datetime

View file

@ -74,7 +74,6 @@ Implementations
=============== ===============
""" """
from __future__ import annotations
from urllib.parse import urlencode from urllib.parse import urlencode
from dateutil.parser import parse from dateutil.parser import parse

View file

@ -3,7 +3,6 @@
Wolfram|Alpha (Science) Wolfram|Alpha (Science)
""" """
from __future__ import annotations
from json import loads from json import loads
from urllib.parse import urlencode from urllib.parse import urlencode

View file

@ -51,7 +51,6 @@ Implementations
""" """
# pylint: disable=fixme # pylint: disable=fixme
from __future__ import annotations
import random import random
from json import loads from json import loads

View file

@ -20,7 +20,6 @@
""" """
# pylint: disable=invalid-name # pylint: disable=invalid-name
from __future__ import annotations
__all__ = ["SXNG_Request", "sxng_request", "SXNG_Response"] __all__ = ["SXNG_Request", "sxng_request", "SXNG_Response"]

View file

@ -8,7 +8,6 @@ an example in which the command line is called in the development environment::
(py3) python -m searx.favicons --help (py3) python -m searx.favicons --help
""" """
from __future__ import annotations
__all__ = ["init", "favicon_url", "favicon_proxy"] __all__ = ["init", "favicon_url", "favicon_proxy"]

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring # pylint: disable=missing-module-docstring
from __future__ import annotations
import pathlib import pathlib
import msgspec import msgspec

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Implementations for a favicon proxy""" """Implementations for a favicon proxy"""
from __future__ import annotations
from typing import Callable from typing import Callable

View file

@ -6,7 +6,6 @@ timeout``) and returns a tuple ``(data, mime)``.
""" """
from __future__ import annotations
__all__ = ["DEFAULT_RESOLVER_MAP", "allesedv", "duckduckgo", "google", "yandex"] __all__ = ["DEFAULT_RESOLVER_MAP", "allesedv", "duckduckgo", "google", "yandex"]

View file

@ -92,7 +92,6 @@ Implementation
""" """
from __future__ import annotations
from ipaddress import ip_address from ipaddress import ip_address
import sys import sys

View file

@ -26,7 +26,6 @@ SearXNGs locale implementations
================================ ================================
""" """
from __future__ import annotations
import typing as t import typing as t
from pathlib import Path from pathlib import Path

View file

@ -94,7 +94,6 @@ Implementation
:members: :members:
""" """
from __future__ import annotations
__all__ = ["PluginInfo", "Plugin", "PluginStorage", "PluginCfg"] __all__ = ["PluginInfo", "Plugin", "PluginStorage", "PluginCfg"]

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=too-few-public-methods,missing-module-docstring # pylint: disable=too-few-public-methods,missing-module-docstring
from __future__ import annotations
__all__ = ["PluginInfo", "Plugin", "PluginCfg", "PluginStorage"] __all__ = ["PluginInfo", "Plugin", "PluginCfg", "PluginStorage"]

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Calculate mathematical expressions using :py:obj:`ast.parse` (mode="eval").""" """Calculate mathematical expressions using :py:obj:`ast.parse` (mode="eval")."""
from __future__ import annotations
import typing import typing
import ast import ast

View file

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring, missing-class-docstring # pylint: disable=missing-module-docstring, missing-class-docstring
from __future__ import annotations
import typing import typing
import re import re

View file

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring # pylint: disable=missing-module-docstring
from __future__ import annotations
import typing import typing
import re import re

View file

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring, missing-class-docstring # pylint: disable=missing-module-docstring, missing-class-docstring
from __future__ import annotations
import typing import typing
import re import re

View file

@ -4,7 +4,6 @@ user searches for ``tor-check``. It fetches the tor exit node list from
:py:obj:`url_exit_list` and parses all the IPs into a list, then checks if the :py:obj:`url_exit_list` and parses all the IPs into a list, then checks if the
user's IP address is in it. user's IP address is in it.
""" """
from __future__ import annotations
from ipaddress import ip_address from ipaddress import ip_address
import typing import typing

View file

@ -8,7 +8,6 @@ converters, each converter is one item in the list (compare
of measurement are evaluated. The weighting in the evaluation results from the of measurement are evaluated. The weighting in the evaluation results from the
sorting of the :py:obj:`list of unit converters<symbol_to_si>`. sorting of the :py:obj:`list of unit converters<symbol_to_si>`.
""" """
from __future__ import annotations
import typing import typing
import re import re
import babel.numbers import babel.numbers

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Searx preferences implementation. """Searx preferences implementation.
""" """
from __future__ import annotations
# pylint: disable=useless-object-inheritance # pylint: disable=useless-object-inheritance

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=invalid-name, missing-module-docstring, missing-class-docstring # pylint: disable=invalid-name, missing-module-docstring, missing-class-docstring
from __future__ import annotations
from abc import abstractmethod, ABC from abc import abstractmethod, ABC
import re import re

View file

@ -11,7 +11,6 @@
""" """
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
from __future__ import annotations
__all__ = [ __all__ = [
"Result", "Result",

View file

@ -28,7 +28,6 @@ template.
""" """
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
from __future__ import annotations
__all__ = ["AnswerSet", "Answer", "Translations", "WeatherAnswer"] __all__ = ["AnswerSet", "Answer", "Translations", "WeatherAnswer"]

View file

@ -13,7 +13,6 @@ template.
""" """
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
from __future__ import annotations
__all__ = ["KeyValue"] __all__ = ["KeyValue"]

View file

@ -17,7 +17,6 @@ to be loaded. The rules used for this can be found in the
""" """
from __future__ import annotations
import typing as t import typing as t
import os.path import os.path
from collections.abc import MutableMapping from collections.abc import MutableMapping

View file

@ -19,7 +19,6 @@ Examplarical implementations based on :py:obj:`SQLiteAppl`:
---- ----
""" """
from __future__ import annotations
import typing as t import typing as t
import abc import abc

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Utility functions for the engines""" """Utility functions for the engines"""
from __future__ import annotations
import re import re
import importlib import importlib

View file

@ -17,7 +17,6 @@ A valkey DB connect can be tested by::
>>> >>>
""" """
from __future__ import annotations
import os import os
import pwd import pwd

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""Implementations used for weather conditions and forecast.""" """Implementations used for weather conditions and forecast."""
# pylint: disable=too-few-public-methods # pylint: disable=too-few-public-methods
from __future__ import annotations
__all__ = [ __all__ = [
"symbol_url", "symbol_url",

View file

@ -2,7 +2,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
"""WebApp""" """WebApp"""
# pylint: disable=use-dict-literal # pylint: disable=use-dict-literal
from __future__ import annotations
import json import json
import os import os

View file

@ -1,7 +1,6 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
# pylint: disable=missing-module-docstring, invalid-name # pylint: disable=missing-module-docstring, invalid-name
from __future__ import annotations
import os import os
import pathlib import pathlib

View file

@ -5,7 +5,6 @@ Coordinates`_
.. _SPARQL/WIKIDATA Precision, Units and Coordinates: .. _SPARQL/WIKIDATA Precision, Units and Coordinates:
https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates#Quantities https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates#Quantities
""" """
from __future__ import annotations
__all__ = ["convert_from_si", "convert_to_si", "symbol_to_si"] __all__ = ["convert_from_si", "convert_to_si", "symbol_to_si"]

View file

@ -7,7 +7,6 @@
- :py:obj:`searx.locales.LOCALE_NAMES` - :py:obj:`searx.locales.LOCALE_NAMES`
""" """
# pylint: disable=invalid-name # pylint: disable=invalid-name
from __future__ import annotations
from typing import Set from typing import Set
import json import json

View file

@ -3,7 +3,6 @@
"""Test some code from module :py:obj:`searx.locales`""" """Test some code from module :py:obj:`searx.locales`"""
from __future__ import annotations
from parameterized import parameterized from parameterized import parameterized
from searx import locales from searx import locales
from searx.sxng_locales import sxng_locales from searx.sxng_locales import sxng_locales