From: Colin Watson <cjwatson@debian.org>
Date: Sun, 30 Nov 2025 15:47:08 +0000
Subject: Handle building docs without installation

Forwarded: not-needed
Last-Update: 2025-11-30
---
 docs/conf.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/conf.py b/docs/conf.py
index 1929c91..f13c049 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -37,7 +37,10 @@ source_suffix = {".rst": "restructuredtext"}
 master_doc = "index"
 project = "django-contact-form"
 copyright = "James Bennett and contributors"
-version = get_version("django-contact-form")
+if "DEB_VERSION_UPSTREAM" in os.environ:
+    version = os.environ["DEB_VERSION_UPSTREAM"]
+else:
+    version = get_version("django-contact-form")
 release = version
 exclude_trees = ["_build"]
 pygments_style = "sphinx"
