1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 30 Dec 2024 10:52:55 +0000
Subject: Handle building docs without installation
Forwarded: not-needed
Last-Update: 2024-12-30
---
docs/source/conf.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 778e8f3..44f924d 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# alot documentation build configuration file
+import os
import pathlib
import tomllib
import importlib.metadata
@@ -54,10 +55,13 @@ copyright = "Copyright (C) Patrick Totzke"
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-version = importlib.metadata.version("alot")
-# The full version, including alpha/beta/rc tags.
-release = importlib.metadata.version("alot")
+if "DEB_VERSION_UPSTREAM" in os.environ:
+ release = version = os.environ["DEB_VERSION_UPSTREAM"]
+else:
+ # The short X.Y version.
+ version = importlib.metadata.version("alot")
+ # The full version, including alpha/beta/rc tags.
+ release = importlib.metadata.version("alot")
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
|