File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ import json
2+
13extensions = [
24 'notfound.extension' ,
35 'sphinx.ext.extlinks' ,
165167# sphinx-notfound-page
166168notfound_urls_prefix = "/"
167169
170+ # Dynamically expose the Python version associated with the "main" branch.
171+ # Exactly one entry in ``release-cycle.json`` should have ``"branch": "main"``.
172+ with open ("include/release-cycle.json" , encoding = "UTF-8" ) as _f :
173+ _cycle = json .load (_f )
174+
175+ _main_version = next (
176+ version for version , data in _cycle .items () if data .get ("branch" ) == "main"
177+ )
178+
168179# prolog and epilogs
169- rst_prolog = """
180+ rst_prolog = f """
170181.. |draft| replace::
171182 This is part of a **Draft** of the Python Contributor's Guide.
172183 Text in square brackets are notes about content to fill in.
183194
184195.. _Refactoring the DevGuide: https://discuss.python.org/t/refactoring-the-devguide-into-a-contribution-guide/63409
185196
197+ .. |main_version| replace:: { _main_version }
198+
186199"""
187200
188201# sphinx.ext.extlinks
Original file line number Diff line number Diff line change 55Status of Python versions
66=========================
77
8- The ``main `` branch is currently the future Python 3.14 , and is the only
8+ The ``main `` branch is currently the future Python | main_version | , and is the only
99branch that accepts new features. The latest release for each Python
1010version can be found on the `download page <https://www.python.org/downloads/ >`_.
1111
You can’t perform that action at this time.
0 commit comments