Skip to content

Commit

Permalink
doc: add msg for deb build
Browse files Browse the repository at this point in the history
  • Loading branch information
tzing committed May 15, 2024
1 parent 5921096 commit 6b9f581
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

import datetime
import importlib.metadata
import os
import subprocess

is_tag_release = os.environ.get("READTHEDOCS_VERSION_TYPE") == "tag"

# -- Project information -----------------------------------------------------

Expand All @@ -13,7 +17,15 @@
project = "secrets.env"
copyright = f"{this_year}, tzing"
author = "tzing"

release = importlib.metadata.version(project)
if not is_tag_release:
commit = (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
.decode()
.strip()
)
release += f"+{commit}"


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -59,3 +71,11 @@
},
],
}

if not is_tag_release:
html_theme_options["announcement"] = (
"""
This is the development version of the documentation.
See <a href="https://secrets-env.readthedocs.io/en/stable/">stable version</a> for the latest release.
"""
)

0 comments on commit 6b9f581

Please sign in to comment.