We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fa9184 commit 8ba784cCopy full SHA for 8ba784c
conf.py
@@ -188,10 +188,13 @@
188
"""
189
190
# Dynamically expose the Python version associated with the "main" branch.
191
+# The release cycle data may not be ordered, so choose the numerically highest
192
+# version key instead of relying on a specific entry's position.
193
with open("include/release-cycle.json", encoding="UTF-8") as _f:
194
_cycle = json.load(_f)
-_main_version = next(
- ver for ver, data in _cycle.items() if data.get("branch") == "main"
195
+_main_version = max(
196
+ _cycle,
197
+ key=lambda v: tuple(int(part) for part in v.split(".")),
198
)
199
rst_prolog += f"\n.. |mainversion| replace:: {_main_version}\n"
200
0 commit comments