Open IkorJefocur opened 3 weeks ago
Possibly related #12512 you might want to take a look at autodoc_pydantic
.
@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