From b6ce93d565cec4eca94da05f3b9bf7f6bf115b75 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 20 Apr 2022 11:33:44 +0100 Subject: conf.py/poky.yaml: Move version information to poky.yaml and read in conf.py Merge in the changes from master allowing conf.py to use information from poky.yaml. This allows the head version mapped to X.999 on the website to have the version information displayed clearly and correctly. (From yocto-docs rev: df813c6d6c1477519f13699987215c8d9bc0a7bf) Signed-off-by: Richard Purdie --- documentation/conf.py | 22 ++++++++++++++++++++-- documentation/poky.yaml | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'documentation') diff --git a/documentation/conf.py b/documentation/conf.py index 4df8f55d17..df67a5cdf2 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -15,9 +15,27 @@ import os import sys import datetime +try: + import yaml +except ImportError: + sys.stderr.write("The Yocto Project Sphinx documentation requires PyYAML.\ + \nPlease make sure to install pyyaml python package.\n") + sys.exit(1) -current_version = "3.1.15" -bitbake_version = "1.46" +# current_version = "dev" +# bitbake_version = "" # Leave empty for development branch +# Obtain versions from poky.yaml instead +with open("poky.yaml") as data: + buff = data.read() + subst_vars = yaml.safe_load(buff) + if "DOCCONF_VERSION" not in subst_vars: + sys.stderr.write("Please set DOCCONF_VERSION in poky.yaml") + sys.exit(1) + current_version = subst_vars["DOCCONF_VERSION"] + if "BITBAKE_SERIES" not in subst_vars: + sys.stderr.write("Please set BITBAKE_SERIES in poky.yaml") + sys.exit(1) + bitbake_version = subst_vars["BITBAKE_SERIES"] # String used in sidebar version = 'Version: ' + current_version diff --git a/documentation/poky.yaml b/documentation/poky.yaml index e0f8166f72..edc23f8aa7 100644 --- a/documentation/poky.yaml +++ b/documentation/poky.yaml @@ -5,6 +5,8 @@ DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus" YOCTO_DOC_VERSION : "3.1.15" YOCTO_DOC_VERSION_MINUS_ONE : "3.0.4" DISTRO_REL_TAG : "yocto-3.1.15" +DOCCONF_VERSION : "3.1.15" +BITBAKE_SERIES : "1.46" POKYVERSION : "23.0.15" YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;" YOCTO_DL_URL : "https://downloads.yoctoproject.org" -- cgit v1.2.3-54-g00ecf