Skip to content

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

Merged
hugovk merged 10 commits into
python:mainfrom
corneliusroemer:codex/dynamically-use-release-cycle-in-versions.rst
Jun 24, 2025
Merged

Dynamically substitute main version in versions.rst from release-cycle.json#1583
hugovk merged 10 commits into
python:mainfrom
corneliusroemer:codex/dynamically-use-release-cycle-in-versions.rst

Conversation

@corneliusroemer

@corneliusroemercorneliusroemer commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

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/

@willingcwillingc left a comment

Copy link
Copy Markdown
Collaborator

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!

@hugovkhugovk left a comment

Copy link
Copy Markdown
Member

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.

Comment threadconf.py Outdated
Comment threadconf.py Outdated
Comment threadversions.rst Outdated
corneliusroemerand others added 3 commits June 23, 2025 16:40
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Comment threadconf.py Outdated
@corneliusroemer

Copy link
Copy Markdown
ContributorAuthor

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.

Comment threadconf.py Outdated
corneliusroemerand others added 2 commits June 23, 2025 17:10
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

@hugovkhugovk left a comment

Copy link
Copy Markdown
Member

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:mainJun 24, 2025
Sign up for freeto 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

@corneliusroemer@hugovk@willingc@ezio-melotti