From: Kefu Chai Date: Tue, 1 Dec 2020 06:46:19 +0000 (+0800) Subject: doc/conf: read version and release from src/ceph_release X-Git-Tag: v16.1.0~427^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=beb218c41d594223a8cf65e9786dd7d9a2234b87;p=ceph.git doc/conf: read version and release from src/ceph_release instead of hardwiring them to 'dev' and 'dev', use the src/ceph_release as the source of truth. Signed-off-by: Kefu Chai --- diff --git a/doc/conf.py b/doc/conf.py index dc26d63e82e..9fb5479ba01 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -7,13 +7,28 @@ import sys import yaml + +top_level = \ + os.path.dirname( + os.path.dirname( + os.path.abspath(__file__))) + + +def parse_ceph_release(): + with open(os.path.join(top_level, 'src/ceph_release')) as f: + lines = f.readlines() + assert(len(lines) == 3) + # 16, pacific, dev + version, codename, status = [line.strip() for line in lines] + return version, codename, status + + # project information project = 'Ceph' copyright = ('2016, Ceph authors and contributors. ' 'Licensed under Creative Commons Attribution Share Alike 3.0 ' '(CC-BY-SA-3.0)') -version = 'dev' -release = 'dev' +version, codename, release = parse_ceph_release() pygments_style = 'sphinx' # HTML output options @@ -104,12 +119,6 @@ rst_prolog = """ .. |stable-release| replace:: octopus """ -top_level = os.path.dirname( - os.path.dirname( - os.path.abspath(__file__) - ) -) - # breath options breathe_default_project = "Ceph" # see $(top_srcdir)/Doxyfile