Skip to content

Commit 7fa9184

Browse files
Use release-cycle data for main branch version
1 parent 623218d commit 7fa9184

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import json
2+
13
extensions = [
24
'notfound.extension',
35
'sphinx.ext.extlinks',
@@ -185,6 +187,14 @@
185187
186188
"""
187189

190+
# Dynamically expose the Python version associated with the "main" branch.
191+
with open("include/release-cycle.json", encoding="UTF-8") as _f:
192+
_cycle = json.load(_f)
193+
_main_version = next(
194+
ver for ver, data in _cycle.items() if data.get("branch") == "main"
195+
)
196+
rst_prolog += f"\n.. |mainversion| replace:: {_main_version}\n"
197+
188198
# sphinx.ext.extlinks
189199
# This config is a dictionary of external sites,
190200
# mapping unique short aliases to a base URL and a prefix.

versions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Status 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 |mainversion|, and is the only
99
branch that accepts new features. The latest release for each Python
1010
version can be found on the `download page <https://www.python.org/downloads/>`_.
1111

0 commit comments

Comments
 (0)