From 46a850d32e38cf16f8e9b441be2546b0ebf6d075 Mon Sep 17 00:00:00 2001 From: Leon Haffmans Date: Wed, 30 Jul 2025 22:32:28 +0200 Subject: [PATCH] =?UTF-8?q?fix(docs):=20=F0=9F=A9=B9=F0=9F=93=84Fix=20doc?= =?UTF-8?q?=20creation=20for=20`/latest`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/conf.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 3a97750c6..6558695cb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,8 @@ from bo4e_cli.models.version import Version from bo4e_cli.utils.github_cli import get_access_token_from_cli_if_installed +from bo4e import __gh_version__, __version__ + sys.path.insert(0, os.path.join(__location__, "../src")) sys.path.insert(0, os.path.join(__location__, "../docs")) sys.path.insert(0, os.path.join(__location__, "../docs/compatibility")) @@ -204,11 +206,11 @@ def setup(app): if "release" not in globals(): release = os.getenv("SPHINX_DOCS_RELEASE") if not release: - from bo4e import __gh_version__ as release + release = __gh_version__ if "version" not in globals(): version = os.getenv("SPHINX_DOCS_VERSION") if not version: - from bo4e import __version__ as version + version = __version__ print(f"Got version = {version} from __version__") print(f"Got release = {release} from __gh_version__") @@ -340,9 +342,9 @@ def setup(app): # Create UML diagrams in plantuml format. Compile these into svg files into the _static folder. # See docs/uml.py for more details. -release_version = Version.from_str(release) +release_version = Version.from_str(__gh_version__) if not release_version.is_dirty(): - uml.LINK_URI_BASE = f"https://bo4e.github.io/BO4E-python/{release}" + uml.LINK_URI_BASE = f"https://bo4e.github.io/BO4E-python/{__gh_version__}" _exec_plantuml = Path(__location__) / "plantuml.jar" _network, _namespaces_to_parse = uml.build_network(Path(module_dir), uml.PlantUMLNetwork) print(_network) @@ -360,7 +362,7 @@ def setup(app): compiling_from_release_workflow = not release_version.is_dirty() last_versions = get_last_n_tags( n=3, - ref=str(release) if compiling_from_release_workflow else "HEAD", + ref=str(release_version) if compiling_from_release_workflow else "HEAD", exclude_candidates=True, exclude_technical_bumps=True, token=gh_token,