Skip to content

Commit 64af903

Browse files
authored
fix(docs): 🩹📄Fix doc creation for /latest (#1015)
1 parent 2385231 commit 64af903

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎docs/conf.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
from bo4e_cli.models.version import Version
3838
from bo4e_cli.utils.github_cli import get_access_token_from_cli_if_installed
3939

40+
from bo4e import __gh_version__, __version__
41+
4042
sys.path.insert(0, os.path.join(__location__, "../src"))
4143
sys.path.insert(0, os.path.join(__location__, "../docs"))
4244
sys.path.insert(0, os.path.join(__location__, "../docs/compatibility"))
@@ -204,11 +206,11 @@ def setup(app):
204206
if "release" not in globals():
205207
release = os.getenv("SPHINX_DOCS_RELEASE")
206208
if not release:
207-
from bo4e import __gh_version__ as release
209+
release = __gh_version__
208210
if "version" not in globals():
209211
version = os.getenv("SPHINX_DOCS_VERSION")
210212
if not version:
211-
from bo4e import __version__ as version
213+
version = __version__
212214

213215
print(f"Got version = {version} from __version__")
214216
print(f"Got release = {release} from __gh_version__")
@@ -340,9 +342,9 @@ def setup(app):
340342

341343
# Create UML diagrams in plantuml format. Compile these into svg files into the _static folder.
342344
# See docs/uml.py for more details.
343-
release_version = Version.from_str(release)
345+
release_version = Version.from_str(__gh_version__)
344346
if not release_version.is_dirty():
345-
uml.LINK_URI_BASE = f"https://bo4e.github.io/BO4E-python/{release}"
347+
uml.LINK_URI_BASE = f"https://bo4e.github.io/BO4E-python/{__gh_version__}"
346348
_exec_plantuml = Path(__location__) / "plantuml.jar"
347349
_network, _namespaces_to_parse = uml.build_network(Path(module_dir), uml.PlantUMLNetwork)
348350
print(_network)
@@ -360,7 +362,7 @@ def setup(app):
360362
compiling_from_release_workflow = not release_version.is_dirty()
361363
last_versions = get_last_n_tags(
362364
n=3,
363-
ref=str(release) if compiling_from_release_workflow else "HEAD",
365+
ref=str(release_version) if compiling_from_release_workflow else "HEAD",
364366
exclude_candidates=True,
365367
exclude_technical_bumps=True,
366368
token=gh_token,

0 commit comments

Comments
 (0)