Friday, June 4, 2021

Upgrade to Sphinx 4

In eid I had the following problem:

Extension error (sphinx.ext.extlinks):
Handler <function setup_link_roles at 0x7f381b1c1048> for event 'builder-inited' threw an exception (exception: 'NoneType' object has no attribute 'replace')

This was because atelier.sphinxconf.default_conf didn’t test for an empty srcref_url_template(). Now it does:

if prj.main_package:
    root_mod, tpl = srcref_url_template(prj.main_package)
    if tpl:
        extlinks.update(srcref=(tpl, ''))

A second problem was this:

from sphinx.roles import menusel_role
ImportError: cannot import name 'menusel_role'

from sphinx.roles import MenuSelection as menusel_role
ImportError: cannot import name 'menusel_role'

A third problem was in Lino Welfare:

docs/specs/plugins.rst:5: WARNING: duplicated entry found in toctree: specs/clients