* [PATCH 1/2] doc/setversions.py: move arg parsing to main function
2026-05-14 10:53 [PATCH 0/2] doc: setversions.py fixes Antonin Godard
@ 2026-05-14 10:53 ` Antonin Godard
2026-05-14 10:53 ` [PATCH 2/2] doc/setversions.py: use older lts series to check tag existence Antonin Godard
1 sibling, 0 replies; 3+ messages in thread
From: Antonin Godard @ 2026-05-14 10:53 UTC (permalink / raw)
To: bitbake-devel; +Cc: Thomas Petazzoni, docs, Antonin Godard
Otherwise conflicts with Sphinx's arguments.
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
doc/setversions.py | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/doc/setversions.py b/doc/setversions.py
index dc0bb11e75e..8e934667f93 100755
--- a/doc/setversions.py
+++ b/doc/setversions.py
@@ -24,15 +24,6 @@ import textwrap
from urllib.request import urlopen, URLError
-parser = argparse.ArgumentParser(
- description="Parse https://dashboard.yoctoproject.org/releases.json to get current releases information"
-)
-parser.add_argument("--get-latest-branch",
- help="Print current latest branch and exit",
- action="store_true",
- default=False)
-args = parser.parse_args()
-
# NOTE: the following variables contain default values in case we are not able to fetch
# the releases.json file from https://dashboard.yoctoproject.org/releases.json
DEVBRANCH = "2.18"
@@ -95,16 +86,26 @@ if RELEASES_FROM_JSON:
# current releases is also an LTS
ACTIVERELEASES = list(dict.fromkeys([current_branch] + LTSSERIES))
-if args.get_latest_branch:
- print(ACTIVERELEASES[0])
- sys.exit(0)
-
print(f"ACTIVERELEASES calculated to be {ACTIVERELEASES}", file=sys.stderr)
print(f"DEVBRANCH calculated to be {DEVBRANCH}", file=sys.stderr)
print(f"LTSSERIES calculated to be {LTSSERIES}", file=sys.stderr)
BB_RELEASE_TAG_RE = re.compile(r"^[0-9]+\.[0-9]+\.[0-9]+$")
+def main():
+ parser = argparse.ArgumentParser(
+ description="Parse https://dashboard.yoctoproject.org/releases.json to get current releases information"
+ )
+ parser.add_argument("--get-latest-branch",
+ help="Print current latest branch and exit",
+ action="store_true",
+ default=False)
+ args = parser.parse_args()
+
+ if args.get_latest_branch:
+ print(ACTIVERELEASES[0])
+ sys.exit(0)
+
def get_current_version():
# Test tags exist and inform the user to fetch if not
try:
@@ -368,3 +369,6 @@ def write_releases_rst(releases_rst_out: str):
- :yocto_docs:`1.6.2 BitBake User Manual </1.6.2/bitbake-user-manual/bitbake-user-manual.html>`
- :yocto_docs:`1.6.3 BitBake User Manual </1.6.3/bitbake-user-manual/bitbake-user-manual.html>`
"""))
+
+if __name__ == "__main__":
+ main()
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] doc/setversions.py: use older lts series to check tag existence
2026-05-14 10:53 [PATCH 0/2] doc: setversions.py fixes Antonin Godard
2026-05-14 10:53 ` [PATCH 1/2] doc/setversions.py: move arg parsing to main function Antonin Godard
@ 2026-05-14 10:53 ` Antonin Godard
1 sibling, 0 replies; 3+ messages in thread
From: Antonin Godard @ 2026-05-14 10:53 UTC (permalink / raw)
To: bitbake-devel; +Cc: Thomas Petazzoni, docs, Antonin Godard
Using the most recent LTS series to check if a tag exist may fail if the
LTS was recently created. Use the older one instead.
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
doc/setversions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/setversions.py b/doc/setversions.py
index 8e934667f93..2df384e9117 100755
--- a/doc/setversions.py
+++ b/doc/setversions.py
@@ -109,7 +109,7 @@ def main():
def get_current_version():
# Test tags exist and inform the user to fetch if not
try:
- subprocess.run(["git", "show", f"{LTSSERIES[0]}.0"],
+ subprocess.run(["git", "show", f"{LTSSERIES[-1]}.0"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True)
except subprocess.CalledProcessError:
sys.exit("Please run 'git fetch --tags' before building the documentation")
--
2.54.0
^ permalink raw reply related [flat|nested] 3+ messages in thread