Skip to content

Commit 3963c23

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

7 files changed

Lines changed: 28 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
"""
2929
# pylint: disable=too-few-public-methods
3030

31+
# Struct fields aren't discovered in Python 3.14 #847
32+
# - https://github.com/jcrist/msgspec/issues/847#issuecomment-2880915442
33+
# - https://github.com/jcrist/msgspec/issues/651
34+
# - https://github.com/beartype/beartype/discussions/479
35+
36+
from __future__ import annotations
3137

3238
__all__ = ["AnswerSet", "Answer", "Translations", "WeatherAnswer"]
3339

‎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)