Skip to content

Commit 6af82c7

Browse files
authored
switch lightning-cloud to lightning SDK (#369)
* switch `lightning-cloud` to lightning SDK * also in tests
1 parent 6e538cc commit 6af82c7

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

requirements/extras.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ pillow
33
viztracer
44
pyarrow
55
tqdm
6-
lightning-cloud == 0.5.70 # Must be pinned to ensure compatibility
6+
lightning-sdk ==0.1.17 # Must be pinned to ensure compatibility
77
google-cloud-storage

requirements/test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ pytest-rerunfailures ==14.0
88
pytest-random-order ==1.1.1
99
pandas
1010
lightning
11-
lightning-cloud == 0.5.70 # Must be pinned to ensure compatibility
1211
zstd
1312
numpy < 2.0

src/litdata/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
# This is required for full pytree serialization / deserialization support
2828
_TORCH_GREATER_EQUAL_2_1_0 = RequirementCache("torch>=2.1.0")
2929
_VIZ_TRACKER_AVAILABLE = RequirementCache("viztracer")
30-
_LIGHTNING_CLOUD_AVAILABLE = RequirementCache("lightning-cloud")
3130
_BOTO3_AVAILABLE = RequirementCache("boto3")
3231
_TORCH_AUDIO_AVAILABLE = RequirementCache("torchaudio")
3332
_ZSTD_AVAILABLE = RequirementCache("zstd")

src/litdata/processing/data_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ def run(self, data_recipe: DataRecipe) -> None:
11341134
result = data_recipe._done(len(user_items), self.delete_cached_files, self.output_dir)
11351135

11361136
if num_nodes == node_rank + 1 and self.output_dir.url and self.output_dir.path is not None and _IS_IN_STUDIO:
1137-
from lightning_cloud.openapi import V1DatasetType
1137+
from lightning_sdk.lightning_cloud.openapi import V1DatasetType
11381138

11391139
_create_dataset(
11401140
input_dir=self.input_dir.path,

src/litdata/processing/utilities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def _create_dataset(
5555
if not storage_dir:
5656
raise ValueError("The storage_dir should be defined.")
5757

58-
from lightning_cloud.openapi import ProjectIdDatasetsBody
59-
from lightning_cloud.openapi.rest import ApiException
60-
from lightning_cloud.rest_client import LightningClient
58+
from lightning_sdk.lightning_cloud.openapi import ProjectIdDatasetsBody
59+
from lightning_sdk.lightning_cloud.openapi.rest import ApiException
60+
from lightning_sdk.lightning_cloud.rest_client import LightningClient
6161

6262
client = LightningClient(retry=False)
6363

src/litdata/streaming/resolver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _match_studio(target_id: Optional[str], target_name: Optional[str], cloudspa
9999

100100

101101
def _resolve_studio(dir_path: str, target_name: Optional[str], target_id: Optional[str]) -> Dir:
102-
from lightning_cloud.rest_client import LightningClient
102+
from lightning_sdk.lightning_cloud.rest_client import LightningClient
103103

104104
client = LightningClient(max_tries=2)
105105

@@ -140,7 +140,7 @@ def _resolve_studio(dir_path: str, target_name: Optional[str], target_id: Option
140140

141141

142142
def _resolve_s3_connections(dir_path: str) -> Dir:
143-
from lightning_cloud.rest_client import LightningClient
143+
from lightning_sdk.lightning_cloud.rest_client import LightningClient
144144

145145
client = LightningClient(max_tries=2)
146146

@@ -162,7 +162,7 @@ def _resolve_s3_connections(dir_path: str) -> Dir:
162162

163163

164164
def _resolve_datasets(dir_path: str) -> Dir:
165-
from lightning_cloud.rest_client import LightningClient
165+
from lightning_sdk.lightning_cloud.rest_client import LightningClient
166166

167167
client = LightningClient(max_tries=2)
168168

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ def azure_mock(monkeypatch):
6666

6767
@pytest.fixture()
6868
def lightning_cloud_mock(monkeypatch):
69-
lightning_cloud = ModuleType("lightning_cloud")
70-
monkeypatch.setitem(sys.modules, "lightning_cloud", lightning_cloud)
69+
lightning_cloud = ModuleType("lightning_sdk.lightning_cloud")
70+
monkeypatch.setitem(sys.modules, "lightning_sdk.lightning_cloud", lightning_cloud)
7171
rest_client = ModuleType("rest_client")
72-
monkeypatch.setitem(sys.modules, "lightning_cloud.rest_client", rest_client)
72+
monkeypatch.setitem(sys.modules, "lightning_sdk.lightning_cloud.rest_client", rest_client)
7373
lightning_cloud.rest_client = rest_client
7474
rest_client.LightningClient = Mock()
7575
return lightning_cloud

tests/streaming/test_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from unittest import mock
44

55
import pytest
6-
from lightning_cloud import login
7-
from lightning_cloud.openapi import (
6+
from lightning_sdk.lightning_cloud import login
7+
from lightning_sdk.lightning_cloud.openapi import (
88
Externalv1Cluster,
99
V1AwsDataConnection,
1010
V1AWSDirectV1,

0 commit comments

Comments
 (0)