diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-20 11:33:44 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-20 17:27:06 +0100 |
commit | eff78b3802ffa7a0bff4c839752b147712da63ac (patch) | |
tree | 9eb16eb0f8f3f222c50852f7aa24c20fa93a7ee3 | |
parent | 42735fc06daf32785d470622b170ab2dc5073926 (diff) | |
download | poky-eff78b3802ffa7a0bff4c839752b147712da63ac.tar.gz |
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: 7afbdfeda280d3a8308a82c2af568578627a4124)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | documentation/conf.py | 22 | ||||
-rw-r--r-- | documentation/poky.yaml | 2 |
2 files changed, 22 insertions, 2 deletions
diff --git a/documentation/conf.py b/documentation/conf.py index bef6fbfa40..22d0dd604a 100644 --- a/documentation/conf.py +++ b/documentation/conf.py | |||
@@ -15,9 +15,27 @@ | |||
15 | import os | 15 | import os |
16 | import sys | 16 | import sys |
17 | import datetime | 17 | import datetime |
18 | try: | ||
19 | import yaml | ||
20 | except ImportError: | ||
21 | sys.stderr.write("The Yocto Project Sphinx documentation requires PyYAML.\ | ||
22 | \nPlease make sure to install pyyaml python package.\n") | ||
23 | sys.exit(1) | ||
18 | 24 | ||
19 | current_version = "3.4.3" | 25 | # current_version = "dev" |
20 | bitbake_version = "1.52" | 26 | # bitbake_version = "" # Leave empty for development branch |
27 | # Obtain versions from poky.yaml instead | ||
28 | with open("poky.yaml") as data: | ||
29 | buff = data.read() | ||
30 | subst_vars = yaml.safe_load(buff) | ||
31 | if "DOCCONF_VERSION" not in subst_vars: | ||
32 | sys.stderr.write("Please set DOCCONF_VERSION in poky.yaml") | ||
33 | sys.exit(1) | ||
34 | current_version = subst_vars["DOCCONF_VERSION"] | ||
35 | if "BITBAKE_SERIES" not in subst_vars: | ||
36 | sys.stderr.write("Please set BITBAKE_SERIES in poky.yaml") | ||
37 | sys.exit(1) | ||
38 | bitbake_version = subst_vars["BITBAKE_SERIES"] | ||
21 | 39 | ||
22 | # String used in sidebar | 40 | # String used in sidebar |
23 | version = 'Version: ' + current_version | 41 | version = 'Version: ' + current_version |
diff --git a/documentation/poky.yaml b/documentation/poky.yaml index 9398fd5cb1..d8ee000c0c 100644 --- a/documentation/poky.yaml +++ b/documentation/poky.yaml | |||
@@ -6,6 +6,8 @@ DISTRO_NAME_NO_CAP_LTS : "dunfell" | |||
6 | YOCTO_DOC_VERSION : "3.4.3" | 6 | YOCTO_DOC_VERSION : "3.4.3" |
7 | YOCTO_DOC_VERSION_MINUS_ONE : "3.3.5" | 7 | YOCTO_DOC_VERSION_MINUS_ONE : "3.3.5" |
8 | DISTRO_REL_TAG : "yocto-3.4.3" | 8 | DISTRO_REL_TAG : "yocto-3.4.3" |
9 | DOCCONF_VERSION : "3.4.3" | ||
10 | BITBAKE_SERIES : "1.52" | ||
9 | POKYVERSION : "26.0.3" | 11 | POKYVERSION : "26.0.3" |
10 | YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;" | 12 | YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;" |
11 | YOCTO_DL_URL : "https://downloads.yoctoproject.org" | 13 | YOCTO_DL_URL : "https://downloads.yoctoproject.org" |