coco_pipe.utils =============== .. py:module:: coco_pipe.utils .. autoapi-nested-parse:: Shared package utilities. This module holds small helpers that are not specific to one subpackage. Functions --------- .. autoapisummary:: coco_pipe.utils.import_optional_dependency Module Contents --------------- .. py:function:: import_optional_dependency(loader: Any, feature: str, dependency: str, install_hint: Optional[str] = None) -> Any Lazily import an optional dependency with clearer failure modes. :param loader: Zero-argument callable returning the imported dependency. :type loader: callable :param feature: Feature or component name using the dependency. :type feature: str :param dependency: Human-readable dependency name. :type dependency: str :param install_hint: Installation hint shown on ImportError. :type install_hint: str, optional :returns: Imported dependency returned by ``loader``. :rtype: Any :raises ImportError: If the dependency is not installed. :raises RuntimeError: If the dependency is installed but fails during initialization.