Skip to content

Commit 1a48177

Browse files
fix: show the next version on the docs changelog
1 parent 5a12e29 commit 1a48177

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,
@@ -112,6 +113,11 @@
112113
# The short X.Y version.
113114
version = ".".join(release.split(".")[:2])
114115

116+
next_version = versioningit.get_next_version(os.path.abspath(".."))
117+
118+
rst_prolog += f"""
119+
.. |next_version| replace:: {next_version}
120+
"""
115121

116122
_IS_READTHEDOCS = bool(os.getenv("READTHEDOCS"))
117123

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
@@ -64,6 +64,7 @@ docs = [
6464
"towncrier==23.6.0",
6565
"sphinx-notfound-page==0.8.3",
6666
"sphinxext-opengraph==0.9.1",
67+
"versioningit>=3.3.0",
6768
]
6869

6970
[dependency-groups]

0 commit comments

Comments
 (0)