Skip to content

Conversation

@AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Nov 13, 2025

This is derived from Hugo's #4704; see that PR for context.

This PR is an attempt to implement @sethmlarson's suggestion -- attempting to do this via review comments wasn't really going to work!

The ICS generation is now much simpler with no dependencies, simply outputting the required strings. I've also limited past events to 7 years to keep the file size smaller (for ~18months of pre-releases and a five-year lifespan). Realistically this could be much shorter, but I've been conservative.

A


📚 Documentation preview 📚: https://pep-previews--4705.org.readthedocs.build/

@AA-Turner AA-Turner requested a review from a team as a code owner November 13, 2025 20:03
@AA-Turner AA-Turner added the infra Core infrastructure for building and rendering PEPs label Nov 13, 2025
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
'BEGIN:VEVENT',
f'SUMMARY:Python {release.stage}',
f'DTSTART;VALUE=DATE:{release.date.strftime("%Y%m%d")}',
f'UID:python-{normalised_stage}@releases.python.org',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f'UID:python-{normalised_stage}@releases.python.org',
f'UID:python-{normalised_stage}@python.org',

]
for version, release in all_releases:
normalised_stage = release.stage.casefold().replace(' ', '')
note = (f'DESCRIPTION:Note: {release.note}',) if release.note else ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DESCRIPTION is a TEXT type:

https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.5

TEXT needs to escape some characters:

  ESCAPED-CHAR = ("\\" / "\;" / "\," / "\N" / "\n")

https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.11

pep_number = python_releases.metadata[version].pep
lines += (
'BEGIN:VEVENT',
f'SUMMARY:Python {release.stage}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUMMARY is also TEXT, but maybe we can assume this will never need escaping? Although it'd be safer to run it through an escape function.

https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.12

Comment on lines +9 to +12
('3.14.0 alpha 1', 'python-3.14.0alpha1@releases.python.org'),
('3.14.0 beta 2', 'python-3.14.0beta2@releases.python.org'),
('3.14.0 candidate 3', 'python-3.14.0candidate3@releases.python.org'),
('3.14.1', 'python-3.14.1@releases.python.org'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
('3.14.0 alpha 1', 'python-3.14.0alpha1@releases.python.org'),
('3.14.0 beta 2', 'python-3.14.0beta2@releases.python.org'),
('3.14.0 candidate 3', 'python-3.14.0candidate3@releases.python.org'),
('3.14.1', 'python-3.14.1@releases.python.org'),
('3.14.0 alpha 1', 'python-3.14.0alpha1@python.org'),
('3.14.0 beta 2', 'python-3.14.0beta2@python.org'),
('3.14.0 candidate 3', 'python-3.14.0candidate3@python.org'),
('3.14.1', 'python-3.14.1@python.org'),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing test coverage of release_mangement/:

https://app.codecov.io/gh/python/peps/pull/4705/tree

Please include the .coveragerc and pytest.ini changes (or similar) from the original PR.

Comment on lines +72 to +74
global _PYTHON_RELEASES
if _PYTHON_RELEASES is not None:
return _PYTHON_RELEASES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think chucking a @cache decorator on the function (from the original PR) is much cleaner than six lines to manage a global variable.

'END:VCALENDAR',
'',
)
return '\n'.join(lines)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have CRLF line endings: https://datatracker.ietf.org/doc/html/rfc5545#section-3.1

Suggested change
return '\n'.join(lines)
return '\r\n'.join(lines)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Core infrastructure for building and rendering PEPs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants