Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddf9d54

Browse files
authored
Bump icalendar to 6.0.1 (#12802)
1 parent 16bab54 commit ddf9d54

3 files changed

Lines changed: 50 additions & 9 deletions

File tree

stubs/icalendar/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,5 @@ icalendar.Component.set_inline
1010
icalendar.cal.Component.get_inline
1111
icalendar.cal.Component.set_inline
1212

13-
# Runtime __all__ has extra items that don't exist.
14-
icalendar.__all__
15-
icalendar.vTypesFactory
16-
icalendar.parser.__all__
17-
icalendar.parser.tzid_from_dt
18-
# Runtime __all__ is missing a comma, leading to incorrect items.
19-
icalendar.parser_tools.__all__
20-
icalendar.parser_tools.ICAL_TYPEdata_encode
21-
2213
# Stubtest gets confused by multiple inheritance.
2314
icalendar.prop.vSkip.__new__

stubs/icalendar/icalendar/__init__.pyi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ from .cal import (
55
ComponentFactory as ComponentFactory,
66
Event as Event,
77
FreeBusy as FreeBusy,
8+
IncompleteComponent as IncompleteComponent,
9+
InvalidCalendar as InvalidCalendar,
810
Journal as Journal,
911
Timezone as Timezone,
1012
TimezoneDaylight as TimezoneDaylight,
@@ -25,6 +27,7 @@ from .prop import (
2527
vFrequency as vFrequency,
2628
vGeo as vGeo,
2729
vInt as vInt,
30+
vMonth as vMonth,
2831
vPeriod as vPeriod,
2932
vRecur as vRecur,
3033
vText as vText,
@@ -81,4 +84,7 @@ __all__ = [
8184
"version_tuple",
8285
"TypesFactory",
8386
"Component",
87+
"vMonth",
88+
"IncompleteComponent",
89+
"InvalidCalendar",
8490
]

stubs/icalendar/icalendar/cal.pyi

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import datetime
22
from _typeshed import Incomplete, SupportsItems
33
from collections.abc import Callable
44
from typing import Any, ClassVar, Final, Literal, overload
5+
from typing_extensions import TypeIs
56

67
from .caselessdict import CaselessDict
78
from .parser import Contentline, Contentlines
@@ -22,6 +23,8 @@ __all__ = [
2223
"Todo",
2324
"component_factory",
2425
"get_example",
26+
"IncompleteComponent",
27+
"InvalidCalendar",
2528
]
2629

2730
def get_example(component_directory: str, example_name: str) -> bytes: ...
@@ -31,6 +34,9 @@ class ComponentFactory(CaselessDict[Incomplete]):
3134

3235
INLINE: CaselessDict[int]
3336

37+
class InvalidCalendar(ValueError): ...
38+
class IncompleteComponent(ValueError): ...
39+
3440
class Component(CaselessDict[Incomplete]):
3541
name: ClassVar[str | None]
3642
required: ClassVar[tuple[str, ...]]
@@ -71,16 +77,54 @@ class Component(CaselessDict[Incomplete]):
7177
def to_ical(self, sorted: bool = True) -> bytes: ...
7278
def __eq__(self, other: Component) -> bool: ... # type: ignore[override]
7379

80+
# type_def is a TypeForm
81+
def create_single_property(prop: str, value_attr: str, value_type: tuple[type, ...], type_def: Any, doc: str) -> property: ...
82+
def is_date(dt: datetime.date) -> bool: ... # TypeIs[datetime.date and not datetime.datetime]
83+
def is_datetime(dt: datetime.date) -> TypeIs[datetime.datetime]: ...
84+
7485
class Event(Component):
7586
name: ClassVar[Literal["VEVENT"]]
7687
@classmethod
7788
def example(cls, name: str) -> Event: ...
89+
@property
90+
def DTSTART(self) -> datetime.date | datetime.datetime | None: ...
91+
@DTSTART.setter
92+
def DTSTART(self, value: datetime.date | datetime.datetime | None) -> None: ...
93+
@property
94+
def DTEND(self) -> datetime.date | datetime.datetime | None: ...
95+
@DTEND.setter
96+
def DTEND(self, value: datetime.date | datetime.datetime | None) -> None: ...
97+
@property
98+
def DURATION(self) -> datetime.timedelta | None: ...
99+
@DURATION.setter
100+
def DURATION(self, value: datetime.timedelta | None) -> None: ...
101+
@property
102+
def duration(self) -> datetime.timedelta: ...
103+
@property
104+
def start(self) -> datetime.date | datetime.datetime: ...
105+
@start.setter
106+
def start(self, value: datetime.date | datetime.datetime | None) -> None: ...
107+
@property
108+
def end(self) -> datetime.date | datetime.datetime: ...
109+
@end.setter
110+
def end(self, value: datetime.date | datetime.datetime | None) -> None: ...
78111

79112
class Todo(Component):
80113
name: ClassVar[Literal["VTODO"]]
81114

82115
class Journal(Component):
83116
name: ClassVar[Literal["VJOURNAL"]]
117+
@property
118+
def DTSTART(self) -> datetime.date | datetime.datetime | None: ...
119+
@DTSTART.setter
120+
def DTSTART(self, value: datetime.date | datetime.datetime | None) -> None: ...
121+
@property
122+
def start(self) -> datetime.date | datetime.datetime: ...
123+
@start.setter
124+
def start(self, value: datetime.date | datetime.datetime | None) -> None: ...
125+
end = start
126+
@property
127+
def duration(self) -> datetime.timedelta: ...
84128

85129
class FreeBusy(Component):
86130
name: ClassVar[Literal["VFREEBUSY"]]

0 commit comments

Comments
 (0)