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

Message ID 20220420112936.2523983-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series [dunfell] conf.py/poky.yaml: Move version information to poky.yaml and read in conf.py | expand

Commit Message

Richard Purdie April 20, 2022, 11:29 a.m. UTC
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 documentation/conf.py   | 22 ++++++++++++++++++++--
 documentation/poky.yaml |  2 ++
 2 files changed, 22 insertions(+), 2 deletions(-)

Comments

Quentin Schulz April 20, 2022, 2:33 p.m. UTC | #1
Hi Richard,

Thanks for helping me with this!

On 4/20/22 13:29, Richard Purdie wrote:
> 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.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>   documentation/conf.py   | 22 ++++++++++++++++++++--
>   documentation/poky.yaml |  2 ++
>   2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/documentation/conf.py b/documentation/conf.py
> index 4df8f55d1..df67a5cdf 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 e0f8166f7..edc23f8aa 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"

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
Richard Purdie April 20, 2022, 4:30 p.m. UTC | #2
On Wed, 2022-04-20 at 16:33 +0200, Quentin Schulz wrote:
> 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 :)

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

Cheers,

Richard
Steve Sakoman April 20, 2022, 4:48 p.m. UTC | #3
On Wed, Apr 20, 2022 at 4:34 AM Quentin Schulz
<quentin.schulz@theobroma-systems.com> wrote:
>
> Hi Richard,
>
> Thanks for helping me with this!
>
> On 4/20/22 13:29, Richard Purdie wrote:
> > 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.
> >
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> >   documentation/conf.py   | 22 ++++++++++++++++++++--
> >   documentation/poky.yaml |  2 ++
> >   2 files changed, 22 insertions(+), 2 deletions(-)
> >
> > diff --git a/documentation/conf.py b/documentation/conf.py
> > index 4df8f55d1..df67a5cdf 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 e0f8166f7..edc23f8aa 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"
>
> 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

> 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: docs+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Richard Purdie April 20, 2022, 4:52 p.m. UTC | #4
On Wed, 2022-04-20 at 06:48 -1000, Steve Sakoman wrote:
> On Wed, Apr 20, 2022 at 4:34 AM Quentin Schulz
> <quentin.schulz@theobroma-systems.com> wrote:
> > 
> > Hi Richard,
> > 
> > Thanks for helping me with this!
> > 
> > On 4/20/22 13:29, Richard Purdie wrote:
> > > 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.
> > > 
> > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > > ---
> > >   documentation/conf.py   | 22 ++++++++++++++++++++--
> > >   documentation/poky.yaml |  2 ++
> > >   2 files changed, 22 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/documentation/conf.py b/documentation/conf.py
> > > index 4df8f55d1..df67a5cdf 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 e0f8166f7..edc23f8aa 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"
> > 
> > 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!

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

Patch

diff --git a/documentation/conf.py b/documentation/conf.py
index 4df8f55d1..df67a5cdf 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 e0f8166f7..edc23f8aa 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"