docs: gen-sphinx-versioning-flags.py: implement the stable branch logic used for 0.3.0 release

This commit is contained in:
Christian Schwarz 2020-09-12 13:10:53 +02:00
parent 17e152c601
commit 53028ed50a

View File

@ -58,13 +58,11 @@ for latest_patch in latest_by_major_minor:
cmdline.append("--whitelist-tags") cmdline.append("--whitelist-tags")
cmdline.append(f"^{re.escape(latest_patch.orig)}$") cmdline.append(f"^{re.escape(latest_patch.orig)}$")
# we want to render the latest non-rc version as the default page # we want flexibility to update docs for the latest stable release
# (latest_by_major_minor is already sorted) # => we have a branch for that, called `stable` which we move manually
default_version = latest_by_major_minor[-1] # TODO: in the future, have f"stable-{latest_by_major_minor[-1]}"
for tag in reversed(latest_by_major_minor): default_version = "stable"
if tag.rc == 0: cmdline.extend(["--whitelist-branches", default_version])
default_version = tag
break
cmdline.extend(["--root-ref", f"{default_version}"]) cmdline.extend(["--root-ref", f"{default_version}"])
cmdline.extend(["--banner-main-ref", f"{default_version}"]) cmdline.extend(["--banner-main-ref", f"{default_version}"])
@ -73,4 +71,4 @@ cmdline.extend(["--sort", "semver"])
cmdline.extend(["--whitelist-branches", "master"]) cmdline.extend(["--whitelist-branches", "master"])
print(" ".join(cmdline)) print(" ".join(cmdline))