sphinx 4.0: Fix sphinx.ext.extlinks.make_link_role call
Commit 93cf1a57d [1] added a new parameter, 'name', to this function. Include that when we detect Sphinx 4.x in use. [1] https://github.com/sphinx-doc/sphinx/commit/93cf1a57d Change-Id: I3b05df39f701280052d8a0d4f261e8749669ca11 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
parent
e2d40fa030
commit
6cfaeb438e
@ -19,6 +19,7 @@ import textwrap
|
||||
|
||||
import dulwich.repo
|
||||
from pbr import packaging
|
||||
import sphinx
|
||||
from sphinx.ext import extlinks
|
||||
from sphinx.util import logging
|
||||
|
||||
@ -298,7 +299,13 @@ def _setup_link_roles(app):
|
||||
role_name,
|
||||
url,
|
||||
)
|
||||
app.add_role(role_name, extlinks.make_link_role(url, project_name))
|
||||
|
||||
if sphinx.version_info >= (4, 0, 0):
|
||||
role = extlinks.make_link_role(project_name, url, project_name)
|
||||
else:
|
||||
role = extlinks.make_link_role(url, project_name)
|
||||
|
||||
app.add_role(role_name, role)
|
||||
|
||||
|
||||
def _find_setup_cfg(srcdir):
|
||||
|
Loading…
Reference in New Issue
Block a user