You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using autodoc extension with autodoc_mock_imports configuration value, importing mocked module, then extending class from that module with generic on a new class causes exception when generating docs. Exception looks like this:
WARNING: [autosummary] failed to import main.
Possible hints:
* KeyError: 'main'
* ValueError: not enough values to unpack (expected 2, got 1)
* TypeError: Some type variables (pydantic.BaseModel) are not listed in Generic[T]
@electric-coder It's not a pydantic-related issue, it's more generic. Pydantic here just for example. If I want to inherit any mocked library's class and define any generics on it I will get the same error.
@IkorJefocur generics have caused a number of problems #11327 I'm lucky not to have run into any of them. As an end-user I'd advise you to try narrowing down the problem because mock, inheritance, generics and pydantic are known to cause problems individually, so I'm not surprised that putting them all together is causing an error. In my experience just because something works at run time it does not mean it won't break 3rd party tooling.
It's not a pydantic-related issue
Can you test it by mocking one of your own moduies and adjust the minimum reproducible example? It would be helpful in narrowing down the issue, the less complexity the better.
Describe the bug
Using autodoc extension with
autodoc_mock_imports
configuration value, importing mocked module, then extending class from that module with generic on a new class causes exception when generating docs. Exception looks like this:How to Reproduce
Environment Information
Sphinx extensions
Additional context
No response
The text was updated successfully, but these errors were encountered: