Use lazy imports in __init__.py (#3847)

This commit is contained in:
Stanislav Novosad
2025-10-29 19:53:12 -06:00
committed by GitHub
parent b2a24baa0f
commit c78ee6a8d0
2 changed files with 68 additions and 36 deletions

View File

@@ -1,3 +1,14 @@
from skyvern.library.skyvern import Skyvern
from typing import Any
# noinspection PyUnresolvedReferences
__all__ = ["Skyvern"]
def __getattr__(name: str) -> Any:
"""Lazily import Skyvern."""
if name == "Skyvern":
from skyvern.library.skyvern import Skyvern # noqa: PLC0415
globals()["Skyvern"] = Skyvern
return Skyvern
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")