Skip to content

Commit 69be206

Browse files
committed
chore: fmt
1 parent 268be67 commit 69be206

8 files changed

Lines changed: 15 additions & 19 deletions

File tree

sdk/python/src/dstack_sdk/dstack_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
import json
1010
import logging
1111
import os
12-
import warnings
1312
from typing import Any
1413
from typing import Dict
1514
from typing import List
1615
from typing import Optional
1716
from typing import cast
17+
import warnings
1818

1919
import httpx
2020
from pydantic import BaseModel
@@ -205,6 +205,7 @@ def __init__(self, endpoint: str | None = None, use_sync_http: bool = False):
205205
Args:
206206
endpoint: HTTP/HTTPS URL or Unix socket path
207207
use_sync_http: If True, use sync HTTP client internally
208+
208209
"""
209210
endpoint = get_endpoint(endpoint)
210211
self.use_sync_http = use_sync_http

sdk/python/src/dstack_sdk/encrypt_env_vars.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
"""
6-
Environment variable encryption module for dstack SDK.
5+
"""Environment variable encryption module for dstack SDK.
76
87
Provides functionality to encrypt environment variables using X25519 key exchange
98
and AES-GCM encryption, similar to the TypeScript implementation.

sdk/python/src/dstack_sdk/ethereum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020

2121
def to_account(get_key_response: GetKeyResponse | GetTlsKeyResponse) -> LocalAccount:
22-
"""
23-
Create an Ethereum account from DstackClient key response.
22+
"""Create an Ethereum account from DstackClient key response.
2423
2524
DEPRECATED: Use to_account_secure instead. This method has security concerns.
2625
Current implementation uses raw key material without proper hashing.
@@ -30,6 +29,7 @@ def to_account(get_key_response: GetKeyResponse | GetTlsKeyResponse) -> LocalAcc
3029
3130
Returns:
3231
Account: Ethereum account object
32+
3333
"""
3434
if isinstance(get_key_response, GetTlsKeyResponse):
3535
warnings.warn(

sdk/python/src/dstack_sdk/get_compose_hash.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
"""
6-
Compose hash calculation module for dstack SDK.
5+
"""Compose hash calculation module for dstack SDK.
76
87
Provides deterministic JSON serialization and SHA256 hashing of AppCompose configurations,
98
compatible with the TypeScript implementation.
@@ -153,8 +152,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "AppCompose":
153152

154153

155154
def sort_object(obj: Any) -> Any:
156-
"""
157-
Recursively sort object keys lexicographically.
155+
"""Recursively sort object keys lexicographically.
158156
159157
This is crucial for deterministic JSON.stringify.
160158
"""
@@ -185,8 +183,7 @@ def preprocess_app_compose(app_compose: AppCompose) -> AppCompose:
185183

186184

187185
def to_deterministic_json(app_compose: AppCompose) -> str:
188-
"""
189-
Serialize to deterministic JSON following cross-language standards.
186+
"""Serialize to deterministic JSON following cross-language standards.
190187
191188
- Recursively sorts object keys lexicographically
192189
- Compact output (no spaces)
@@ -224,15 +221,15 @@ def process_data(obj: Any) -> Any:
224221
def get_compose_hash(
225222
app_compose: Union[AppCompose, Dict[str, Any]], normalize: bool = False
226223
) -> str:
227-
"""
228-
Calculate SHA256 hash of app compose configuration.
224+
"""Calculate SHA256 hash of app compose configuration.
229225
230226
Args:
231227
app_compose: AppCompose object or dictionary
232228
normalize: Whether to preprocess the compose (remove conflicting fields)
233229
234230
Returns:
235231
str: SHA256 hash as hex string
232+
236233
"""
237234
if isinstance(app_compose, dict):
238235
app_compose = AppCompose.from_dict(app_compose)

sdk/python/src/dstack_sdk/solana.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919

2020
def to_keypair(get_key_response: GetKeyResponse | GetTlsKeyResponse) -> Keypair:
21-
"""
22-
Create a Solana Keypair from DstackClient key response.
21+
"""Create a Solana Keypair from DstackClient key response.
2322
2423
DEPRECATED: Use to_keypair_secure instead. This method has security concerns.
2524
Current implementation uses raw key material without proper hashing.
@@ -29,6 +28,7 @@ def to_keypair(get_key_response: GetKeyResponse | GetTlsKeyResponse) -> Keypair:
2928
3029
Returns:
3130
Keypair: Solana keypair object
31+
3232
"""
3333
if isinstance(get_key_response, GetTlsKeyResponse):
3434
warnings.warn(

sdk/python/src/dstack_sdk/verify_env_encrypt_public_key.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ def verify_env_encrypt_public_key(
8080
def _recover_public_key(
8181
message_hash: bytes, r: int, s: int, recovery_id: int
8282
) -> Optional[bytes]:
83-
"""
84-
Recover public key from ECDSA signature components.
83+
"""Recover public key from ECDSA signature components.
8584
8685
This is a simplified implementation. In production, you should use
8786
a proper ECDSA recovery library like the one used in Ethereum.

sdk/python/tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import warnings
66

7-
import pytest
87
from evidence_api.tdx.quote import TdxQuote
8+
import pytest
99

1010
from dstack_sdk import AsyncDstackClient
1111
from dstack_sdk import AsyncTappdClient

sdk/python/tests/test_ethereum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import warnings
66

7-
import pytest
87
from eth_account.signers.local import LocalAccount
8+
import pytest
99

1010
from dstack_sdk import GetKeyResponse
1111
from dstack_sdk.ethereum import to_account

0 commit comments

Comments
 (0)