python-et_xmlfile: bump to 2.0.0

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
Alexandru Ardelean
2024-12-24 14:27:09 +02:00
committed by Alexandru Ardelean
parent 75b419e96c
commit b24a5876d2
2 changed files with 31 additions and 2 deletions

View File

@@ -6,14 +6,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-et_xmlfile
PKG_VERSION:=1.1.0
PKG_VERSION:=2.0.0
PKG_RELEASE:=1
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>, Eneas U de Queiroz <cotequeiroz@gmail.com>
PKG_LICENSE:=MIT
PYPI_NAME:=et_xmlfile
PKG_HASH:=8eb9e2bc2f8c97e37a2dc85a09ecdcdec9d8a396530a6d5a33b30b9a92da0c5c
PKG_HASH:=dab3f4764309081ce75662649be815c4c9081e88f0837825f90fd28317d4da54
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk

View File

@@ -0,0 +1,29 @@
#!/bin/sh
EXPECTED_VER="$2"
python3 - << EOF
import sys
from io import BytesIO
from xml.etree.ElementTree import Element
from et_xmlfile import xmlfile
if (et_xmlfile.__version__ != "$EXPECTED_VER"):
print("Invalid version obtained '" + et_xmlfile.__version__ + "'")
sys.exit(1)
out = BytesIO()
with xmlfile(out) as xf:
el = Element("root")
xf.write(el) # write the XML straight to the file-like object
if (out.getvalue() != b"<root />"):
print("Does not seem to work")
sys.exit(1)
sys.exit(0)
EOF