Merge staging-next into staging
This commit is contained in:
@@ -105,6 +105,11 @@ clangStdenv.mkDerivation (finalAttrs: {
|
||||
postPatch = ''
|
||||
substituteInPlace src/ver/CMakeLists.txt \
|
||||
--replace-fail '"1.x-dev"' '"${finalAttrs.version}"'
|
||||
|
||||
# Using substituteInPlace because no upstream patch for GCC 15 was found for this bundled library.
|
||||
substituteInPlace third_party/json11/json11.cpp \
|
||||
--replace-fail "#include <cmath>" "#include <cmath>
|
||||
#include <cstdint>"
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Generated by debian-patches.sh from debian-patches.txt
|
||||
let
|
||||
prefix = "https://sources.debian.org/data/main/n/nvi/1.81.6-23/debian/patches";
|
||||
prefix = "https://sources.debian.org/data/main/n/nvi/1.81.6-24/debian/patches";
|
||||
in
|
||||
[
|
||||
{
|
||||
@@ -167,4 +167,8 @@ in
|
||||
url = "${prefix}/0041-Fix-FTBFS-because-of-incompatible-pointer-type-error.patch";
|
||||
sha256 = "1qvzrxfbk3ylr6cc3y94rlgfbdj2z14dhh6m09drkxb4bqcp2awv";
|
||||
}
|
||||
{
|
||||
url = "${prefix}/0042-Fix-ftbfs-with-GCC-15.patch";
|
||||
sha256 = "13v5ydsnmbfqww2j8v13r83iz9zkk2z5wd9qccz7sb5wzm32zs59";
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
nvi/1.81.6-23
|
||||
nvi/1.81.6-24
|
||||
01additional_upstream_data.patch
|
||||
03db4.patch
|
||||
04confdefs.patch
|
||||
@@ -40,3 +40,4 @@ upstream/0038-Fix-A-word-search-for-keywords-starting-with-a-non-w.patch
|
||||
0039-Add-function-prototypes-to-fix-implicit-function-dec.patch
|
||||
0040-Add-more-function-prototypes-to-fix-Wimplicit-functi.patch
|
||||
0041-Fix-FTBFS-because-of-incompatible-pointer-type-error.patch
|
||||
0042-Fix-ftbfs-with-GCC-15.patch
|
||||
|
||||
@@ -41,6 +41,16 @@ clangStdenv.mkDerivation (finalAttrs: {
|
||||
python3
|
||||
];
|
||||
|
||||
# Using substituteInPlace because no clean upstream backport for GCC 15 exists for this version of Skia, newer versions fix this with large refactorings.
|
||||
postPatch = ''
|
||||
substituteInPlace include/private/SkSLProgramKind.h \
|
||||
--replace-fail "#include <cinttypes>" "#include <cinttypes>
|
||||
#include <cstdint>"
|
||||
substituteInPlace src/sksl/transform/SkSLTransform.h \
|
||||
--replace-fail "#include <vector>" "#include <vector>
|
||||
#include <cstdint>"
|
||||
'';
|
||||
|
||||
preConfigure = with depSrcs; ''
|
||||
mkdir -p third_party/externals
|
||||
ln -s ${angle2} third_party/externals/angle2
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
autoreconfHook,
|
||||
ant,
|
||||
jdk,
|
||||
@@ -75,6 +76,18 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
chmod -R 755 $IVY_HOME
|
||||
'';
|
||||
|
||||
patches = [
|
||||
# Fix build with gcc 15
|
||||
(fetchpatch {
|
||||
url = "https://github.com/sleuthkit/sleuthkit/commit/8d710c36a947a2666bbef689155831d76fff56b9.patch";
|
||||
hash = "sha256-/mCal0EVTM2dM5ok3OmAXQ1HiaCUi0lmhavIuwxVEMA=";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/sleuthkit/sleuthkit/commit/f78bd37db6be72f8f4d444d124be4e26488dce4b.patch";
|
||||
hash = "sha256-ZEeN0jp5cRi6dOpWlcGYm0nLLu5b56ivdR+WrhnhCz0=";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace tsk/img/ewf.cpp --replace libewf_handle_read_random libewf_handle_read_buffer_at_offset
|
||||
'';
|
||||
|
||||
@@ -27,6 +27,8 @@ buildPythonPackage rec {
|
||||
|
||||
patches = [
|
||||
./marshmallow-4.0-compat.patch
|
||||
# https://github.com/lidatong/dataclasses-json/pull/565
|
||||
./python-3.14-compat.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
From 20799887ff1d50dc6ca5d90bc1038ff5160b97f3 Mon Sep 17 00:00:00 2001
|
||||
From: "paul@iqmo.com" <paul@iqmo.com>
|
||||
Date: Tue, 19 Aug 2025 21:38:21 -0400
|
||||
Subject: [PATCH 3/8] fix 3.14 / PEP649, but maintain bw compat
|
||||
|
||||
---
|
||||
dataclasses_json/core.py | 40 +++++++++++++++++++++++++++++-
|
||||
dataclasses_json/undefined.py | 3 ++-
|
||||
tests/test_undefined_parameters.py | 36 +++++++++++++++++++++++++++
|
||||
3 files changed, 77 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dataclasses_json/core.py b/dataclasses_json/core.py
|
||||
index 69f51a3a..313e2615 100644
|
||||
--- a/dataclasses_json/core.py
|
||||
+++ b/dataclasses_json/core.py
|
||||
@@ -18,6 +18,7 @@
|
||||
from uuid import UUID
|
||||
|
||||
from typing_inspect import is_union_type # type: ignore
|
||||
+import typing
|
||||
|
||||
from dataclasses_json import cfg
|
||||
from dataclasses_json.utils import (_get_type_cons, _get_type_origin,
|
||||
@@ -44,6 +45,43 @@
|
||||
Set: frozenset,
|
||||
})
|
||||
|
||||
+PEP649 = sys.version_info >= (3, 14)
|
||||
+
|
||||
+if PEP649:
|
||||
+ import inspect
|
||||
+
|
||||
+def _safe_get_type_hints(c, **kwargs):
|
||||
+
|
||||
+ if not PEP649:
|
||||
+ # not running under PEP 649 (future/deferred annotations),
|
||||
+ return typing.get_type_hints(c, include_extras=True, **kwargs)
|
||||
+
|
||||
+ else:
|
||||
+ if not isinstance(c, type):
|
||||
+ # If we're passed an instance instead of a class, normalize to its type
|
||||
+ c = c.__class__
|
||||
+ if "." not in getattr(c, "__qualname__", ""):
|
||||
+ # If this is a *top-level class* (no "." in __qualname__),
|
||||
+ # typing.get_type_hints works fine even under PEP 649.
|
||||
+ return typing.get_type_hints(c, include_extras=True, **kwargs)
|
||||
+ else:
|
||||
+ # Otherwise, this is a *nested class* (defined inside another class or function),
|
||||
+ # where typing.get_type_hints may fail under PEP 649.
|
||||
+ ann = {}
|
||||
+
|
||||
+ # First collect annotations from bases in the MRO
|
||||
+ for base in reversed(c.__mro__[:-1]):
|
||||
+ ann.update(inspect.get_annotations(base, format=inspect.Format.VALUE) or {})
|
||||
+
|
||||
+ # For the class itself, use FORWARDREF format to keep "Self"/recursive types intact
|
||||
+ ann.update(inspect.get_annotations(c, format=inspect.Format.FORWARDREF) or {})
|
||||
+
|
||||
+ if ann:
|
||||
+ return ann
|
||||
+ else:
|
||||
+ return {f.name: f.type for f in fields(c)}
|
||||
+
|
||||
+
|
||||
|
||||
class _ExtendedEncoder(json.JSONEncoder):
|
||||
def default(self, o) -> Json:
|
||||
@@ -175,7 +213,7 @@ def _decode_dataclass(cls, kvs, infer_missing):
|
||||
kvs = _handle_undefined_parameters_safe(cls, kvs, usage="from")
|
||||
|
||||
init_kwargs = {}
|
||||
- types = get_type_hints(cls)
|
||||
+ types = _safe_get_type_hints(cls)
|
||||
for field in fields(cls):
|
||||
# The field should be skipped from being added
|
||||
# to init_kwargs as it's not intended as a constructor argument.
|
||||
diff --git a/dataclasses_json/undefined.py b/dataclasses_json/undefined.py
|
||||
index cb8b2cfc..a94b4718 100644
|
||||
--- a/dataclasses_json/undefined.py
|
||||
+++ b/dataclasses_json/undefined.py
|
||||
@@ -7,6 +7,7 @@
|
||||
from typing import Any, Callable, Dict, Optional, Tuple, Union, Type, get_type_hints
|
||||
from enum import Enum
|
||||
|
||||
+from .core import _safe_get_type_hints
|
||||
from marshmallow.exceptions import ValidationError # type: ignore
|
||||
|
||||
from dataclasses_json.utils import CatchAllVar
|
||||
@@ -248,7 +249,7 @@ def _catch_all_init(self, *args, **kwargs):
|
||||
@staticmethod
|
||||
def _get_catch_all_field(cls) -> Field:
|
||||
cls_globals = vars(sys.modules[cls.__module__])
|
||||
- types = get_type_hints(cls, globalns=cls_globals)
|
||||
+ types = _safe_get_type_hints(cls, globalns=cls_globals)
|
||||
catch_all_fields = list(
|
||||
filter(lambda f: types[f.name] == Optional[CatchAllVar], fields(cls)))
|
||||
number_of_catch_all_fields = len(catch_all_fields)
|
||||
diff --git a/tests/test_undefined_parameters.py b/tests/test_undefined_parameters.py
|
||||
index bac711af..6bd33406 100644
|
||||
--- a/tests/test_undefined_parameters.py
|
||||
+++ b/tests/test_undefined_parameters.py
|
||||
@@ -221,6 +221,42 @@ class Boss:
|
||||
assert json.loads(boss_json) == Boss.schema().dump(boss)
|
||||
assert "".join(boss_json.replace('\n', '').split()) == "".join(Boss.schema().dumps(boss).replace('\n', '').split())
|
||||
|
||||
+@dataclass_json(undefined=Undefined.INCLUDE)
|
||||
+@dataclass(frozen=True)
|
||||
+class Minion2:
|
||||
+ name: str
|
||||
+ catch_all: CatchAll
|
||||
+
|
||||
+@dataclass_json(undefined=Undefined.INCLUDE)
|
||||
+@dataclass(frozen=True)
|
||||
+class Boss2:
|
||||
+ minions: List[Minion2]
|
||||
+ catch_all: CatchAll
|
||||
+
|
||||
+def test_undefined_parameters_catch_all_schema_roundtrip2(boss_json):
|
||||
+ boss1 = Boss2.schema().loads(boss_json)
|
||||
+ dumped_s = Boss2.schema().dumps(boss1)
|
||||
+ boss2 = Boss2.schema().loads(dumped_s)
|
||||
+ assert boss1 == boss2
|
||||
+
|
||||
+
|
||||
+def test_undefined_parameters_catch_all_schema_roundtrip(boss_json):
|
||||
+ @dataclass_json(undefined=Undefined.INCLUDE)
|
||||
+ @dataclass(frozen=True)
|
||||
+ class Minion:
|
||||
+ name: str
|
||||
+ catch_all: CatchAll
|
||||
+
|
||||
+ @dataclass_json(undefined=Undefined.INCLUDE)
|
||||
+ @dataclass(frozen=True)
|
||||
+ class Boss:
|
||||
+ minions: List[Minion]
|
||||
+ catch_all: CatchAll
|
||||
+
|
||||
+ boss1 = Boss.schema().loads(boss_json)
|
||||
+ dumped_s = Boss.schema().dumps(boss1)
|
||||
+ boss2 = Boss.schema().loads(dumped_s)
|
||||
+ assert boss1 == boss2
|
||||
|
||||
def test_undefined_parameters_catch_all_schema_roundtrip(boss_json):
|
||||
@dataclass_json(undefined=Undefined.INCLUDE)
|
||||
|
||||
@@ -54,6 +54,16 @@ buildPythonPackage rec {
|
||||
url = "https://github.com/tpm2-software/tpm2-pytss/commit/afdee627d0639eb05711a2191f2f76e460793da9.patch?full_index=1";
|
||||
hash = "sha256-Y6drcBg4gnbSvnCGw69b42Q/QfLI3u56BGRUEkpdB0M=";
|
||||
})
|
||||
# Fix build with gcc15 by using c99 for preprocessing
|
||||
# The first patch is needed to apply the second; it doesn't affect us
|
||||
(fetchpatch {
|
||||
url = "https://github.com/tpm2-software/tpm2-pytss/commit/55d28b259f1a68f60c937ea8be7815685d32757f.patch";
|
||||
hash = "sha256-sGxUyQ2W2Jl9ROSt1w0E0dVTgFPAmYWlNgcpHcTVv90=";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/tpm2-software/tpm2-pytss/commit/61d00b4dcca131b3f03f674ceabf4260bdbd6a61.patch";
|
||||
hash = "sha256-0dwfyW0Fi5FkzYnaMOb2ua9O6eyCnMgJqT09tTT56vY=";
|
||||
})
|
||||
]
|
||||
++ lib.optionals isCross [
|
||||
# pytss will regenerate files from headers of tpm2-tss.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
lib,
|
||||
stdenv,
|
||||
buildPythonPackage,
|
||||
pythonAtLeast,
|
||||
pythonOlder,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
|
||||
# build-system
|
||||
cython,
|
||||
@@ -79,7 +79,14 @@ buildPythonPackage rec {
|
||||
"tests/test_fs_event.py::Test_UV_FS_EVENT_RENAME::test_fs_event_rename"
|
||||
# Broken: https://github.com/NixOS/nixpkgs/issues/160904
|
||||
"tests/test_context.py::Test_UV_Context::test_create_ssl_server_manual_connection_lost"
|
||||
];
|
||||
]
|
||||
++
|
||||
lib.optionals
|
||||
(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 && pythonAtLeast "3.14")
|
||||
[
|
||||
# https://github.com/MagicStack/uvloop/issues/709
|
||||
"tests/test_process.py::TestAsyncio_AIO_Process::test_cancel_post_init"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
# force using installed/compiled uvloop
|
||||
|
||||
@@ -82,6 +82,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
url = "https://github.com/OpenTTD/OpenTTD/commit/14fac2ad37bfb9cec56b4f9169d864f6f1c7b96e.patch";
|
||||
hash = "sha256-L35ybnTKPO+HVP/7ZYzWM2mA+s1RAywhofSuzpy/6sc=";
|
||||
})
|
||||
|
||||
(fetchpatch {
|
||||
name = "fix-GCC-15-due-to-missing-CRTP-usage.patch";
|
||||
url = "https://github.com/OpenTTD/OpenTTD/commit/db36e61807955c896267d6585de0577efd30465d.patch";
|
||||
hash = "sha256-wJqboBuB+gcn1UPoTlym9IaL7tXtdKEp/E474vG5rYk=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
Reference in New Issue
Block a user