Skip to content

Sphinx 8.1+: "Could not match transformation ..." #192

@cmarqu

Description

@cmarqu

Starting with Sphinx 8.1 (I think), I am getting "Could not match transformation ..." warnings for otherwise nicely working links.

I have added more variables to the message logging to help debugging, but I haven't figured out the root cause yet (I also tried setting re.DEBUG but boy is this chatty...).

Sphinx 8.0 (https://www.sphinx-doc.org/en/master/changes/8.0.html):

name=Name(import_components=['cocotb', 'triggers', 'Timer'], code_str='Timer', lineno=63, end_lineno=63, context=<LinkContext.none: 'none'>, resolved_location='cocotb.triggers.Timer')
construct_name_pattern(name)='(?<!<span class="o">\\.</span>)()<span class="[a-z]+">@?Timer</span>(?!(<span class="o">\\.)|(</a>))'
selection='        <span class="k">await</span> <span class="n">Timer</span><span class="p">(</span><span class="mf">3.3</span><span class="p">,</span> <span class="s2">"us"</span><span class="p">)</span>'
/home/colin/tools/cocotb/docs/source/coroutines.rst: Matched transformation of `Timer` on source lines 3-3, source:
async def wait_10ns():
    cocotb.log.info("About to wait for 10 ns")
    await Timer(10, unit='ns')
    cocotb.log.info("Simulation time has advanced by 10 ns")

Sphinx 8.1 (https://www.sphinx-doc.org/en/master/changes/8.1.html):

name=Name(import_components=['cocotb', 'triggers', 'Timer'], code_str='Timer', lineno=63, end_lineno=63, context='none', resolved_location='cocotb.triggers.Timer')
construct_name_pattern(name)='(?<!<span class="o">\\.</span>)()<span class="[a-z]+">@?Timer</span>(?!(<span class="o">\\.)|(</a>))'
selection='        <span class="k">await</span> <a class="sphinx-codeautolink-a" href="library_reference.html#cocotb.triggers.Timer" title="cocotb.triggers.Timer"><span class="n">Timer</span></a><span class="p">(</span><span class="mf">3.3</span><span class="p">,</span> <span class="s2">"us"</span><span class="p">)</span>' [codeautolink.match_name]�[39;49;00m
�[91m/home/colin/tools/cocotb/docs/source/coroutines.rst: WARNING: Could not match transformation of `Timer` on source lines 3-3, source:
async def wait_10ns():
    cocotb.log.info("About to wait for 10 ns")
    await Timer(10, unit='ns')
    cocotb.log.info("Simulation time has advanced by 10 ns")

I suppose CI of sphinx-codeautolink should run every once in a while (even without changes in its own codebase) and check the latest releases of tools to find problems like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions