Skip to content

Dynamically substitute main version in versions.rst from release-cycle.json #1583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

corneliusroemer
Copy link
Contributor

@corneliusroemer corneliusroemer commented Jun 19, 2025

In #1582 @hugovk suggested programmatically setting the version of the main branch to avoid having to do it manually each year:

Rather than manually bump this each year, can we programmatically use the value from https://github.com/python/devguide/blob/main/include/release-cycle.json?
(from #1582 (comment))

This is an attempt to do so generated in conjunction with openai's codex.

It introduces the first non-purely-declarative code into conf.py. Maybe there's a better place to put the code but I'm not familiar with the code base.

This screenshot shows that things work as expected (tested on commit 6da61e3)

Google Chrome 2025-06-23 16 44 44

https://cpython-devguide--1583.org.readthedocs.build/versions/


📚 Documentation preview 📚: https://cpython-devguide--1583.org.readthedocs.build/

Copy link
Collaborator

@willingc willingc left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me. Leaving it to our release expert @hugovk 👋 to review and merge. Thanks @corneliusroemer for working on improvements to the devguide too!

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thanks! A couple of suggestions.

corneliusroemer and others added 3 commits June 23, 2025 16:40
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@corneliusroemer corneliusroemer requested a review from hugovk June 23, 2025 14:46
@corneliusroemer
Copy link
Contributor Author

Thanks for the suggestions @hugovk - I have accepted them and added a small additional fix (renaming main_version -> _main_version in conf.py). I also tested the RTD test build output is as expected.

corneliusroemer and others added 2 commits June 23, 2025 17:10
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Thank you!

@hugovk hugovk merged commit 4705126 into python:main Jun 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants