mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
vobject: update to 0.9.9; add test.sh
Changelog since 0.9.6.1: - add product version number to the PRODID tag in iCalendar output - add support for GEO tags in vCards - various bugfixes and compatibility improvements Also need to update setup.cfg at build time to insert the version to allow the package to build. Otherwise we get ``` 2026-04-21T08:17:17.9341927Z File "/builder/staging_dir/hostpkg/lib/python3.14/site-packages/setuptools/config/setupcfg.py", line 296, in __setitem__ 2026-04-21T08:17:17.9342520Z parsed = self.parsers.get(option_name, lambda x: x)(value) 2026-04-21T08:17:17.9343117Z File "/builder/staging_dir/hostpkg/lib/python3.14/site-packages/setuptools/config/setupcfg.py", line 602, in _parse_version 2026-04-21T08:17:17.9343777Z return expand.version(self._parse_attr(value, self.package_dir, self.root_dir)) 2026-04-21T08:17:17.9344201Z ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2026-04-21T08:17:17.9344938Z File "/builder/staging_dir/hostpkg/lib/python3.14/site-packages/setuptools/config/setupcfg.py", line 421, in _parse_attr 2026-04-21T08:17:17.9345544Z return expand.read_attr(attr_desc, package_dir, root_dir) 2026-04-21T08:17:17.9345876Z ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2026-04-21T08:17:17.9346409Z File "/builder/staging_dir/hostpkg/lib/python3.14/site-packages/setuptools/config/expand.py", line 191, in read_attr 2026-04-21T08:17:17.9346947Z return getattr(module, attr_name) 2026-04-21T08:17:17.9347261Z AttributeError: module 'vobject' has no attribute 'VERSION' 2026-04-21T08:17:17.9598878Z ``` Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
8acd8b8d13
commit
970bbeb3b5
@@ -4,12 +4,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=vobject
|
||||
PKG_VERSION:=0.9.6.1
|
||||
PKG_RELEASE:=2
|
||||
PKG_VERSION:=0.9.9
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
PYPI_NAME:=$(PKG_NAME)
|
||||
PKG_HASH:=96512aec74b90abb71f6b53898dd7fe47300cc940104c4f79148f0671f790101
|
||||
PKG_HASH:=ac44e5d7e2079d84c1d52c50a615b9bec4b1ba958608c4c7fe40cbf33247b38e
|
||||
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
|
||||
|
||||
include ../pypi.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@@ -29,6 +30,11 @@ define Package/python3-vobject/description
|
||||
vCard and vCalendar support for Python
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(SED) 's/version = attr:.*/version = $(PKG_VERSION)/' $(PKG_BUILD_DIR)/setup.cfg
|
||||
endef
|
||||
|
||||
$(eval $(call Py3Package,python3-vobject))
|
||||
$(eval $(call BuildPackage,python3-vobject))
|
||||
$(eval $(call BuildPackage,python3-vobject-src))
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-vobject ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
import vobject
|
||||
|
||||
# Parse a simple vCard
|
||||
vcard_text = """BEGIN:VCARD
|
||||
VERSION:3.0
|
||||
FN:John Doe
|
||||
N:Doe;John;;;
|
||||
EMAIL:john@example.com
|
||||
END:VCARD
|
||||
"""
|
||||
vcard = vobject.readOne(vcard_text)
|
||||
assert vcard.fn.value == "John Doe"
|
||||
assert vcard.email.value == "john@example.com"
|
||||
|
||||
# Parse a simple iCalendar
|
||||
ical_text = """BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VEVENT
|
||||
SUMMARY:Test Event
|
||||
DTSTART:20260101T120000Z
|
||||
DTEND:20260101T130000Z
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
"""
|
||||
cal = vobject.readOne(ical_text)
|
||||
events = list(cal.vevent_list)
|
||||
assert len(events) == 1
|
||||
assert events[0].summary.value == "Test Event"
|
||||
|
||||
print("python3-vobject OK")
|
||||
EOF
|
||||
Reference in New Issue
Block a user