diff --git a/stubs/vobject/@tests/stubtest_allowlist.txt b/stubs/vobject/@tests/stubtest_allowlist.txt index 8286d0099..ff95be452 100644 --- a/stubs/vobject/@tests/stubtest_allowlist.txt +++ b/stubs/vobject/@tests/stubtest_allowlist.txt @@ -6,15 +6,11 @@ vobject.base.VBase.__init__ # See: https://github.com/eventable/vobject/pull/187 vobject.win32tz -# dependencies -vobject.icalendar.Pytz - # python2 compat vobject.base.basestring vobject.base.str_ vobject.base.to_unicode vobject.base.to_basestring -vobject.vcard.basestring vobject.base.unicode_type # implementation details that users shouldn't depend on diff --git a/stubs/vobject/vobject/__init__.pyi b/stubs/vobject/vobject/__init__.pyi index 2312c6db7..eb51038c1 100644 --- a/stubs/vobject/vobject/__init__.pyi +++ b/stubs/vobject/vobject/__init__.pyi @@ -1,4 +1,8 @@ +from typing import Final + from .base import Component def iCalendar() -> Component: ... def vCard() -> Component: ... + +VERSION: Final[str] diff --git a/stubs/vobject/vobject/base.pyi b/stubs/vobject/vobject/base.pyi index 351f093ab..21870581c 100644 --- a/stubs/vobject/vobject/base.pyi +++ b/stubs/vobject/vobject/base.pyi @@ -31,12 +31,21 @@ class VBase: def transformFromNative(self): ... def transformChildrenToNative(self) -> None: ... def transformChildrenFromNative(self, clearBehavior: bool = True) -> None: ... + # Use Any because args and kwargs are passed to the behavior object @overload def serialize( - self, buf: None = None, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None + self, + buf: None = None, + lineLength: int = 75, + validate: bool = True, + behavior: Incomplete | None = None, + *args: Any, + **kwargs: Any, ) -> str: ... @overload - def serialize(self, buf: _W, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None) -> _W: ... + def serialize( + self, buf: _W, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None, *args: Any, **kwargs: Any + ) -> _W: ... def toVName(name, stripNum: int = 0, upper: bool = False): ... diff --git a/stubs/vobject/vobject/behavior.pyi b/stubs/vobject/vobject/behavior.pyi index 72f371ad3..25cde219e 100644 --- a/stubs/vobject/vobject/behavior.pyi +++ b/stubs/vobject/vobject/behavior.pyi @@ -27,6 +27,6 @@ class Behavior: @classmethod def generateImplicitParameters(cls, obj) -> None: ... @classmethod - def serialize(cls, obj, buf, lineLength, validate: bool = True): ... + def serialize(cls, obj, buf, lineLength, validate: bool = True, *args, **kwargs): ... @classmethod def valueRepr(cls, line): ... diff --git a/stubs/vobject/vobject/change_tz.pyi b/stubs/vobject/vobject/change_tz.pyi index 18915bb3d..af45ff738 100644 --- a/stubs/vobject/vobject/change_tz.pyi +++ b/stubs/vobject/vobject/change_tz.pyi @@ -1,4 +1,8 @@ +from collections.abc import Sequence + def change_tz(cal, new_timezone, default, utc_only: bool = False, utc_tz=...) -> None: ... +def show_timezones() -> None: ... +def convert_events(utc_only: bool, args: Sequence[str]) -> None: ... def main() -> None: ... version: str diff --git a/stubs/vobject/vobject/ics_diff.pyi b/stubs/vobject/vobject/ics_diff.pyi index 7da018df9..d80341d95 100644 --- a/stubs/vobject/vobject/ics_diff.pyi +++ b/stubs/vobject/vobject/ics_diff.pyi @@ -4,7 +4,4 @@ def deleteExtraneous(component, ignore_dtstamp: bool = False) -> None: ... def diff(left, right): ... def prettyDiff(leftObj, rightObj) -> None: ... def main() -> None: ... - -version: str - def getOptions(): ... diff --git a/stubs/vobject/vobject/vcard.pyi b/stubs/vobject/vobject/vcard.pyi index 0af7e3c75..20a80ec22 100644 --- a/stubs/vobject/vobject/vcard.pyi +++ b/stubs/vobject/vobject/vcard.pyi @@ -77,7 +77,7 @@ class Photo(VCardTextBehavior): @classmethod def valueRepr(cls, line): ... @classmethod - def serialize(cls, obj, buf, lineLength, validate) -> None: ... # type: ignore[override] + def serialize(cls, obj, buf, lineLength, validate, *args, **kwargs) -> None: ... # type: ignore[override] def toListOrString(string): ... def splitFields(string): ...