diff website/www/conf.py @ 7468:f100f5fdf6bf

Autmatically get version and release from roundup/__init__.py Copy code from docs/conf.py that generates the release and version settings from roundup/__init__.py into website/www/conf.py. Update RELEASE.txt to remove need to set these manually and annotate a couple of other documented changes.
author John Rouillard <rouilj@ieee.org>
date Thu, 08 Jun 2023 01:02:32 -0400
parents 51fc06fabcee
children 452a8bd1d826
line wrap: on
line diff
--- a/website/www/conf.py	Thu Jun 08 00:33:02 2023 -0400
+++ b/website/www/conf.py	Thu Jun 08 01:02:32 2023 -0400
@@ -19,6 +19,20 @@
 
 import sys, os
 
+# Read Roundup version by importing it from root of checkout.
+# this ensures that 'unknown version' is inserted even if
+# `roundup` is importable from other location in sys.path
+SYSSAVE = sys.path
+DOCROOT = os.path.abspath(os.path.dirname(__file__) + "/..")
+sys.path = [os.path.dirname(DOCROOT)]
+try:
+    from roundup import __version__ as VERSION
+    SHORTVER = '.'.join(VERSION.split('.', 2)[:2])
+except ImportError:
+    VERSION = SHORTVER = '(unknown version)'
+finally:
+    sys.path = SYSSAVE
+
 # If your extensions are in another directory, add it here. If the directory
 # is relative to the documentation root, use os.path.abspath to make it
 # absolute, like shown here.
@@ -55,9 +69,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '2.3b2'
+version = SHORTVER
 # The full version, including alpha/beta/rc tags.
-release = '2.3.0b2'
+release = VERSION
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

Roundup Issue Tracker: http://roundup-tracker.org/