From 087bf2e8209a1acca29cab90954a2f67e5ea80ce Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 18 May 2020 22:25:14 +0200 Subject: [PATCH] Fix auto_name logic In this case: project = "Some random name" openstackdocs_auto_name = False openstackdocs_auto_version = True The call packaging.get_version(project_name) would fail, like in python-monascaclient change https://review.opendev.org/729023. Fix the logic to use the real project name for getting the version. Change-Id: I0cb51a6535936bdc009a34a5956434030dd6bec8 --- openstackdocstheme/ext.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstackdocstheme/ext.py b/openstackdocstheme/ext.py index 54b2e3a0..b7f16792 100644 --- a/openstackdocstheme/ext.py +++ b/openstackdocstheme/ext.py @@ -422,8 +422,9 @@ def _builder_inited(app): auto_version = True if auto_version: + real_project_name = _get_project_name(app.srcdir) try: - project_version = packaging.get_version(project_name) + project_version = packaging.get_version(real_project_name) except Exception: project_version = None