Use lazy imports in __init__.py (#3847)
This commit is contained in:
committed by
GitHub
parent
b2a24baa0f
commit
c78ee6a8d0
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user