Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New RTD/sphinx build warning #153

Closed
jakkdl opened this issue Jan 8, 2025 · 5 comments
Closed

New RTD/sphinx build warning #153

jakkdl opened this issue Jan 8, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@jakkdl
Copy link

jakkdl commented Jan 8, 2025

We recently got a RTD build failure stemming from sphinx-codeautolink, and I'm supremely confused why it started failing just now.

/home/docs/checkouts/readthedocs.org/user_builds/flake8-async/checkouts/335/docs/glossary.rst: WARNING: Could not match transformation of `trio` on source lines 1-1, source:
from trio import CancelScope, lowlevel
# or
# from anyio import CancelScope, lowlevel

with CancelScope(shield=True):
    await lowlevel.checkpoint() [codeautolink.match_name]

generated html is

<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span><span class="w"> </span><span class="nn">trio</span><span class="w"> </span><span class="kn">import</span> <a class="sphinx-codeautolink-a" href="https://trio.readthedocs.io/en/latest/reference-core.html#trio.CancelScope" title="trio.CancelScope"><span class="n">CancelScope</span></a><span class="p">,</span> <a class="sphinx-codeautolink-a" href="https://trio.readthedocs.io/en/latest/reference-lowlevel.html#module-trio.lowlevel" title="trio.lowlevel"><span class="n">lowlevel</span></a>

which seems perfectly fine to me. I can repro it locally (clone the repo and run tox -e docs) and viewing the html page it seems identical to previously passing builds.

PR: python-trio/flake8-async#335
failing build: https://readthedocs.org/projects/flake8-async/builds/26766124/
previously passing build: https://readthedocs.org/projects/flake8-async/builds/26677112/

I tried changing the code in the example to see if it was from trio import x, y specifically that made it fail - but I get the same warning with import trio.

I have no clue what changed between these builds, making one fail and not the other. No deps have had new releases, it doesn't seem dependent on specific python versions (RTD builds with 3.13.0, I can repro it locally with py311 and py312). Maybe it's ubuntu-lts-latest and/or RTD, and it's always been failing locally, but...??

@felix-hilden
Copy link
Owner

I just yesterday noticed the same thing fixing other things! It was fixed temporarily in #151 and a proper fix is pending in #152. It seems to have been caused by a new pygments release that contained some undocumented changes to the python lexer, more info in the issue. I'll keep this open just in case, but I'll look to solve this soon. In the meantime you can use our master or require pygments<2.19 explicitly 👌 Lemme know if it helps!

@jakkdl
Copy link
Author

jakkdl commented Jan 8, 2025

That's plenty info to work around it on our end, thanks for the quick response!

@felix-hilden
Copy link
Owner

It's now fixed for good on master, but I'll keep this issue open until release. I'll do some other maintenance first 👌 but you can expect it within a few days at least!

@felix-hilden
Copy link
Owner

Version 0.16.0 is now released, but let me know if the issues persist!

@jakkdl
Copy link
Author

jakkdl commented Jan 12, 2025

Everything works, thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants