Skip to content

Commit 6b30a20

Browse files
committed
Add required DTSTART field
1 parent 3725a0d commit 6b30a20

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

release_management/serialize.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ def create_release_schedule_calendar() -> str:
8181
def release_schedule_calendar_lines(
8282
releases: list[tuple[int, ReleaseInfo]], /
8383
) -> list[str]:
84+
dtstamp = dt.datetime.now(dt.timezone.utc).strftime('%Y%m%dT%H%M%SZ')
85+
8486
lines = [
8587
'BEGIN:VCALENDAR',
8688
'VERSION:2.0',
@@ -98,9 +100,10 @@ def release_schedule_calendar_lines(
98100
note = ()
99101
lines += (
100102
'BEGIN:VEVENT',
101-
f'SUMMARY:Python {release.stage}',
102-
f'DTSTART;VALUE=DATE:{release.date.strftime("%Y%m%d")}',
103+
f'DTSTAMP:{dtstamp}',
103104
f'UID:python-{normalised_stage}@releases.python.org',
105+
f'DTSTART;VALUE=DATE:{release.date.strftime("%Y%m%d")}',
106+
f'SUMMARY:Python {release.stage}',
104107
*note,
105108
f'URL:https://peps.python.org/pep-{pep_number:04d}/',
106109
'END:VEVENT',

release_management/tests/test_release_schedule_calendar.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ def test_create_release_calendar_first_event() -> None:
3737

3838
# Assert
3939
assert cal_lines[5] == 'BEGIN:VEVENT'
40-
assert cal_lines[6] == 'SUMMARY:Python X.Y.Z final'
41-
assert cal_lines[7] == 'DTSTART;VALUE=DATE:20000101'
42-
assert cal_lines[8] == 'UID:python-X.Y.Zfinal@releases.python.org'
43-
assert cal_lines[9] == (
40+
assert cal_lines[6].startswith('DTSTAMP:')
41+
assert cal_lines[6].endswith('Z')
42+
assert cal_lines[7] == 'UID:python-X.Y.Zfinal@releases.python.org'
43+
assert cal_lines[8] == 'DTSTART;VALUE=DATE:20000101'
44+
assert cal_lines[9] == 'SUMMARY:Python X.Y.Z final'
45+
assert cal_lines[10] == (
4446
'DESCRIPTION:Note: These characters need escaping: \\\\ \\, \\; \\n'
4547
)
46-
assert cal_lines[10] == 'URL:https://peps.python.org/pep-9999/'
47-
assert cal_lines[11] == 'END:VEVENT'
48+
assert cal_lines[11] == 'URL:https://peps.python.org/pep-9999/'
49+
assert cal_lines[12] == 'END:VEVENT'

0 commit comments

Comments
 (0)