From: Alexandru Ardelean Date: Sun, 5 Apr 2026 12:23:27 +0000 (+0300) Subject: python-orjson: update to 3.11.8, add test.sh X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=cf5b39f8c3ac90d6ca01cea041683586c190d9a1;p=openwrt-packages.git python-orjson: update to 3.11.8, add test.sh Update to 3.11.8 to fix the build error with Python 3.14 ``` --- stderr error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13) = help: please check if an updated version of PyO3 is available. Current version: 0.23.0-dev = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI warning: build failed, waiting for other jobs to finish... 💥 maturin failed ``` orjson imports uuid.py at module init to look up uuid.UUID type; python3-uuid is a separate package not included in python3-light, causing a segfault when python3-uuid is absent. Add it as an explicit dependency to fix the crash on all architectures. Crash is: ``` importing orjson... Fatal Python error: Segmentation fault Current thread 0xecf37c64 [python3] (most recent call first): File "", line 491 in _call_with_frames_removed File "", line 1061 in exec_module File "", line 938 in _load_unlocked File "", line 1342 in _find_and_load_unlocked File "", line 1371 in _find_and_load File "/usr/lib/python3.14/site-packages/orjson/__init__.py", line 8 in File "", line 491 in _call_with_frames_removed File "", line 759 in exec_module File "", line 938 in _load_unlocked File "", line 1342 in _find_and_load_unlocked File "", line 1371 in _find_and_load File "", line 5 in Current thread's C stack trace (most recent call first): Segmentation fault (core dumped) Test failed ``` Signed-off-by: Alexandru Ardelean --- diff --git a/lang/python/python-orjson/Makefile b/lang/python/python-orjson/Makefile index 7d584204a..e1ef7f042 100644 --- a/lang/python/python-orjson/Makefile +++ b/lang/python/python-orjson/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-orjson -PKG_VERSION:=3.10.12 +PKG_VERSION:=3.11.8 PKG_RELEASE:=1 PYPI_NAME:=orjson -PKG_HASH:=0a78bbda3aea0f9f079057ee1ee8a1ecf790d4f1af88dd67493c6b8ee52506ff +PKG_HASH:=96163d9cdc5a202703e9ad1b9ae757d5f0ca62f4fa0cc93d1f27b0e180cc404e PKG_MAINTAINER:=Timothy Ace PKG_LICENSE:=Apache-2.0 MIT @@ -26,6 +26,7 @@ define Package/python3-orjson URL:=https://github.com/ijl/orjson DEPENDS:= \ +python3-light \ + +python3-uuid \ $(RUST_ARCH_DEPENDS) endef diff --git a/lang/python/python-orjson/test.sh b/lang/python/python-orjson/test.sh new file mode 100644 index 000000000..0854b353e --- /dev/null +++ b/lang/python/python-orjson/test.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +[ "$1" = python3-orjson ] || exit 0 + +python3 - << 'EOF' +import faulthandler +faulthandler.enable() + +print("importing orjson...", flush=True) +import orjson +print("import OK", flush=True) + +# Basic encode/decode +data = {"key": "value", "number": 42, "flag": True, "empty": None} +encoded = orjson.dumps(data) +assert isinstance(encoded, bytes) +decoded = orjson.loads(encoded) +assert decoded == data +print("basic encode/decode OK", flush=True) + +# List roundtrip +lst = [1, 2, 3, "hello"] +assert orjson.loads(orjson.dumps(lst)) == lst +print("list roundtrip OK", flush=True) + +# Nested structures +nested = {"a": {"b": {"c": 1}}} +assert orjson.loads(orjson.dumps(nested)) == nested +print("nested OK", flush=True) + +# OPT_SORT_KEYS option +obj = {"z": 1, "a": 2, "m": 3} +sorted_json = orjson.dumps(obj, option=orjson.OPT_SORT_KEYS) +assert sorted_json == b'{"a":2,"m":3,"z":1}' +print("sort_keys OK", flush=True) + +print("orjson OK") +EOF