Skip to contentSkip to conversation

conf.py/poky.yaml: Move version information to poky.yaml and read in conf.py

PATCH In review Richard Purdie 3 participants 8 messages Apr 21, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 documentation/conf.py   | 22 ++++++++++++++++++++--
 documentation/poky.yaml |  2 ++
 2 files changed, 22 insertions(+), 2 deletions(-)
documentation/conf.py +20 -2
index 4df8f55d1..df67a5cdf 100644
@@ -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
documentation/poky.yaml +2 -0
index e0f8166f7..edc23f8aa 100644
@@ -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"
Signature · 1 line
2.32.0
#1 lore raw

PATCH 1/1 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.

---
 documentation/conf.py   | 21 ++++++++++++++++++++-
 documentation/poky.yaml |  2 ++
 2 files changed, 22 insertions(+), 1 deletion(-)
documentation/conf.py +20 -1
index 1efd63ca1..fe27e3e0d 100644
@@ -15,8 +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.2.4"
+# 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
documentation/poky.yaml +2 -0
index 189f7bec6..fb567a11d 100644
@@ -5,6 +5,8 @@ DISTRO_NAME_NO_CAP_MINUS_ONE : "dunfell"
 YOCTO_DOC_VERSION : "3.2.4"
 YOCTO_DOC_VERSION_MINUS_ONE : "3.1.7"
 DISTRO_REL_TAG : "yocto-3.2.4"
+DOCCONF_VERSION : "3.2.4"
+BITBAKE_SERIES : "1.48"
 POKYVERSION : "24.0.4"
 YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
 YOCTO_DL_URL : "https://downloads.yoctoproject.org"
Signature · 1 line
2.32.0
#2 lore raw

PATCH 1/1 conf.py/poky.yaml: Move version information to poky.yaml and read in conf.py

In reply to Richard Purdie

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.

---
 documentation/conf.py   | 22 ++++++++++++++++++++--
 documentation/poky.yaml |  2 ++
 2 files changed, 22 insertions(+), 2 deletions(-)
documentation/conf.py +20 -2
index e7c2e502f..d2478ae00 100644
@@ -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.3.6"
-bitbake_version = "1.50"
+# 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
documentation/poky.yaml +2 -0
index 769a981b6..d57b4d710 100644
@@ -6,6 +6,8 @@ DISTRO_NAME_NO_CAP_LTS : "gatesgarth"
 YOCTO_DOC_VERSION : "3.3.6"
 YOCTO_DOC_VERSION_MINUS_ONE : "3.2.4"
 DISTRO_REL_TAG : "yocto-3.3.6"
+DOCCONF_VERSION : "3.3.6"
+BITBAKE_SERIES : "1.50"
 POKYVERSION : "25.0.6"
 YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
 YOCTO_DL_URL : "https://downloads.yoctoproject.org"
Signature · 1 line
2.32.0
#3 lore raw

PATCH 1/1 conf.py/poky.yaml: Move version information to poky.yaml and read in conf.py

In reply to Richard Purdie

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.

---
 documentation/conf.py   | 22 ++++++++++++++++++++--
 documentation/poky.yaml |  2 ++
 2 files changed, 22 insertions(+), 2 deletions(-)
documentation/conf.py +20 -2
index bef6fbfa4..22d0dd604 100644
@@ -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.4.3"
-bitbake_version = "1.52"
+# 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
documentation/poky.yaml +2 -0
index 9398fd5cb..d8ee000c0 100644
@@ -6,6 +6,8 @@ DISTRO_NAME_NO_CAP_LTS : "dunfell"
 YOCTO_DOC_VERSION : "3.4.3"
 YOCTO_DOC_VERSION_MINUS_ONE : "3.3.5"
 DISTRO_REL_TAG : "yocto-3.4.3"
+DOCCONF_VERSION : "3.4.3"
+BITBAKE_SERIES : "1.52"
 POKYVERSION : "26.0.3"
 YOCTO_POKY : "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;"
 YOCTO_DL_URL : "https://downloads.yoctoproject.org"
Signature · 1 line
2.32.0
#4 lore raw
In reply to Richard Purdie

Hi Richard,

Thanks for helping me with this!

Quoted 49 lines · Richard Purdie

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.

---
  documentation/conf.py   | 22 ++++++++++++++++++++--
  documentation/poky.yaml |  2 ++
  2 files changed, 22 insertions(+), 2 deletions(-)
documentation/conf.py +20 -2
index 4df8f55d1..df67a5cdf 100644
@@ -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
documentation/poky.yaml +0 -0
index e0f8166f7..edc23f8aa 100644

documentation/poky.yaml DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus" · line 9

Quoted 5 lines
documentation/poky.yaml +2 -0
@@ -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"

I was wondering if this was not the opportunity to explicit that after this commit nothing needs to be updated by maintainers for version bumping except git tagging the docs git repo?

e.g. DOCCONF_VERSION : "autogenerated-from-set_versions.py-from-master-branch"
or something like that.
Or a comment at the top of the file explaining which variables are now auto-generated by set_versions.py?

Otherwise, I tested this on all branches listed in this patch series with the autobuilder script and it does what I'd expect them to :)

Thanks!
Quentin

#5 lore raw
Quoted 4 lines · Quentin Schulz

I was wondering if this was not the opportunity to explicit that after this commit nothing needs to be updated by maintainers for version bumping except git tagging the docs git repo?

Quoted 8 lines

e.g. DOCCONF_VERSION :
"autogenerated-from-set_versions.py-from-master-branch"
or something like that.
Or a comment at the top of the file explaining which variables are now auto-generated by set_versions.py?

Otherwise, I tested this on all branches listed in this patch series with the autobuilder script and it does what I'd expect them to :)

We discussed on irc and agreed we could do that with a follow up patch if anyone wants to.

Cheers,

Richard

#6 lore raw
In reply to Quentin Schulz
Quoted 48 lines · Quentin Schulz

Hi Richard,

Thanks for helping me with this!

Quoted 42 lines · Richard Purdie

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.

---
  documentation/conf.py   | 22 ++++++++++++++++++++--
  documentation/poky.yaml |  2 ++
  2 files changed, 22 insertions(+), 2 deletions(-)
documentation/conf.py +20 -2
index 4df8f55d1..df67a5cdf 100644
@@ -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"]
 
Quoted 16 lines

documentation/poky.yaml DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus" · line 9

Quoted 12 lines
documentation/conf.py +0 -0
  # String used in sidebar
  version = 'Version: ' + current_version
documentation/poky.yaml +2 -0
index e0f8166f7..edc23f8aa 100644
@@ -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"

I was wondering if this was not the opportunity to explicit that after this commit nothing needs to be updated by maintainers for version bumping except git tagging the docs git repo?

I'm confused! Do I still need to update the version info in poky.yaml?

I have a release coming up next week and want to make sure I get this right!

Steve

Quoted 20 lines

e.g. DOCCONF_VERSION :
"autogenerated-from-set_versions.py-from-master-branch"
or something like that.
Or a comment at the top of the file explaining which variables are now auto-generated by set_versions.py?

Otherwise, I tested this on all branches listed in this patch series with the autobuilder script and it does what I'd expect them to :)

Thanks!
Quentin

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#2806): https://lists.yoctoproject.org/g/docs/message/2806
Mute This Topic: https://lists.yoctoproject.org/mt/90581577/3620601
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw
Quoted 67 lines · Steve Sakoman
Quoted 48 lines · Quentin Schulz

Hi Richard,

Thanks for helping me with this!

Quoted 42 lines · Richard Purdie

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.

---
  documentation/conf.py   | 22 ++++++++++++++++++++--
  documentation/poky.yaml |  2 ++
  2 files changed, 22 insertions(+), 2 deletions(-)
documentation/conf.py +20 -2
index 4df8f55d1..df67a5cdf 100644
@@ -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"]
 
Quoted 16 lines

documentation/poky.yaml DISTRO_NAME_NO_CAP_MINUS_ONE : "zeus" · line 9

Quoted 12 lines
documentation/conf.py +0 -0
  # String used in sidebar
  version = 'Version: ' + current_version
documentation/poky.yaml +2 -0
index e0f8166f7..edc23f8aa 100644
@@ -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"

I was wondering if this was not the opportunity to explicit that after this commit nothing needs to be updated by maintainers for version bumping except git tagging the docs git repo?

Quoted 3 lines

I'm confused! Do I still need to update the version info in poky.yaml?

I have a release coming up next week and want to make sure I get this right!

You can and it will look better on the branch but the build process no longer needs it and will override it on the website :)

Cheers,

Richard