Skip to content

Commit 8fdc59a

Browse files
committed
[fix:py3.14] Struct fields aren't discovered in Python 3.14
This is a temporary workaround for #5284 [1]. However, the problem must be solved at a different level, in msgspec [2]. [1] #5284 [2] msgspec/msgspec#847 Signed-off-by: Markus Heiser <[email protected]>
1 parent d8d5de4 commit 8fdc59a

10 files changed

Lines changed: 32 additions & 0 deletions

File tree

‎searx/cache.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
----
66
"""
77

8+
# Struct fields aren't discovered in Python 3.14
9+
# - https://github.com/searxng/searxng/issues/5284
10+
from __future__ import annotations
11+
812
__all__ = ["ExpireCacheCfg", "ExpireCacheStats", "ExpireCache", "ExpireCacheSQLite"]
913

1014
import abc

‎searx/favicons/cache.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
1818
"""
1919

20+
# Struct fields aren't discovered in Python 3.14
21+
# - https://github.com/searxng/searxng/issues/5284
22+
from __future__ import annotations
23+
2024
import typing as t
2125

2226
import os

‎searx/favicons/config.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
22
# pylint: disable=missing-module-docstring
33

4+
# Struct fields aren't discovered in Python 3.14
5+
# - https://github.com/searxng/searxng/issues/5284
6+
from __future__ import annotations
47

58
import pathlib
69
import msgspec

‎searx/favicons/proxy.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# SPDX-License-Identifier: AGPL-3.0-or-later
22
"""Implementations for a favicon proxy"""
33

4+
# Struct fields aren't discovered in Python 3.14
5+
# - https://github.com/searxng/searxng/issues/5284
6+
from __future__ import annotations
47

58
from typing import Callable
69

‎searx/result_types/_base.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
:members:
1717
"""
1818

19+
# Struct fields aren't discovered in Python 3.14
20+
# - https://github.com/searxng/searxng/issues/5284
21+
from __future__ import annotations
22+
1923
__all__ = ["Result"]
2024

2125
import typing as t

‎searx/result_types/answer.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"""
2929
# pylint: disable=too-few-public-methods
3030

31+
# Struct fields aren't discovered in Python 3.14
32+
# - https://github.com/searxng/searxng/issues/5284
33+
from __future__ import annotations
3134

3235
__all__ = ["AnswerSet", "Answer", "Translations", "WeatherAnswer"]
3336

‎searx/result_types/code.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"""
1515
# pylint: disable=too-few-public-methods, disable=invalid-name
1616

17+
# Struct fields aren't discovered in Python 3.14
18+
# - https://github.com/searxng/searxng/issues/5284
1719
from __future__ import annotations
1820

1921
__all__ = ["Code"]

‎searx/result_types/keyvalue.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"""
1414
# pylint: disable=too-few-public-methods
1515

16+
# Struct fields aren't discovered in Python 3.14
17+
# - https://github.com/searxng/searxng/issues/5284
18+
from __future__ import annotations
1619

1720
__all__ = ["KeyValue"]
1821

‎searx/result_types/paper.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"""
2222
# pylint: disable=too-few-public-methods, disable=invalid-name
2323

24+
# Struct fields aren't discovered in Python 3.14
25+
# - https://github.com/searxng/searxng/issues/5284
2426
from __future__ import annotations
2527

2628
__all__ = ["Paper"]

‎searx/weather.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"""Implementations used for weather conditions and forecast."""
33
# pylint: disable=too-few-public-methods
44

5+
# Struct fields aren't discovered in Python 3.14
6+
# - https://github.com/searxng/searxng/issues/5284
7+
from __future__ import annotations
8+
59
__all__ = [
610
"symbol_url",
711
"Temperature",

0 commit comments

Comments
 (0)