From: Alexandru Ardelean Date: Sat, 4 Apr 2026 22:31:59 +0000 (+0300) Subject: python-xmltodict: update to 1.0.4 X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=e05e7ab598bd7d62d88a5e056fbf2cb53a132d6f;p=openwrt-packages.git python-xmltodict: update to 1.0.4 Update package to 1.0.4. Add test.sh to verify XML parsing and unparsing functionality. Signed-off-by: Alexandru Ardelean --- diff --git a/lang/python/python-xmltodict/Makefile b/lang/python/python-xmltodict/Makefile index 87b841f51..3ecc178c6 100644 --- a/lang/python/python-xmltodict/Makefile +++ b/lang/python/python-xmltodict/Makefile @@ -8,16 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-xmltodict -PKG_VERSION:=0.13.0 +PKG_VERSION:=1.0.4 PKG_RELEASE:=1 PYPI_NAME:=xmltodict -PKG_HASH:=341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56 +PKG_HASH:=6d94c9f834dd9e44514162799d344d815a3a4faec913717a9ecbfa5be1bb8e61 PKG_MAINTAINER:=Josef Schlehofer PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE +PKG_BUILD_DEPENDS:=python-setuptools/host + include ../pypi.mk include $(INCLUDE_DIR)/package.mk include ../python3-package.mk diff --git a/lang/python/python-xmltodict/test.sh b/lang/python/python-xmltodict/test.sh new file mode 100644 index 000000000..b7aeb87d6 --- /dev/null +++ b/lang/python/python-xmltodict/test.sh @@ -0,0 +1,29 @@ +#!/bin/sh +[ "$1" = python3-xmltodict ] || exit 0 + +python3 - << 'EOF' +import xmltodict + +# Basic XML to dict conversion +xml = """ + test + 42 + + a + b + +""" +data = xmltodict.parse(xml) +assert data['root']['name'] == 'test' +assert data['root']['value'] == '42' +assert isinstance(data['root']['items']['item'], list) +assert data['root']['items']['item'] == ['a', 'b'] + +# Dict to XML conversion +d = {'doc': {'title': 'Hello', 'body': 'World'}} +result = xmltodict.unparse(d) +assert 'Hello' in result +assert 'World' in result + +print("xmltodict OK") +EOF