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
+
1
3
extensions = [
2
4
'notfound.extension' ,
3
5
'sphinx.ext.extlinks' ,
165
167
# sphinx-notfound-page
166
168
notfound_urls_prefix = "/"
167
169
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
+
168
179
# prolog and epilogs
169
- rst_prolog = """
180
+ rst_prolog = f """
170
181
.. |draft| replace::
171
182
This is part of a **Draft** of the Python Contributor's Guide.
172
183
Text in square brackets are notes about content to fill in.
183
194
184
195
.. _Refactoring the DevGuide: https://discuss.python.org/t/refactoring-the-devguide-into-a-contribution-guide/63409
185
196
197
+ .. |main_version| replace:: { _main_version }
198
+
186
199
"""
187
200
188
201
# sphinx.ext.extlinks
Original file line number Diff line number Diff line change 5
5
Status of Python versions
6
6
=========================
7
7
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
9
9
branch that accepts new features. The latest release for each Python
10
10
version can be found on the `download page <https://www.python.org/downloads/ >`_.
11
11
You can’t perform that action at this time.
0 commit comments