]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3985] Fix version in conf.py for EPUB generation in RTD
authorAndrei Pavel <andrei@isc.org>
Mon, 27 Apr 2026 12:16:56 +0000 (15:16 +0300)
committerAndrei Pavel <andrei@isc.org>
Mon, 27 Apr 2026 12:22:02 +0000 (15:22 +0300)
doc/sphinx/conf.py

index 0d1980ba1f50e5d4afd0fd10e441ed60e949f7a1..82c60c513f18a785bb10d5b967908cd9f98ea4e8 100644 (file)
@@ -36,30 +36,33 @@ def get_version():
     meson_build_path = '../../meson.build'
     changelog_path = '../../ChangeLog'
     with open(meson_build_path, encoding='utf-8') as f:
-        version = None
+        v = None
         for line in f.readlines():
             m = re.search(r"version: '([0-9.]+)(|-git)',", line)
             if m is not None:
-                version = ''.join(m.groups())
+                v = ''.join(m.groups())
                 break
-    if version is None or version == '':
+    if v is None or v == '':
         print('ERROR: Cannot determine Kea version from meson.build.')
         sys.exit(1)
 
     # If the first line of the ChangeLog announces release, it means
     # that this is the final release.
-    dash_parts = version.split('-')
+    dash_parts = v.split('-')
     candidate_release = dash_parts[0]
     with open(changelog_path, encoding='utf-8') as changelog_file:
         first_line = changelog_file.readline()
         if candidate_release in first_line and 'released' in first_line:
-            version = candidate_release
-    return version
+            v = candidate_release
+    return v
 
 
-release = get_version()
+# "version" is required for epub.
+# "release" is required for the other formats.
+version = get_version()
+release = version
 
-cloudsmith_series = '-'.join(release.split('.')[0:2])
+cloudsmith_series = '-'.join(version.split('.')[0:2])
 
 # now let's replace versions with odd minor number with dev
 if int(cloudsmith_series[-1]) % 2 != 0: