modal 1.1.5.dev64__py3-none-any.whl → 1.1.5.dev66__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of modal might be problematic. Click here for more details.
- modal/_functions.py +3 -36
- modal/client.pyi +2 -2
- modal/cls.py +0 -41
- modal/cls.pyi +0 -78
- modal/dict.py +0 -41
- modal/dict.pyi +0 -77
- modal/environments.py +0 -20
- modal/environments.pyi +0 -14
- modal/functions.pyi +6 -55
- modal/image.py +3 -31
- modal/image.pyi +0 -5
- modal/mount.py +0 -117
- modal/mount.pyi +0 -170
- modal/network_file_system.py +1 -40
- modal/network_file_system.pyi +0 -74
- modal/queue.py +0 -39
- modal/queue.pyi +0 -74
- modal/secret.py +0 -29
- modal/secret.pyi +0 -38
- modal/volume.py +0 -41
- modal/volume.pyi +0 -77
- {modal-1.1.5.dev64.dist-info → modal-1.1.5.dev66.dist-info}/METADATA +1 -1
- {modal-1.1.5.dev64.dist-info → modal-1.1.5.dev66.dist-info}/RECORD +28 -28
- modal_version/__init__.py +1 -1
- {modal-1.1.5.dev64.dist-info → modal-1.1.5.dev66.dist-info}/WHEEL +0 -0
- {modal-1.1.5.dev64.dist-info → modal-1.1.5.dev66.dist-info}/entry_points.txt +0 -0
- {modal-1.1.5.dev64.dist-info → modal-1.1.5.dev66.dist-info}/licenses/LICENSE +0 -0
- {modal-1.1.5.dev64.dist-info → modal-1.1.5.dev66.dist-info}/top_level.txt +0 -0
modal/mount.py
CHANGED
|
@@ -412,39 +412,6 @@ class _Mount(_Object, type_prefix="mo"):
|
|
|
412
412
|
),
|
|
413
413
|
)
|
|
414
414
|
|
|
415
|
-
@staticmethod
|
|
416
|
-
def from_local_dir(
|
|
417
|
-
local_path: Union[str, Path],
|
|
418
|
-
*,
|
|
419
|
-
# Where the directory is placed within in the mount
|
|
420
|
-
remote_path: Union[str, PurePosixPath, None] = None,
|
|
421
|
-
# Predicate filter function for file selection, which should accept a filepath and return `True` for inclusion.
|
|
422
|
-
# Defaults to including all files.
|
|
423
|
-
condition: Optional[Callable[[str], bool]] = None,
|
|
424
|
-
# add files from subdirectories as well
|
|
425
|
-
recursive: bool = True,
|
|
426
|
-
) -> "_Mount":
|
|
427
|
-
"""
|
|
428
|
-
**Deprecated:** Use image.add_local_dir() instead
|
|
429
|
-
|
|
430
|
-
Create a `Mount` from a local directory.
|
|
431
|
-
|
|
432
|
-
**Usage**
|
|
433
|
-
|
|
434
|
-
```python notest
|
|
435
|
-
assets = modal.Mount.from_local_dir(
|
|
436
|
-
"~/assets",
|
|
437
|
-
condition=lambda pth: not ".venv" in pth,
|
|
438
|
-
remote_path="/assets",
|
|
439
|
-
)
|
|
440
|
-
```
|
|
441
|
-
"""
|
|
442
|
-
deprecation_warning(
|
|
443
|
-
(2025, 1, 8),
|
|
444
|
-
MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_dir"),
|
|
445
|
-
)
|
|
446
|
-
return _Mount._from_local_dir(local_path, remote_path=remote_path, condition=condition, recursive=recursive)
|
|
447
|
-
|
|
448
415
|
@staticmethod
|
|
449
416
|
def _from_local_dir(
|
|
450
417
|
local_path: Union[str, Path],
|
|
@@ -480,29 +447,6 @@ class _Mount(_Object, type_prefix="mo"):
|
|
|
480
447
|
),
|
|
481
448
|
)
|
|
482
449
|
|
|
483
|
-
@staticmethod
|
|
484
|
-
def from_local_file(local_path: Union[str, Path], remote_path: Union[str, PurePosixPath, None] = None) -> "_Mount":
|
|
485
|
-
"""
|
|
486
|
-
**Deprecated**: Use image.add_local_file() instead
|
|
487
|
-
|
|
488
|
-
Create a `Mount` mounting a single local file.
|
|
489
|
-
|
|
490
|
-
**Usage**
|
|
491
|
-
|
|
492
|
-
```python notest
|
|
493
|
-
# Mount the DBT profile in user's home directory into container.
|
|
494
|
-
dbt_profiles = modal.Mount.from_local_file(
|
|
495
|
-
local_path="~/profiles.yml",
|
|
496
|
-
remote_path="/root/dbt_profile/profiles.yml",
|
|
497
|
-
)
|
|
498
|
-
```
|
|
499
|
-
"""
|
|
500
|
-
deprecation_warning(
|
|
501
|
-
(2025, 1, 8),
|
|
502
|
-
MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_file"),
|
|
503
|
-
)
|
|
504
|
-
return _Mount._from_local_file(local_path, remote_path)
|
|
505
|
-
|
|
506
450
|
@staticmethod
|
|
507
451
|
def _from_local_file(local_path: Union[str, Path], remote_path: Union[str, PurePosixPath, None] = None) -> "_Mount":
|
|
508
452
|
return _Mount._new().add_local_file(local_path, remote_path=remote_path)
|
|
@@ -654,45 +598,6 @@ class _Mount(_Object, type_prefix="mo"):
|
|
|
654
598
|
logger.debug(f"Uploaded {total_uploads} new files and {total_bytes} bytes in {time.monotonic() - t0}s")
|
|
655
599
|
self._hydrate(resp.mount_id, resolver.client, resp.handle_metadata)
|
|
656
600
|
|
|
657
|
-
@staticmethod
|
|
658
|
-
def from_local_python_packages(
|
|
659
|
-
*module_names: str,
|
|
660
|
-
remote_dir: Union[str, PurePosixPath] = ROOT_DIR.as_posix(),
|
|
661
|
-
# Predicate filter function for file selection, which should accept a filepath and return `True` for inclusion.
|
|
662
|
-
# Defaults to including all files.
|
|
663
|
-
condition: Optional[Callable[[str], bool]] = None,
|
|
664
|
-
ignore: Optional[Union[Sequence[str], Callable[[Path], bool]]] = None,
|
|
665
|
-
) -> "_Mount":
|
|
666
|
-
"""
|
|
667
|
-
**Deprecated**: Use image.add_local_python_source instead
|
|
668
|
-
|
|
669
|
-
Returns a `modal.Mount` that makes local modules listed in `module_names` available inside the container.
|
|
670
|
-
This works by mounting the local path of each module's package to a directory inside the container
|
|
671
|
-
that's on `PYTHONPATH`.
|
|
672
|
-
|
|
673
|
-
**Usage**
|
|
674
|
-
|
|
675
|
-
```python notest
|
|
676
|
-
import modal
|
|
677
|
-
import my_local_module
|
|
678
|
-
|
|
679
|
-
app = modal.App()
|
|
680
|
-
|
|
681
|
-
@app.function(mounts=[
|
|
682
|
-
modal.Mount.from_local_python_packages("my_local_module", "my_other_module"),
|
|
683
|
-
])
|
|
684
|
-
def f():
|
|
685
|
-
my_local_module.do_stuff()
|
|
686
|
-
```
|
|
687
|
-
"""
|
|
688
|
-
deprecation_warning(
|
|
689
|
-
(2025, 1, 8),
|
|
690
|
-
MOUNT_DEPRECATION_MESSAGE_PATTERN.format(replacement="image.add_local_python_source"),
|
|
691
|
-
)
|
|
692
|
-
return _Mount._from_local_python_packages(
|
|
693
|
-
*module_names, remote_dir=remote_dir, condition=condition, ignore=ignore
|
|
694
|
-
)
|
|
695
|
-
|
|
696
601
|
@staticmethod
|
|
697
602
|
def _from_local_python_packages(
|
|
698
603
|
*module_names: str,
|
|
@@ -738,28 +643,6 @@ class _Mount(_Object, type_prefix="mo"):
|
|
|
738
643
|
|
|
739
644
|
return _Mount._from_loader(_load, "Mount()", hydrate_lazily=True)
|
|
740
645
|
|
|
741
|
-
@classmethod
|
|
742
|
-
async def lookup(
|
|
743
|
-
cls: type["_Mount"],
|
|
744
|
-
name: str,
|
|
745
|
-
namespace=api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
|
|
746
|
-
client: Optional[_Client] = None,
|
|
747
|
-
environment_name: Optional[str] = None,
|
|
748
|
-
) -> "_Mount":
|
|
749
|
-
"""mdmd:hidden"""
|
|
750
|
-
deprecation_warning(
|
|
751
|
-
(2025, 1, 27),
|
|
752
|
-
"`modal.Mount.lookup` is deprecated and will be removed in a future release."
|
|
753
|
-
" It can be replaced with `modal.Mount.from_name`."
|
|
754
|
-
"\n\nSee https://modal.com/docs/guide/modal-1-0-migration for more information.",
|
|
755
|
-
)
|
|
756
|
-
obj = _Mount.from_name(name, namespace=namespace, environment_name=environment_name)
|
|
757
|
-
if client is None:
|
|
758
|
-
client = await _Client.from_env()
|
|
759
|
-
resolver = Resolver(client=client)
|
|
760
|
-
await resolver.load(obj)
|
|
761
|
-
return obj
|
|
762
|
-
|
|
763
646
|
async def _deploy(
|
|
764
647
|
self: "_Mount",
|
|
765
648
|
deployment_name: Optional[str] = None,
|
modal/mount.pyi
CHANGED
|
@@ -189,30 +189,6 @@ class _Mount(modal._object._Object):
|
|
|
189
189
|
"""Add a local directory to the `Mount` object."""
|
|
190
190
|
...
|
|
191
191
|
|
|
192
|
-
@staticmethod
|
|
193
|
-
def from_local_dir(
|
|
194
|
-
local_path: typing.Union[str, pathlib.Path],
|
|
195
|
-
*,
|
|
196
|
-
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
197
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
198
|
-
recursive: bool = True,
|
|
199
|
-
) -> _Mount:
|
|
200
|
-
"""**Deprecated:** Use image.add_local_dir() instead
|
|
201
|
-
|
|
202
|
-
Create a `Mount` from a local directory.
|
|
203
|
-
|
|
204
|
-
**Usage**
|
|
205
|
-
|
|
206
|
-
```python notest
|
|
207
|
-
assets = modal.Mount.from_local_dir(
|
|
208
|
-
"~/assets",
|
|
209
|
-
condition=lambda pth: not ".venv" in pth,
|
|
210
|
-
remote_path="/assets",
|
|
211
|
-
)
|
|
212
|
-
```
|
|
213
|
-
"""
|
|
214
|
-
...
|
|
215
|
-
|
|
216
192
|
@staticmethod
|
|
217
193
|
def _from_local_dir(
|
|
218
194
|
local_path: typing.Union[str, pathlib.Path],
|
|
@@ -229,26 +205,6 @@ class _Mount(modal._object._Object):
|
|
|
229
205
|
"""Add a local file to the `Mount` object."""
|
|
230
206
|
...
|
|
231
207
|
|
|
232
|
-
@staticmethod
|
|
233
|
-
def from_local_file(
|
|
234
|
-
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
235
|
-
) -> _Mount:
|
|
236
|
-
"""**Deprecated**: Use image.add_local_file() instead
|
|
237
|
-
|
|
238
|
-
Create a `Mount` mounting a single local file.
|
|
239
|
-
|
|
240
|
-
**Usage**
|
|
241
|
-
|
|
242
|
-
```python notest
|
|
243
|
-
# Mount the DBT profile in user's home directory into container.
|
|
244
|
-
dbt_profiles = modal.Mount.from_local_file(
|
|
245
|
-
local_path="~/profiles.yml",
|
|
246
|
-
remote_path="/root/dbt_profile/profiles.yml",
|
|
247
|
-
)
|
|
248
|
-
```
|
|
249
|
-
"""
|
|
250
|
-
...
|
|
251
|
-
|
|
252
208
|
@staticmethod
|
|
253
209
|
def _from_local_file(
|
|
254
210
|
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
@@ -262,36 +218,6 @@ class _Mount(modal._object._Object):
|
|
|
262
218
|
async def _load_mount(
|
|
263
219
|
self: _Mount, resolver: modal._resolver.Resolver, existing_object_id: typing.Optional[str]
|
|
264
220
|
): ...
|
|
265
|
-
@staticmethod
|
|
266
|
-
def from_local_python_packages(
|
|
267
|
-
*module_names: str,
|
|
268
|
-
remote_dir: typing.Union[str, pathlib.PurePosixPath] = "/root",
|
|
269
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
270
|
-
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
271
|
-
) -> _Mount:
|
|
272
|
-
"""**Deprecated**: Use image.add_local_python_source instead
|
|
273
|
-
|
|
274
|
-
Returns a `modal.Mount` that makes local modules listed in `module_names` available inside the container.
|
|
275
|
-
This works by mounting the local path of each module's package to a directory inside the container
|
|
276
|
-
that's on `PYTHONPATH`.
|
|
277
|
-
|
|
278
|
-
**Usage**
|
|
279
|
-
|
|
280
|
-
```python notest
|
|
281
|
-
import modal
|
|
282
|
-
import my_local_module
|
|
283
|
-
|
|
284
|
-
app = modal.App()
|
|
285
|
-
|
|
286
|
-
@app.function(mounts=[
|
|
287
|
-
modal.Mount.from_local_python_packages("my_local_module", "my_other_module"),
|
|
288
|
-
])
|
|
289
|
-
def f():
|
|
290
|
-
my_local_module.do_stuff()
|
|
291
|
-
```
|
|
292
|
-
"""
|
|
293
|
-
...
|
|
294
|
-
|
|
295
221
|
@staticmethod
|
|
296
222
|
def _from_local_python_packages(
|
|
297
223
|
*module_names: str,
|
|
@@ -304,17 +230,6 @@ class _Mount(modal._object._Object):
|
|
|
304
230
|
"""mdmd:hidden"""
|
|
305
231
|
...
|
|
306
232
|
|
|
307
|
-
@classmethod
|
|
308
|
-
async def lookup(
|
|
309
|
-
cls: type[_Mount],
|
|
310
|
-
name: str,
|
|
311
|
-
namespace=1,
|
|
312
|
-
client: typing.Optional[modal.client._Client] = None,
|
|
313
|
-
environment_name: typing.Optional[str] = None,
|
|
314
|
-
) -> _Mount:
|
|
315
|
-
"""mdmd:hidden"""
|
|
316
|
-
...
|
|
317
|
-
|
|
318
233
|
async def _deploy(
|
|
319
234
|
self: _Mount,
|
|
320
235
|
deployment_name: typing.Optional[str] = None,
|
|
@@ -393,30 +308,6 @@ class Mount(modal.object.Object):
|
|
|
393
308
|
"""Add a local directory to the `Mount` object."""
|
|
394
309
|
...
|
|
395
310
|
|
|
396
|
-
@staticmethod
|
|
397
|
-
def from_local_dir(
|
|
398
|
-
local_path: typing.Union[str, pathlib.Path],
|
|
399
|
-
*,
|
|
400
|
-
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
401
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
402
|
-
recursive: bool = True,
|
|
403
|
-
) -> Mount:
|
|
404
|
-
"""**Deprecated:** Use image.add_local_dir() instead
|
|
405
|
-
|
|
406
|
-
Create a `Mount` from a local directory.
|
|
407
|
-
|
|
408
|
-
**Usage**
|
|
409
|
-
|
|
410
|
-
```python notest
|
|
411
|
-
assets = modal.Mount.from_local_dir(
|
|
412
|
-
"~/assets",
|
|
413
|
-
condition=lambda pth: not ".venv" in pth,
|
|
414
|
-
remote_path="/assets",
|
|
415
|
-
)
|
|
416
|
-
```
|
|
417
|
-
"""
|
|
418
|
-
...
|
|
419
|
-
|
|
420
311
|
@staticmethod
|
|
421
312
|
def _from_local_dir(
|
|
422
313
|
local_path: typing.Union[str, pathlib.Path],
|
|
@@ -433,26 +324,6 @@ class Mount(modal.object.Object):
|
|
|
433
324
|
"""Add a local file to the `Mount` object."""
|
|
434
325
|
...
|
|
435
326
|
|
|
436
|
-
@staticmethod
|
|
437
|
-
def from_local_file(
|
|
438
|
-
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
439
|
-
) -> Mount:
|
|
440
|
-
"""**Deprecated**: Use image.add_local_file() instead
|
|
441
|
-
|
|
442
|
-
Create a `Mount` mounting a single local file.
|
|
443
|
-
|
|
444
|
-
**Usage**
|
|
445
|
-
|
|
446
|
-
```python notest
|
|
447
|
-
# Mount the DBT profile in user's home directory into container.
|
|
448
|
-
dbt_profiles = modal.Mount.from_local_file(
|
|
449
|
-
local_path="~/profiles.yml",
|
|
450
|
-
remote_path="/root/dbt_profile/profiles.yml",
|
|
451
|
-
)
|
|
452
|
-
```
|
|
453
|
-
"""
|
|
454
|
-
...
|
|
455
|
-
|
|
456
327
|
@staticmethod
|
|
457
328
|
def _from_local_file(
|
|
458
329
|
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
@@ -476,36 +347,6 @@ class Mount(modal.object.Object):
|
|
|
476
347
|
|
|
477
348
|
_load_mount: ___load_mount_spec[typing_extensions.Self]
|
|
478
349
|
|
|
479
|
-
@staticmethod
|
|
480
|
-
def from_local_python_packages(
|
|
481
|
-
*module_names: str,
|
|
482
|
-
remote_dir: typing.Union[str, pathlib.PurePosixPath] = "/root",
|
|
483
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
484
|
-
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
485
|
-
) -> Mount:
|
|
486
|
-
"""**Deprecated**: Use image.add_local_python_source instead
|
|
487
|
-
|
|
488
|
-
Returns a `modal.Mount` that makes local modules listed in `module_names` available inside the container.
|
|
489
|
-
This works by mounting the local path of each module's package to a directory inside the container
|
|
490
|
-
that's on `PYTHONPATH`.
|
|
491
|
-
|
|
492
|
-
**Usage**
|
|
493
|
-
|
|
494
|
-
```python notest
|
|
495
|
-
import modal
|
|
496
|
-
import my_local_module
|
|
497
|
-
|
|
498
|
-
app = modal.App()
|
|
499
|
-
|
|
500
|
-
@app.function(mounts=[
|
|
501
|
-
modal.Mount.from_local_python_packages("my_local_module", "my_other_module"),
|
|
502
|
-
])
|
|
503
|
-
def f():
|
|
504
|
-
my_local_module.do_stuff()
|
|
505
|
-
```
|
|
506
|
-
"""
|
|
507
|
-
...
|
|
508
|
-
|
|
509
350
|
@staticmethod
|
|
510
351
|
def _from_local_python_packages(
|
|
511
352
|
*module_names: str,
|
|
@@ -518,17 +359,6 @@ class Mount(modal.object.Object):
|
|
|
518
359
|
"""mdmd:hidden"""
|
|
519
360
|
...
|
|
520
361
|
|
|
521
|
-
@classmethod
|
|
522
|
-
def lookup(
|
|
523
|
-
cls: type[Mount],
|
|
524
|
-
name: str,
|
|
525
|
-
namespace=1,
|
|
526
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
527
|
-
environment_name: typing.Optional[str] = None,
|
|
528
|
-
) -> Mount:
|
|
529
|
-
"""mdmd:hidden"""
|
|
530
|
-
...
|
|
531
|
-
|
|
532
362
|
class ___deploy_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
533
363
|
def __call__(
|
|
534
364
|
self,
|
modal/network_file_system.py
CHANGED
|
@@ -21,7 +21,7 @@ from ._object import (
|
|
|
21
21
|
from ._resolver import Resolver
|
|
22
22
|
from ._utils.async_utils import TaskContext, aclosing, async_map, sync_or_async_iter, synchronize_api
|
|
23
23
|
from ._utils.blob_utils import LARGE_FILE_LIMIT, blob_iter, blob_upload_file
|
|
24
|
-
from ._utils.deprecation import
|
|
24
|
+
from ._utils.deprecation import warn_if_passing_namespace
|
|
25
25
|
from ._utils.grpc_utils import retry_transient_errors
|
|
26
26
|
from ._utils.hash_utils import get_sha256_hex
|
|
27
27
|
from ._utils.name_utils import check_object_name
|
|
@@ -171,45 +171,6 @@ class _NetworkFileSystem(_Object, type_prefix="sv"):
|
|
|
171
171
|
rep="modal.NetworkFileSystem.ephemeral()",
|
|
172
172
|
)
|
|
173
173
|
|
|
174
|
-
@staticmethod
|
|
175
|
-
async def lookup(
|
|
176
|
-
name: str,
|
|
177
|
-
namespace=None, # mdmd:line-hidden
|
|
178
|
-
client: Optional[_Client] = None,
|
|
179
|
-
environment_name: Optional[str] = None,
|
|
180
|
-
create_if_missing: bool = False,
|
|
181
|
-
) -> "_NetworkFileSystem":
|
|
182
|
-
"""mdmd:hidden
|
|
183
|
-
Lookup a named NetworkFileSystem.
|
|
184
|
-
|
|
185
|
-
DEPRECATED: This method is deprecated in favor of `modal.NetworkFileSystem.from_name`.
|
|
186
|
-
|
|
187
|
-
In contrast to `modal.NetworkFileSystem.from_name`, this is an eager method
|
|
188
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
189
|
-
|
|
190
|
-
```python notest
|
|
191
|
-
nfs = modal.NetworkFileSystem.lookup("my-nfs")
|
|
192
|
-
print(nfs.listdir("/"))
|
|
193
|
-
```
|
|
194
|
-
"""
|
|
195
|
-
deprecation_warning(
|
|
196
|
-
(2025, 1, 27),
|
|
197
|
-
"`modal.NetworkFileSystem.lookup` is deprecated and will be removed in a future release."
|
|
198
|
-
" It can be replaced with `modal.NetworkFileSystem.from_name`."
|
|
199
|
-
"\n\nSee https://modal.com/docs/guide/modal-1-0-migration for more information.",
|
|
200
|
-
)
|
|
201
|
-
warn_if_passing_namespace(namespace, "modal.NetworkFileSystem.lookup")
|
|
202
|
-
obj = _NetworkFileSystem.from_name(
|
|
203
|
-
name,
|
|
204
|
-
environment_name=environment_name,
|
|
205
|
-
create_if_missing=create_if_missing,
|
|
206
|
-
)
|
|
207
|
-
if client is None:
|
|
208
|
-
client = await _Client.from_env()
|
|
209
|
-
resolver = Resolver(client=client)
|
|
210
|
-
await resolver.load(obj)
|
|
211
|
-
return obj
|
|
212
|
-
|
|
213
174
|
@staticmethod
|
|
214
175
|
async def create_deployed(
|
|
215
176
|
deployment_name: str,
|
modal/network_file_system.pyi
CHANGED
|
@@ -94,29 +94,6 @@ class _NetworkFileSystem(modal._object._Object):
|
|
|
94
94
|
"""
|
|
95
95
|
...
|
|
96
96
|
|
|
97
|
-
@staticmethod
|
|
98
|
-
async def lookup(
|
|
99
|
-
name: str,
|
|
100
|
-
namespace=None,
|
|
101
|
-
client: typing.Optional[modal.client._Client] = None,
|
|
102
|
-
environment_name: typing.Optional[str] = None,
|
|
103
|
-
create_if_missing: bool = False,
|
|
104
|
-
) -> _NetworkFileSystem:
|
|
105
|
-
"""mdmd:hidden
|
|
106
|
-
Lookup a named NetworkFileSystem.
|
|
107
|
-
|
|
108
|
-
DEPRECATED: This method is deprecated in favor of `modal.NetworkFileSystem.from_name`.
|
|
109
|
-
|
|
110
|
-
In contrast to `modal.NetworkFileSystem.from_name`, this is an eager method
|
|
111
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
112
|
-
|
|
113
|
-
```python notest
|
|
114
|
-
nfs = modal.NetworkFileSystem.lookup("my-nfs")
|
|
115
|
-
print(nfs.listdir("/"))
|
|
116
|
-
```
|
|
117
|
-
"""
|
|
118
|
-
...
|
|
119
|
-
|
|
120
97
|
@staticmethod
|
|
121
98
|
async def create_deployed(
|
|
122
99
|
deployment_name: str,
|
|
@@ -273,57 +250,6 @@ class NetworkFileSystem(modal.object.Object):
|
|
|
273
250
|
"""
|
|
274
251
|
...
|
|
275
252
|
|
|
276
|
-
class __lookup_spec(typing_extensions.Protocol):
|
|
277
|
-
def __call__(
|
|
278
|
-
self,
|
|
279
|
-
/,
|
|
280
|
-
name: str,
|
|
281
|
-
namespace=None,
|
|
282
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
283
|
-
environment_name: typing.Optional[str] = None,
|
|
284
|
-
create_if_missing: bool = False,
|
|
285
|
-
) -> NetworkFileSystem:
|
|
286
|
-
"""mdmd:hidden
|
|
287
|
-
Lookup a named NetworkFileSystem.
|
|
288
|
-
|
|
289
|
-
DEPRECATED: This method is deprecated in favor of `modal.NetworkFileSystem.from_name`.
|
|
290
|
-
|
|
291
|
-
In contrast to `modal.NetworkFileSystem.from_name`, this is an eager method
|
|
292
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
293
|
-
|
|
294
|
-
```python notest
|
|
295
|
-
nfs = modal.NetworkFileSystem.lookup("my-nfs")
|
|
296
|
-
print(nfs.listdir("/"))
|
|
297
|
-
```
|
|
298
|
-
"""
|
|
299
|
-
...
|
|
300
|
-
|
|
301
|
-
async def aio(
|
|
302
|
-
self,
|
|
303
|
-
/,
|
|
304
|
-
name: str,
|
|
305
|
-
namespace=None,
|
|
306
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
307
|
-
environment_name: typing.Optional[str] = None,
|
|
308
|
-
create_if_missing: bool = False,
|
|
309
|
-
) -> NetworkFileSystem:
|
|
310
|
-
"""mdmd:hidden
|
|
311
|
-
Lookup a named NetworkFileSystem.
|
|
312
|
-
|
|
313
|
-
DEPRECATED: This method is deprecated in favor of `modal.NetworkFileSystem.from_name`.
|
|
314
|
-
|
|
315
|
-
In contrast to `modal.NetworkFileSystem.from_name`, this is an eager method
|
|
316
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
317
|
-
|
|
318
|
-
```python notest
|
|
319
|
-
nfs = modal.NetworkFileSystem.lookup("my-nfs")
|
|
320
|
-
print(nfs.listdir("/"))
|
|
321
|
-
```
|
|
322
|
-
"""
|
|
323
|
-
...
|
|
324
|
-
|
|
325
|
-
lookup: __lookup_spec
|
|
326
|
-
|
|
327
253
|
class __create_deployed_spec(typing_extensions.Protocol):
|
|
328
254
|
def __call__(
|
|
329
255
|
self,
|
modal/queue.py
CHANGED
|
@@ -388,45 +388,6 @@ class _Queue(_Object, type_prefix="qu"):
|
|
|
388
388
|
rep = _Queue._repr(name, environment_name)
|
|
389
389
|
return _Queue._from_loader(_load, rep, is_another_app=True, hydrate_lazily=True, name=name)
|
|
390
390
|
|
|
391
|
-
@staticmethod
|
|
392
|
-
async def lookup(
|
|
393
|
-
name: str,
|
|
394
|
-
namespace=None, # mdmd:line-hidden
|
|
395
|
-
client: Optional[_Client] = None,
|
|
396
|
-
environment_name: Optional[str] = None,
|
|
397
|
-
create_if_missing: bool = False,
|
|
398
|
-
) -> "_Queue":
|
|
399
|
-
"""mdmd:hidden
|
|
400
|
-
Lookup a named Queue.
|
|
401
|
-
|
|
402
|
-
DEPRECATED: This method is deprecated in favor of `modal.Queue.from_name`.
|
|
403
|
-
|
|
404
|
-
In contrast to `modal.Queue.from_name`, this is an eager method
|
|
405
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
406
|
-
|
|
407
|
-
```python notest
|
|
408
|
-
q = modal.Queue.lookup("my-queue")
|
|
409
|
-
q.put(123)
|
|
410
|
-
```
|
|
411
|
-
"""
|
|
412
|
-
deprecation_warning(
|
|
413
|
-
(2025, 1, 27),
|
|
414
|
-
"`modal.Queue.lookup` is deprecated and will be removed in a future release."
|
|
415
|
-
" It can be replaced with `modal.Queue.from_name`."
|
|
416
|
-
"\n\nSee https://modal.com/docs/guide/modal-1-0-migration for more information.",
|
|
417
|
-
)
|
|
418
|
-
warn_if_passing_namespace(namespace, "modal.Queue.lookup")
|
|
419
|
-
obj = _Queue.from_name(
|
|
420
|
-
name,
|
|
421
|
-
environment_name=environment_name,
|
|
422
|
-
create_if_missing=create_if_missing,
|
|
423
|
-
)
|
|
424
|
-
if client is None:
|
|
425
|
-
client = await _Client.from_env()
|
|
426
|
-
resolver = Resolver(client=client)
|
|
427
|
-
await resolver.load(obj)
|
|
428
|
-
return obj
|
|
429
|
-
|
|
430
391
|
@staticmethod
|
|
431
392
|
async def delete(name: str, *, client: Optional[_Client] = None, environment_name: Optional[str] = None):
|
|
432
393
|
"""mdmd:hidden
|
modal/queue.pyi
CHANGED
|
@@ -479,29 +479,6 @@ class _Queue(modal._object._Object):
|
|
|
479
479
|
"""
|
|
480
480
|
...
|
|
481
481
|
|
|
482
|
-
@staticmethod
|
|
483
|
-
async def lookup(
|
|
484
|
-
name: str,
|
|
485
|
-
namespace=None,
|
|
486
|
-
client: typing.Optional[modal.client._Client] = None,
|
|
487
|
-
environment_name: typing.Optional[str] = None,
|
|
488
|
-
create_if_missing: bool = False,
|
|
489
|
-
) -> _Queue:
|
|
490
|
-
"""mdmd:hidden
|
|
491
|
-
Lookup a named Queue.
|
|
492
|
-
|
|
493
|
-
DEPRECATED: This method is deprecated in favor of `modal.Queue.from_name`.
|
|
494
|
-
|
|
495
|
-
In contrast to `modal.Queue.from_name`, this is an eager method
|
|
496
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
497
|
-
|
|
498
|
-
```python notest
|
|
499
|
-
q = modal.Queue.lookup("my-queue")
|
|
500
|
-
q.put(123)
|
|
501
|
-
```
|
|
502
|
-
"""
|
|
503
|
-
...
|
|
504
|
-
|
|
505
482
|
@staticmethod
|
|
506
483
|
async def delete(
|
|
507
484
|
name: str,
|
|
@@ -759,57 +736,6 @@ class Queue(modal.object.Object):
|
|
|
759
736
|
"""
|
|
760
737
|
...
|
|
761
738
|
|
|
762
|
-
class __lookup_spec(typing_extensions.Protocol):
|
|
763
|
-
def __call__(
|
|
764
|
-
self,
|
|
765
|
-
/,
|
|
766
|
-
name: str,
|
|
767
|
-
namespace=None,
|
|
768
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
769
|
-
environment_name: typing.Optional[str] = None,
|
|
770
|
-
create_if_missing: bool = False,
|
|
771
|
-
) -> Queue:
|
|
772
|
-
"""mdmd:hidden
|
|
773
|
-
Lookup a named Queue.
|
|
774
|
-
|
|
775
|
-
DEPRECATED: This method is deprecated in favor of `modal.Queue.from_name`.
|
|
776
|
-
|
|
777
|
-
In contrast to `modal.Queue.from_name`, this is an eager method
|
|
778
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
779
|
-
|
|
780
|
-
```python notest
|
|
781
|
-
q = modal.Queue.lookup("my-queue")
|
|
782
|
-
q.put(123)
|
|
783
|
-
```
|
|
784
|
-
"""
|
|
785
|
-
...
|
|
786
|
-
|
|
787
|
-
async def aio(
|
|
788
|
-
self,
|
|
789
|
-
/,
|
|
790
|
-
name: str,
|
|
791
|
-
namespace=None,
|
|
792
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
793
|
-
environment_name: typing.Optional[str] = None,
|
|
794
|
-
create_if_missing: bool = False,
|
|
795
|
-
) -> Queue:
|
|
796
|
-
"""mdmd:hidden
|
|
797
|
-
Lookup a named Queue.
|
|
798
|
-
|
|
799
|
-
DEPRECATED: This method is deprecated in favor of `modal.Queue.from_name`.
|
|
800
|
-
|
|
801
|
-
In contrast to `modal.Queue.from_name`, this is an eager method
|
|
802
|
-
that will hydrate the local object with metadata from Modal servers.
|
|
803
|
-
|
|
804
|
-
```python notest
|
|
805
|
-
q = modal.Queue.lookup("my-queue")
|
|
806
|
-
q.put(123)
|
|
807
|
-
```
|
|
808
|
-
"""
|
|
809
|
-
...
|
|
810
|
-
|
|
811
|
-
lookup: __lookup_spec
|
|
812
|
-
|
|
813
739
|
class __delete_spec(typing_extensions.Protocol):
|
|
814
740
|
def __call__(
|
|
815
741
|
self,
|
modal/secret.py
CHANGED
|
@@ -412,35 +412,6 @@ class _Secret(_Object, type_prefix="st"):
|
|
|
412
412
|
rep = _Secret._repr(name, environment_name)
|
|
413
413
|
return _Secret._from_loader(_load, rep, hydrate_lazily=True, name=name)
|
|
414
414
|
|
|
415
|
-
@staticmethod
|
|
416
|
-
async def lookup(
|
|
417
|
-
name: str,
|
|
418
|
-
namespace=None, # mdmd:line-hidden
|
|
419
|
-
client: Optional[_Client] = None,
|
|
420
|
-
environment_name: Optional[str] = None,
|
|
421
|
-
required_keys: list[str] = [],
|
|
422
|
-
) -> "_Secret":
|
|
423
|
-
"""mdmd:hidden"""
|
|
424
|
-
deprecation_warning(
|
|
425
|
-
(2025, 1, 27),
|
|
426
|
-
"`modal.Secret.lookup` is deprecated and will be removed in a future release."
|
|
427
|
-
" It can be replaced with `modal.Secret.from_name`."
|
|
428
|
-
"\n\nSee https://modal.com/docs/guide/modal-1-0-migration for more information.",
|
|
429
|
-
)
|
|
430
|
-
|
|
431
|
-
warn_if_passing_namespace(namespace, "modal.Secret.lookup")
|
|
432
|
-
|
|
433
|
-
obj = _Secret.from_name(
|
|
434
|
-
name,
|
|
435
|
-
environment_name=environment_name,
|
|
436
|
-
required_keys=required_keys,
|
|
437
|
-
)
|
|
438
|
-
if client is None:
|
|
439
|
-
client = await _Client.from_env()
|
|
440
|
-
resolver = Resolver(client=client)
|
|
441
|
-
await resolver.load(obj)
|
|
442
|
-
return obj
|
|
443
|
-
|
|
444
415
|
@staticmethod
|
|
445
416
|
async def create_deployed(
|
|
446
417
|
deployment_name: str,
|