Skip to content

Fix docs build: resolve InteractiveShell forward reference#1506

Closed
erikgaas wants to merge 7 commits intoipython:mainfrom
erikgaas:fix-docs-forward-ref
Closed

Fix docs build: resolve InteractiveShell forward reference#1506
erikgaas wants to merge 7 commits intoipython:mainfrom
erikgaas:fix-docs-forward-ref

Conversation

@erikgaas
Copy link

@erikgaas erikgaas commented Mar 6, 2026

Summary

The docs build has been failing because sphinx_autodoc_typehints cannot resolve the inherited shell: InteractiveShell annotation on KernelMagics. The annotation comes from IPython's Magics base class, but sphinx evaluates it in the parent module's namespace where InteractiveShell isn't available.

Fix

Re-declare the shell type annotation directly in KernelMagics, where InteractiveShell is already imported.

1 file changed, 1 insertion.

erikgaas and others added 7 commits March 6, 2026 11:04
…agics

sphinx_autodoc_typehints cannot resolve inherited type annotations from
parent classes in a different module. KernelMagics inherits shell: InteractiveShell
from IPython's Magics, but sphinx evaluates it in the parent module's namespace.

Re-declare the annotation in KernelMagics so sphinx resolves it in zmqshell.py
where InteractiveShell is imported.
@erikgaas erikgaas closed this Mar 6, 2026
@erikgaas erikgaas reopened this Mar 6, 2026
@erikgaas erikgaas closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant