From 97124323515359ea1cf3f7e987331401c5be70e9 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Mon, 21 Sep 2026 14:57:22 -0500 Subject: [PATCH] Show the released version in the docs instead of "0+untagged" Read the Docs clones shallowly and fetches only the branch ref, so the build had no tags for versioneer to describe and `dandi.__version__` fell back to "0+untagged.353.gd92c917". Fetch the history and tags in a post_checkout job, before `pip install .` runs versioneer. Also strip the local version segment for display: `version` is now the released portion (e.g. "0.80.0") while `release` keeps the full commit-precise string, and `html_title` uses `version` since Sphinx's default builds that title from `release`. Co-Authored-By: Claude Opus 5 (1M context) --- .readthedocs.yaml | 3 +++ docs/source/conf.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e43bb4339..d297979d5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,6 +3,9 @@ build: os: ubuntu-22.04 tools: python: "3.11" + jobs: + post_checkout: + - git fetch --unshallow --tags || git fetch --tags python: install: - requirements: docs/requirements.txt diff --git a/docs/source/conf.py b/docs/source/conf.py index 7d9ad8788..b97fa725d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,8 +23,9 @@ copyright = "2021-%Y The DANDI Team" author = "The DANDI Team" -# The full version, including alpha/beta/rc tags -version = dandi.__version__ +# The released portion of the version +version = dandi.__version__.split("+")[0] +# The full version, including alpha/beta/rc tags and any local version segment release = dandi.__version__ @@ -60,6 +61,8 @@ # -- Options for HTML output ------------------------------------------------- +html_title = f"{project} {version} documentation" + # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. #