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
This commit is contained in:
Andreas Jaeger 2020-05-18 22:25:14 +02:00
parent 1bd472165f
commit 087bf2e820

View File

@ -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