2323
2424logger = logging .getLogger ("dstack_sdk" )
2525
26- __version__ = "0.2.0 "
26+ __version__ = "0.5.2 "
2727
2828
2929INIT_MR = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
@@ -226,12 +226,19 @@ class BaseClient:
226226class AsyncDstackClient (BaseClient ):
227227 PATH_PREFIX = "/"
228228
229- def __init__ (self , endpoint : str | None = None , * , use_sync_http : bool = False , timeout : float = 3 ):
229+ def __init__ (
230+ self ,
231+ endpoint : str | None = None ,
232+ * ,
233+ use_sync_http : bool = False ,
234+ timeout : float = 3 ,
235+ ):
230236 """Initialize async client with HTTP or Unix-socket transport.
231237
232238 Args:
233239 endpoint: HTTP/HTTPS URL or Unix socket path
234240 use_sync_http: If True, use sync HTTP client internally
241+ timeout: Timeout in seconds
235242
236243 """
237244 endpoint = get_endpoint (endpoint )
@@ -256,14 +263,18 @@ def __init__(self, endpoint: str | None = None, *, use_sync_http: bool = False,
256263 def _get_client (self ) -> httpx .AsyncClient :
257264 if self ._client is None :
258265 self ._client = httpx .AsyncClient (
259- transport = self .async_transport , base_url = self .base_url , timeout = self ._timeout
266+ transport = self .async_transport ,
267+ base_url = self .base_url ,
268+ timeout = self ._timeout ,
260269 )
261270 return self ._client
262271
263272 def _get_sync_client (self ) -> httpx .Client :
264273 if self ._sync_client is None :
265274 self ._sync_client = httpx .Client (
266- transport = self .sync_transport , base_url = self .base_url , timeout = self ._timeout
275+ transport = self .sync_transport ,
276+ base_url = self .base_url ,
277+ timeout = self ._timeout ,
267278 )
268279 return self ._sync_client
269280
@@ -399,7 +410,9 @@ def __init__(self, endpoint: str | None = None, *, timeout: float = 3):
399410 If a non-HTTP(S) endpoint is provided, it is treated as a Unix socket
400411 path and validated for existence.
401412 """
402- self .async_client = AsyncDstackClient (endpoint , use_sync_http = True , timeout = timeout )
413+ self .async_client = AsyncDstackClient (
414+ endpoint , use_sync_http = True , timeout = timeout
415+ )
403416
404417 @call_async
405418 def get_key (
@@ -464,7 +477,13 @@ class AsyncTappdClient(AsyncDstackClient):
464477 DEPRECATED: Use ``AsyncDstackClient`` instead.
465478 """
466479
467- def __init__ (self , endpoint : str | None = None , * , use_sync_http : bool = False , timeout : float = 3 ):
480+ def __init__ (
481+ self ,
482+ endpoint : str | None = None ,
483+ * ,
484+ use_sync_http : bool = False ,
485+ timeout : float = 3 ,
486+ ):
468487 """Initialize deprecated async tappd client wrapper."""
469488 if not use_sync_http :
470489 # Already warned in TappdClient.__init__
@@ -549,7 +568,9 @@ def __init__(self, endpoint: str | None = None, timeout: float = 3):
549568 "TappdClient is deprecated, please use DstackClient instead"
550569 )
551570 endpoint = get_tappd_endpoint (endpoint )
552- self .async_client = AsyncTappdClient (endpoint , use_sync_http = True , timeout = timeout )
571+ self .async_client = AsyncTappdClient (
572+ endpoint , use_sync_http = True , timeout = timeout
573+ )
553574
554575 @call_async
555576 def derive_key (
0 commit comments