From 351d1660449dcfb253ebee8e546a8e59216e0012 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 14 Jun 2026 15:31:10 +0000 Subject: [PATCH 1/3] python-jsonpath-ng: drop ply, six and decorator dependencies jsonpath-ng 1.8.0 vendors ply as jsonpath_ng._ply and no longer imports six or decorator, so none are required at runtime. It builds through the setuptools.build_meta legacy backend but never declared setuptools as a build dependency; it was only present in the host build env transitively via those packages' builds. Add python-setuptools/host explicitly so the build no longer relies on that side effect. The jsonpath_ng CLI takes a required expression argument and has no version flag, so the generic version check cannot detect the package version from it. Add a test-version.sh override and assert __version__ in test.sh instead, mirroring python-jmespath. Signed-off-by: Alexandru Ardelean --- lang/python/python-jsonpath-ng/Makefile | 9 ++++----- .../python/python-jsonpath-ng/test-version.sh | 16 +++++++++++++++ lang/python/python-jsonpath-ng/test.sh | 20 +++++++++++++++++-- 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 lang/python/python-jsonpath-ng/test-version.sh diff --git a/lang/python/python-jsonpath-ng/Makefile b/lang/python/python-jsonpath-ng/Makefile index 062204b407accb..db018b43fef4f0 100644 --- a/lang/python/python-jsonpath-ng/Makefile +++ b/lang/python/python-jsonpath-ng/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-jsonpath-ng PKG_VERSION:=1.8.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=Josef Schlehofer   PYPI_NAME:=jsonpath-ng @@ -16,6 +16,8 @@ PKG_HASH:=54252968134b5e549ea5b872f1df1168bd7defe1a52fed5a358c194e1943ddc3 PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE +PKG_BUILD_DEPENDS:=python-setuptools/host + include ../pypi.mk include $(INCLUDE_DIR)/package.mk include ../python3-package.mk @@ -28,10 +30,7 @@ define Package/python3-jsonpath-ng TITLE:=Standard compliant implementation of JSONPath DEPENDS:= \ +python3-light \ - +python3-logging \ - +python3-ply \ - +python3-six \ - +python3-decorator + +python3-logging endef define Package/python3-jsonpath-ng/description diff --git a/lang/python/python-jsonpath-ng/test-version.sh b/lang/python/python-jsonpath-ng/test-version.sh new file mode 100644 index 00000000000000..979efa97d08c99 --- /dev/null +++ b/lang/python/python-jsonpath-ng/test-version.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# shellcheck shell=busybox + +# The jsonpath_ng command-line tool takes a required expression argument and +# has no version flag, so the generic version check cannot detect the version +# from it. The version is covered by the import check in test.sh instead. +case "$PKG_NAME" in +python3-jsonpath-ng | python3-jsonpath-ng-src) + exit 0 + ;; +*) + echo "Untested package: $PKG_NAME" >&2 + exit 1 + ;; +esac diff --git a/lang/python/python-jsonpath-ng/test.sh b/lang/python/python-jsonpath-ng/test.sh index eac76245a969b3..13a505d3e1344f 100755 --- a/lang/python/python-jsonpath-ng/test.sh +++ b/lang/python/python-jsonpath-ng/test.sh @@ -2,10 +2,18 @@ [ "$1" = python3-jsonpath-ng ] || exit 0 -python3 - << 'EOF' +python3 - "$2" << 'EOF' +import sys +import jsonpath_ng from jsonpath_ng import parse from jsonpath_ng.ext import parse as ext_parse +# The jsonpath_ng CLI has no version flag, so the generic version check is +# overridden (test-version.sh); confirm the package version here instead. +if jsonpath_ng.__version__ != sys.argv[1]: + print("Wrong version: " + jsonpath_ng.__version__) + sys.exit(1) + data = { "store": { "books": [ @@ -25,8 +33,16 @@ assert matches == ["A", "B", "C"], f"Unexpected: {matches}" expr2 = parse("store.books[1].price") assert expr2.find(data)[0].value == 20 -# Filter expression (ext parser) +# Filter expression (ext parser, exercises the vendored ply lexer/parser) expr3 = ext_parse("store.books[?price > 12].title") titles = [m.value for m in expr3.find(data)] assert set(titles) == {"B", "C"}, f"Unexpected: {titles}" EOF +[ $? -eq 0 ] || exit 1 + +# Verify the jsonpath_ng command-line tool (reads JSON from stdin) +result=$(echo '{"a": {"b": 42}}' | jsonpath_ng 'a.b') +[ "$result" = "42" ] || { + echo "jsonpath_ng returned '$result', expected 42" + exit 1 +} From 4f8abf1c284855bd204cf210fba1ddcfb297cc4a Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 14 Jun 2026 15:31:14 +0000 Subject: [PATCH 2/3] python-ply: drop package No longer needed by any package in the feed; jsonpath-ng (the last consumer) vendors ply internally as jsonpath_ng._ply. Signed-off-by: Alexandru Ardelean --- lang/python/python-ply/Makefile | 55 --------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 lang/python/python-ply/Makefile diff --git a/lang/python/python-ply/Makefile b/lang/python/python-ply/Makefile deleted file mode 100644 index 6ecb3a8fcc957e..00000000000000 --- a/lang/python/python-ply/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright (C) 2015-2016, 2018, 2023 Jeffery To -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=python-ply -PKG_VERSION:=3.11 -PKG_RELEASE:=3 - -PYPI_NAME:=ply -PKG_HASH:=00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3 - -PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=README.md -PKG_MAINTAINER:=Alexandru Ardelean - -PKG_BUILD_DEPENDS:= \ - python3/host \ - python-setuptools/host \ - python-wheel/host -HOST_BUILD_DEPENDS:= \ - python3/host \ - python-setuptools/host \ - python-build/host \ - python-installer/host \ - python-wheel/host - -include ../pypi.mk -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk -include ../python3-package.mk -include ../python3-host-build.mk - -define Package/python3-ply - SECTION:=lang - CATEGORY:=Languages - SUBMENU:=Python - TITLE:=lex and yacc for Python - URL:=http://www.dabeaz.com/ply/ - DEPENDS:=+python3-light -endef - -define Package/python3-ply/description -PLY is a 100% Python implementation of the common parsing tools lex -and yacc. -endef - -$(eval $(call Py3Package,python3-ply)) -$(eval $(call BuildPackage,python3-ply)) -$(eval $(call BuildPackage,python3-ply-src)) -$(eval $(call HostBuild)) From d6eb468617a4ce20eb3d610e5af8a954bbf89749 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sun, 14 Jun 2026 15:31:20 +0000 Subject: [PATCH 3/3] python-decorator: drop package No longer needed by any package in the feed; jsonpath-ng was the last consumer and no longer imports it. Signed-off-by: Alexandru Ardelean --- lang/python/python-decorator/Makefile | 33 ------------------ lang/python/python-decorator/test.sh | 48 --------------------------- 2 files changed, 81 deletions(-) delete mode 100644 lang/python/python-decorator/Makefile delete mode 100755 lang/python/python-decorator/test.sh diff --git a/lang/python/python-decorator/Makefile b/lang/python/python-decorator/Makefile deleted file mode 100644 index d7330a3155bcbb..00000000000000 --- a/lang/python/python-decorator/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=python-decorator -PKG_VERSION:=5.2.1 -PKG_RELEASE:=1 -PKG_MAINTAINER:=Josef Schlehofer   -PKG_CPE_ID:=cpe:/a:python:decorator - -PYPI_NAME:=decorator -PKG_HASH:=65f266143752f734b0a7cc83c46f4618af75b8c5911b00ccb61d0ac9b6da0360 - -PKG_BUILD_DEPENDS:=python-setuptools/host - -include ../pypi.mk -include $(INCLUDE_DIR)/package.mk -include ../python3-package.mk - -define Package/python3-decorator - SECTION:=lang - CATEGORY:=Languages - SUBMENU:=Python - URL:=https://github.com/micheles/decorator - TITLE:=python3-decodator - DEPENDS:=+python3-light -endef - -$(eval $(call Py3Package,python3-decorator)) -$(eval $(call BuildPackage,python3-decorator)) -$(eval $(call BuildPackage,python3-decorator-src)) diff --git a/lang/python/python-decorator/test.sh b/lang/python/python-decorator/test.sh deleted file mode 100755 index c53e5d065416f9..00000000000000 --- a/lang/python/python-decorator/test.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -[ "$1" = "python3-decorator" ] || exit 0 - -python3 - << EOF -import sys -import decorator - -if decorator.__version__ != "$2": - print("Wrong version: " + decorator.__version__) - sys.exit(1) - -from decorator import decorator as dec, decorate - -# Basic usage: preserve function signature -@dec -def trace(f, *args, **kw): - result = f(*args, **kw) - return result - -def greet(name, greeting="Hello"): - return f"{greeting}, {name}" - -traced = trace(greet) -assert traced("Alice") == "Hello, Alice" -assert traced("Bob", greeting="Hi") == "Hi, Bob" - -# Signature is preserved -import inspect -sig = inspect.signature(traced) -assert "name" in sig.parameters -assert "greeting" in sig.parameters - -# Works with classes (dispatch-style) -@dec -def noop(f, *args, **kw): - return f(*args, **kw) - -class MyClass: - @noop - def method(self, x): - return x * 2 - -obj = MyClass() -assert obj.method(3) == 6 - -sys.exit(0) -EOF