diff --git a/src/npe2/manifest/contributions/_readers.py b/src/npe2/manifest/contributions/_readers.py index 76dca6d2..ba4fdfec 100644 --- a/src/npe2/manifest/contributions/_readers.py +++ b/src/npe2/manifest/contributions/_readers.py @@ -1,11 +1,13 @@ from functools import wraps -from typing import List, Optional +from typing import TYPE_CHECKING, List, Optional -from npe2._command_registry import CommandRegistry from npe2._pydantic_compat import Extra, Field from npe2.manifest.utils import Executable, v2_to_v1 from npe2.types import ReaderFunction +if TYPE_CHECKING: + from npe2._command_registry import CommandRegistry + class ReaderContribution(Executable[Optional[ReaderFunction]]): """Contribute a file reader. @@ -41,7 +43,7 @@ def exec( self, args: tuple = (), kwargs: Optional[dict] = None, - _registry: Optional[CommandRegistry] = None, + _registry: Optional["CommandRegistry"] = None, ): """ We are trying to simplify internal npe2 logic to always deal with a