3737from bo4e_cli .models .version import Version
3838from bo4e_cli .utils .github_cli import get_access_token_from_cli_if_installed
3939
40+ from bo4e import __gh_version__ , __version__
41+
4042sys .path .insert (0 , os .path .join (__location__ , "../src" ))
4143sys .path .insert (0 , os .path .join (__location__ , "../docs" ))
4244sys .path .insert (0 , os .path .join (__location__ , "../docs/compatibility" ))
@@ -204,11 +206,11 @@ def setup(app):
204206if "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__
208210if "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
213215print (f"Got version = { version } from __version__" )
214216print (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__ )
344346if 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 )
348350print (_network )
@@ -360,7 +362,7 @@ def setup(app):
360362compiling_from_release_workflow = not release_version .is_dirty ()
361363last_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