Description
NUKE_POST_INJECT injects @overload decorated function signatures into the generated nuke/__init__.py, but the strings do not include a function body (...). This causes an IndentationError when importing the stubs outside of Nuke's interpreter.
Error
File "stubs/nuke/__init__.py", line 2631
@overload
^
IndentationError: expected an indented block after function definition on line 2629
Root Cause
In nukestubsgen.py, NUKE_POST_INJECT contains:
NUKE_POST_INJECT = {
'__init__': [
'@overload\ndef execute(nameOrNode: Node | str, frameRangeSet: FrameRange, ...) -> None:',
'@overload\ndef execute(nameOrNode: Node | str, start: Optional[int] = None, ...) -> None:',
]
}
Python requires a function body after a def statement. The missing ... placeholder makes the generated file syntactically invalid.
Fix
Add \n ... to each injected function string:
NUKE_POST_INJECT = {
'__init__': [
'@overload\ndef execute(nameOrNode: Node | str, frameRangeSet: FrameRange, ...) -> None:\n ...',
'@overload\ndef execute(nameOrNode: Node | str, start: Optional[int] = None, ...) -> None:\n ...',
]
}
Description
NUKE_POST_INJECTinjects@overloaddecorated function signatures into the generatednuke/__init__.py, but the strings do not include a function body (...). This causes anIndentationErrorwhen importing the stubs outside of Nuke's interpreter.Error
Root Cause
In
nukestubsgen.py,NUKE_POST_INJECTcontains:Python requires a function body after a
defstatement. The missing...placeholder makes the generated file syntactically invalid.Fix
Add
\n ...to each injected function string: