Files
Alexandru Ardelean 87a7be0326 vobject: add missing pytz and six dependencies
vobject 0.9.9 lists both pytz and six as unconditional runtime requirements
in install_requires, but neither was in DEPENDS. Running the change_tz
console script failed with "ModuleNotFoundError: No module named 'pytz'".

six happened to resolve transitively through python3-dateutil even though
vobject/base.py imports it directly, so list it explicitly rather than rely
on another package's dependency.

Extend test.sh to check that both modules import and that vobject.change_tz
loads.

Fixes: https://github.com/openwrt/packages/issues/29992
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-07-22 09:31:42 +03:00

46 lines
960 B
Bash

#!/bin/sh
[ "$1" = python3-vobject ] || exit 0
python3 - << 'EOF'
import vobject
# Upstream declares pytz and six as hard runtime requirements, so make sure
# both resolve; a missing pytz is what broke the change_tz console script.
import pytz
import six
from dateutil import tz
# 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"
# Verify change_tz imports (requires pytz)
from vobject.change_tz import change_tz
print("python3-vobject OK")
EOF