Skip to content

Commit 4462ec6

Browse files
fix: show the next version on the docs changelog
1 parent 168fc47 commit 4462ec6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import sys
2222
from typing import Any, Dict, Optional
2323

24+
import versioningit
2425
from sphinx.application import Sphinx
2526

2627
# If extensions (or modules to document with autodoc) are in another directory,
@@ -110,6 +111,11 @@
110111
# The short X.Y version.
111112
version = ".".join(release.split(".")[:2])
112113

114+
next_version = versioningit.get_next_version(os.path.abspath(".."))
115+
116+
rst_prolog += f"""
117+
.. |next_version| replace:: {next_version}
118+
"""
113119

114120
_IS_READTHEDOCS = bool(os.getenv("READTHEDOCS"))
115121

docs/whats_new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Changelog
1313
This page keeps a detailed human friendly rendering of what's new and changed
1414
in specific versions. Please see :ref:`version_guarantees` for more information.
1515

16-
.. towncrier-draft-entries:: |release| [UNRELEASED]
16+
.. towncrier-draft-entries:: |next_version| [UNRELEASED]
1717

1818
.. towncrier release notes start
1919

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ docs = [
6363
"towncrier==23.6.0",
6464
"sphinx-notfound-page==0.8.3",
6565
"sphinxext-opengraph==0.9.1",
66+
"versioningit>=3.3.0",
6667
]
6768

6869
[dependency-groups]

0 commit comments

Comments
 (0)