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

Sphinx 7.4.6: autosummary: Failed to import module #12660

Open
AA-Turner opened this issue Jul 23, 2024 · 3 comments
Open

Sphinx 7.4.6: autosummary: Failed to import module #12660

AA-Turner opened this issue Jul 23, 2024 · 3 comments

Comments

@AA-Turner
Copy link
Member

AA-Turner commented Jul 23, 2024

Is there any chance this change would have introduced a warning by mistake? We use our own module.rst and class.rst templates, but they look awfully similar to the ones here.

We're seeing:

Warning, treated as error:
[autosummary] failed to import foo.
Possible hints:
* ModuleNotFoundError: No module named 'foo'
* KeyError: 'foo'
* ValueError: not enough values to unpack (expected 2, got 1)

good chance this is user-error, but thought I would ask (it does work just before 7.4.6)!

Originally posted by @mwalsh161 in #12609 (comment)

@AA-Turner
Copy link
Member Author

Hi Michael (@mwalsh161), thanks for writing. I haven't had any further reports of issues, so my first instinct would be to suspect the templates. The ValueError re unpacking also looks interesting.

Are you able to share either your project or a minimal reporoducer so that we might investigate?

Best,
Adam

@rtuck99
Copy link

rtuck99 commented Jul 23, 2024

I am also seeing this issue, I believe there was a change between versions 7.3.7 and 7.4.6, which causes documentation table of contents not to be generated.

I get similar warnings e.g.

WARNING: [autosummary] failed to import i03.
Possible hints:
* ValueError: not enough values to unpack (expected 2, got 1)
* KeyError: 'i03'
* ModuleNotFoundError: No module named 'i03'

Compare the following two github builds:

version 7.3.7

https://github.com/DiamondLightSource/dodal/actions/runs/9891318307/job/27321488418
which builds correctly and generates api documentation:
https://diamondlightsource.github.io/dodal/1.29.3/user/reference/generated/dodal.beamlines.html

version 7.4.6

https://github.com/DiamondLightSource/dodal/actions/runs/10009596477/job/27668842307
which builds documentation that no longer includes the subpackages
https://diamondlightsource.github.io/dodal/1.29.4/user/reference/generated/dodal.beamlines.html

I believe this may be related to change #12609 as the generated sources no longer appear to have prefixes e.g.

.. autosummary::
   :toctree:
   :recursive:

   i03
   i04
   i04_1
   i20_1
   i22
   i23
   i24
   p38
   p45

@AA-Turner
Copy link
Member Author

Also xref scikit-image/scikit-image#7297 (comment) by @mkcor:

Thanks, @AA-Turner, this install worked. Unfortunately, I'm getting the same error as with 7.4.5 and 7.4.6, i.e.,

Warning, treated as error:
Summarised items should not include the current module. Replace 'skimage.color' with 'color'.
[autosummary.import_cycle]
make: *** [Makefile:50: html] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants