modal 1.1.5.dev65__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/client.pyi +2 -2
- modal/functions.pyi +6 -6
- modal/image.py +3 -31
- modal/image.pyi +0 -5
- modal/mount.py +0 -95
- modal/mount.pyi +0 -148
- {modal-1.1.5.dev65.dist-info → modal-1.1.5.dev66.dist-info}/METADATA +1 -1
- {modal-1.1.5.dev65.dist-info → modal-1.1.5.dev66.dist-info}/RECORD +13 -13
- modal_version/__init__.py +1 -1
- {modal-1.1.5.dev65.dist-info → modal-1.1.5.dev66.dist-info}/WHEEL +0 -0
- {modal-1.1.5.dev65.dist-info → modal-1.1.5.dev66.dist-info}/entry_points.txt +0 -0
- {modal-1.1.5.dev65.dist-info → modal-1.1.5.dev66.dist-info}/licenses/LICENSE +0 -0
- {modal-1.1.5.dev65.dist-info → modal-1.1.5.dev66.dist-info}/top_level.txt +0 -0
modal/client.pyi
CHANGED
|
@@ -33,7 +33,7 @@ class _Client:
|
|
|
33
33
|
server_url: str,
|
|
34
34
|
client_type: int,
|
|
35
35
|
credentials: typing.Optional[tuple[str, str]],
|
|
36
|
-
version: str = "1.1.5.
|
|
36
|
+
version: str = "1.1.5.dev66",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -164,7 +164,7 @@ class Client:
|
|
|
164
164
|
server_url: str,
|
|
165
165
|
client_type: int,
|
|
166
166
|
credentials: typing.Optional[tuple[str, str]],
|
|
167
|
-
version: str = "1.1.5.
|
|
167
|
+
version: str = "1.1.5.dev66",
|
|
168
168
|
):
|
|
169
169
|
"""mdmd:hidden
|
|
170
170
|
The Modal client object is not intended to be instantiated directly by users.
|
modal/functions.pyi
CHANGED
|
@@ -401,7 +401,7 @@ class Function(
|
|
|
401
401
|
|
|
402
402
|
_call_generator: ___call_generator_spec[typing_extensions.Self]
|
|
403
403
|
|
|
404
|
-
class __remote_spec(typing_extensions.Protocol[
|
|
404
|
+
class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
|
405
405
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
|
|
406
406
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
407
407
|
...
|
|
@@ -410,7 +410,7 @@ class Function(
|
|
|
410
410
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
411
411
|
...
|
|
412
412
|
|
|
413
|
-
remote: __remote_spec[modal._functions.
|
|
413
|
+
remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
|
414
414
|
|
|
415
415
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
416
416
|
def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
|
@@ -437,7 +437,7 @@ class Function(
|
|
|
437
437
|
"""
|
|
438
438
|
...
|
|
439
439
|
|
|
440
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
|
440
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
|
441
441
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
442
442
|
"""[Experimental] Calls the function with the given arguments, without waiting for the results.
|
|
443
443
|
|
|
@@ -461,7 +461,7 @@ class Function(
|
|
|
461
461
|
...
|
|
462
462
|
|
|
463
463
|
_experimental_spawn: ___experimental_spawn_spec[
|
|
464
|
-
modal._functions.
|
|
464
|
+
modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
|
|
465
465
|
]
|
|
466
466
|
|
|
467
467
|
class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
|
|
@@ -470,7 +470,7 @@ class Function(
|
|
|
470
470
|
|
|
471
471
|
_spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
|
|
472
472
|
|
|
473
|
-
class __spawn_spec(typing_extensions.Protocol[
|
|
473
|
+
class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
|
474
474
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
475
475
|
"""Calls the function with the given arguments, without waiting for the results.
|
|
476
476
|
|
|
@@ -491,7 +491,7 @@ class Function(
|
|
|
491
491
|
"""
|
|
492
492
|
...
|
|
493
493
|
|
|
494
|
-
spawn: __spawn_spec[modal._functions.
|
|
494
|
+
spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
|
495
495
|
|
|
496
496
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
|
|
497
497
|
"""Return the inner Python object wrapped by this Modal Function."""
|
modal/image.py
CHANGED
|
@@ -33,7 +33,6 @@ from ._resolver import Resolver
|
|
|
33
33
|
from ._serialization import get_preferred_payload_format, serialize
|
|
34
34
|
from ._utils.async_utils import synchronize_api
|
|
35
35
|
from ._utils.blob_utils import MAX_OBJECT_SIZE_BYTES
|
|
36
|
-
from ._utils.deprecation import deprecation_warning
|
|
37
36
|
from ._utils.docker_utils import (
|
|
38
37
|
extract_copy_command_patterns,
|
|
39
38
|
find_dockerignore_file,
|
|
@@ -284,24 +283,12 @@ def _create_context_mount_function(
|
|
|
284
283
|
ignore: Union[Sequence[str], Callable[[Path], bool], _AutoDockerIgnoreSentinel],
|
|
285
284
|
dockerfile_cmds: list[str] = [],
|
|
286
285
|
dockerfile_path: Optional[Path] = None,
|
|
287
|
-
context_mount: Optional[_Mount] = None,
|
|
288
286
|
context_dir: Optional[Union[Path, str]] = None,
|
|
289
287
|
):
|
|
290
288
|
if dockerfile_path and dockerfile_cmds:
|
|
291
289
|
raise InvalidError("Cannot provide both dockerfile and docker commands")
|
|
292
290
|
|
|
293
|
-
if
|
|
294
|
-
if ignore is not AUTO_DOCKERIGNORE:
|
|
295
|
-
raise InvalidError("Cannot set both `context_mount` and `ignore`")
|
|
296
|
-
if context_dir is not None:
|
|
297
|
-
raise InvalidError("Cannot set both `context_mount` and `context_dir`")
|
|
298
|
-
|
|
299
|
-
def identity_context_mount_fn() -> Optional[_Mount]:
|
|
300
|
-
return context_mount
|
|
301
|
-
|
|
302
|
-
return identity_context_mount_fn
|
|
303
|
-
|
|
304
|
-
elif ignore is AUTO_DOCKERIGNORE:
|
|
291
|
+
if ignore is AUTO_DOCKERIGNORE:
|
|
305
292
|
|
|
306
293
|
def auto_created_context_mount_fn() -> Optional[_Mount]:
|
|
307
294
|
nonlocal context_dir
|
|
@@ -1596,7 +1583,6 @@ class _Image(_Object, type_prefix="im"):
|
|
|
1596
1583
|
env: Optional[dict[str, Optional[str]]] = None,
|
|
1597
1584
|
secrets: Optional[Collection[_Secret]] = None,
|
|
1598
1585
|
gpu: GPU_T = None,
|
|
1599
|
-
context_mount: Optional[_Mount] = None, # Deprecated: the context is now inferred
|
|
1600
1586
|
context_dir: Optional[Union[Path, str]] = None, # Context for relative COPY commands
|
|
1601
1587
|
force_build: bool = False, # Ignore cached builds, similar to 'docker build --no-cache'
|
|
1602
1588
|
ignore: Union[Sequence[str], Callable[[Path], bool]] = AUTO_DOCKERIGNORE,
|
|
@@ -1642,12 +1628,6 @@ class _Image(_Object, type_prefix="im"):
|
|
|
1642
1628
|
)
|
|
1643
1629
|
```
|
|
1644
1630
|
"""
|
|
1645
|
-
if context_mount is not None:
|
|
1646
|
-
deprecation_warning(
|
|
1647
|
-
(2025, 1, 13),
|
|
1648
|
-
"The `context_mount` parameter of `Image.dockerfile_commands` is deprecated."
|
|
1649
|
-
" Files are now automatically added to the build context based on the commands.",
|
|
1650
|
-
)
|
|
1651
1631
|
cmds = _flatten_str_args("dockerfile_commands", "dockerfile_commands", dockerfile_commands)
|
|
1652
1632
|
if not cmds:
|
|
1653
1633
|
return self
|
|
@@ -1665,7 +1645,7 @@ class _Image(_Object, type_prefix="im"):
|
|
|
1665
1645
|
secrets=secrets,
|
|
1666
1646
|
gpu_config=parse_gpu_config(gpu),
|
|
1667
1647
|
context_mount_function=_create_context_mount_function(
|
|
1668
|
-
ignore=ignore, dockerfile_cmds=cmds,
|
|
1648
|
+
ignore=ignore, dockerfile_cmds=cmds, context_dir=context_dir
|
|
1669
1649
|
),
|
|
1670
1650
|
force_build=self.force_build or force_build,
|
|
1671
1651
|
)
|
|
@@ -2022,7 +2002,6 @@ class _Image(_Object, type_prefix="im"):
|
|
|
2022
2002
|
def from_dockerfile(
|
|
2023
2003
|
path: Union[str, Path], # Filepath to Dockerfile.
|
|
2024
2004
|
*,
|
|
2025
|
-
context_mount: Optional[_Mount] = None, # Deprecated: the context is now inferred
|
|
2026
2005
|
force_build: bool = False, # Ignore cached builds, similar to 'docker build --no-cache'
|
|
2027
2006
|
context_dir: Optional[Union[Path, str]] = None, # Context for relative COPY commands
|
|
2028
2007
|
env: Optional[dict[str, Optional[str]]] = None,
|
|
@@ -2086,13 +2065,6 @@ class _Image(_Object, type_prefix="im"):
|
|
|
2086
2065
|
if env:
|
|
2087
2066
|
secrets = [*secrets, _Secret.from_dict(env)]
|
|
2088
2067
|
|
|
2089
|
-
if context_mount is not None:
|
|
2090
|
-
deprecation_warning(
|
|
2091
|
-
(2025, 1, 13),
|
|
2092
|
-
"The `context_mount` parameter of `Image.from_dockerfile` is deprecated."
|
|
2093
|
-
" Files are now automatically added to the build context based on the commands in the Dockerfile.",
|
|
2094
|
-
)
|
|
2095
|
-
|
|
2096
2068
|
# --- Build the base dockerfile
|
|
2097
2069
|
|
|
2098
2070
|
def build_dockerfile_base(version: ImageBuilderVersion) -> DockerfileSpec:
|
|
@@ -2104,7 +2076,7 @@ class _Image(_Object, type_prefix="im"):
|
|
|
2104
2076
|
base_image = _Image._from_args(
|
|
2105
2077
|
dockerfile_function=build_dockerfile_base,
|
|
2106
2078
|
context_mount_function=_create_context_mount_function(
|
|
2107
|
-
ignore=ignore, dockerfile_path=Path(path),
|
|
2079
|
+
ignore=ignore, dockerfile_path=Path(path), context_dir=context_dir
|
|
2108
2080
|
),
|
|
2109
2081
|
gpu_config=gpu_config,
|
|
2110
2082
|
secrets=secrets,
|
modal/image.pyi
CHANGED
|
@@ -91,7 +91,6 @@ def _create_context_mount_function(
|
|
|
91
91
|
],
|
|
92
92
|
dockerfile_cmds: list[str] = [],
|
|
93
93
|
dockerfile_path: typing.Optional[pathlib.Path] = None,
|
|
94
|
-
context_mount: typing.Optional[modal.mount._Mount] = None,
|
|
95
94
|
context_dir: typing.Union[str, pathlib.Path, None] = None,
|
|
96
95
|
): ...
|
|
97
96
|
|
|
@@ -599,7 +598,6 @@ class _Image(modal._object._Object):
|
|
|
599
598
|
env: typing.Optional[dict[str, typing.Optional[str]]] = None,
|
|
600
599
|
secrets: typing.Optional[collections.abc.Collection[modal.secret._Secret]] = None,
|
|
601
600
|
gpu: typing.Union[None, str, modal.gpu._GPUConfig] = None,
|
|
602
|
-
context_mount: typing.Optional[modal.mount._Mount] = None,
|
|
603
601
|
context_dir: typing.Union[str, pathlib.Path, None] = None,
|
|
604
602
|
force_build: bool = False,
|
|
605
603
|
ignore: typing.Union[
|
|
@@ -817,7 +815,6 @@ class _Image(modal._object._Object):
|
|
|
817
815
|
def from_dockerfile(
|
|
818
816
|
path: typing.Union[str, pathlib.Path],
|
|
819
817
|
*,
|
|
820
|
-
context_mount: typing.Optional[modal.mount._Mount] = None,
|
|
821
818
|
force_build: bool = False,
|
|
822
819
|
context_dir: typing.Union[str, pathlib.Path, None] = None,
|
|
823
820
|
env: typing.Optional[dict[str, typing.Optional[str]]] = None,
|
|
@@ -1572,7 +1569,6 @@ class Image(modal.object.Object):
|
|
|
1572
1569
|
env: typing.Optional[dict[str, typing.Optional[str]]] = None,
|
|
1573
1570
|
secrets: typing.Optional[collections.abc.Collection[modal.secret.Secret]] = None,
|
|
1574
1571
|
gpu: typing.Union[None, str, modal.gpu._GPUConfig] = None,
|
|
1575
|
-
context_mount: typing.Optional[modal.mount.Mount] = None,
|
|
1576
1572
|
context_dir: typing.Union[str, pathlib.Path, None] = None,
|
|
1577
1573
|
force_build: bool = False,
|
|
1578
1574
|
ignore: typing.Union[
|
|
@@ -1790,7 +1786,6 @@ class Image(modal.object.Object):
|
|
|
1790
1786
|
def from_dockerfile(
|
|
1791
1787
|
path: typing.Union[str, pathlib.Path],
|
|
1792
1788
|
*,
|
|
1793
|
-
context_mount: typing.Optional[modal.mount.Mount] = None,
|
|
1794
1789
|
force_build: bool = False,
|
|
1795
1790
|
context_dir: typing.Union[str, pathlib.Path, None] = None,
|
|
1796
1791
|
env: typing.Optional[dict[str, typing.Optional[str]]] = None,
|
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,
|
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,
|
|
@@ -382,30 +308,6 @@ class Mount(modal.object.Object):
|
|
|
382
308
|
"""Add a local directory to the `Mount` object."""
|
|
383
309
|
...
|
|
384
310
|
|
|
385
|
-
@staticmethod
|
|
386
|
-
def from_local_dir(
|
|
387
|
-
local_path: typing.Union[str, pathlib.Path],
|
|
388
|
-
*,
|
|
389
|
-
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
390
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
391
|
-
recursive: bool = True,
|
|
392
|
-
) -> Mount:
|
|
393
|
-
"""**Deprecated:** Use image.add_local_dir() instead
|
|
394
|
-
|
|
395
|
-
Create a `Mount` from a local directory.
|
|
396
|
-
|
|
397
|
-
**Usage**
|
|
398
|
-
|
|
399
|
-
```python notest
|
|
400
|
-
assets = modal.Mount.from_local_dir(
|
|
401
|
-
"~/assets",
|
|
402
|
-
condition=lambda pth: not ".venv" in pth,
|
|
403
|
-
remote_path="/assets",
|
|
404
|
-
)
|
|
405
|
-
```
|
|
406
|
-
"""
|
|
407
|
-
...
|
|
408
|
-
|
|
409
311
|
@staticmethod
|
|
410
312
|
def _from_local_dir(
|
|
411
313
|
local_path: typing.Union[str, pathlib.Path],
|
|
@@ -422,26 +324,6 @@ class Mount(modal.object.Object):
|
|
|
422
324
|
"""Add a local file to the `Mount` object."""
|
|
423
325
|
...
|
|
424
326
|
|
|
425
|
-
@staticmethod
|
|
426
|
-
def from_local_file(
|
|
427
|
-
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
428
|
-
) -> Mount:
|
|
429
|
-
"""**Deprecated**: Use image.add_local_file() instead
|
|
430
|
-
|
|
431
|
-
Create a `Mount` mounting a single local file.
|
|
432
|
-
|
|
433
|
-
**Usage**
|
|
434
|
-
|
|
435
|
-
```python notest
|
|
436
|
-
# Mount the DBT profile in user's home directory into container.
|
|
437
|
-
dbt_profiles = modal.Mount.from_local_file(
|
|
438
|
-
local_path="~/profiles.yml",
|
|
439
|
-
remote_path="/root/dbt_profile/profiles.yml",
|
|
440
|
-
)
|
|
441
|
-
```
|
|
442
|
-
"""
|
|
443
|
-
...
|
|
444
|
-
|
|
445
327
|
@staticmethod
|
|
446
328
|
def _from_local_file(
|
|
447
329
|
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
@@ -465,36 +347,6 @@ class Mount(modal.object.Object):
|
|
|
465
347
|
|
|
466
348
|
_load_mount: ___load_mount_spec[typing_extensions.Self]
|
|
467
349
|
|
|
468
|
-
@staticmethod
|
|
469
|
-
def from_local_python_packages(
|
|
470
|
-
*module_names: str,
|
|
471
|
-
remote_dir: typing.Union[str, pathlib.PurePosixPath] = "/root",
|
|
472
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
473
|
-
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
474
|
-
) -> Mount:
|
|
475
|
-
"""**Deprecated**: Use image.add_local_python_source instead
|
|
476
|
-
|
|
477
|
-
Returns a `modal.Mount` that makes local modules listed in `module_names` available inside the container.
|
|
478
|
-
This works by mounting the local path of each module's package to a directory inside the container
|
|
479
|
-
that's on `PYTHONPATH`.
|
|
480
|
-
|
|
481
|
-
**Usage**
|
|
482
|
-
|
|
483
|
-
```python notest
|
|
484
|
-
import modal
|
|
485
|
-
import my_local_module
|
|
486
|
-
|
|
487
|
-
app = modal.App()
|
|
488
|
-
|
|
489
|
-
@app.function(mounts=[
|
|
490
|
-
modal.Mount.from_local_python_packages("my_local_module", "my_other_module"),
|
|
491
|
-
])
|
|
492
|
-
def f():
|
|
493
|
-
my_local_module.do_stuff()
|
|
494
|
-
```
|
|
495
|
-
"""
|
|
496
|
-
...
|
|
497
|
-
|
|
498
350
|
@staticmethod
|
|
499
351
|
def _from_local_python_packages(
|
|
500
352
|
*module_names: str,
|
|
@@ -22,7 +22,7 @@ modal/app.py,sha256=RRUz2NjAWIQLHtU2IEslOlnIOCxPiWts3IP3rTFArkY,49635
|
|
|
22
22
|
modal/app.pyi,sha256=CDp_rlX3hBuFdv9VRsKvNKCgu_hS2IO2uNU5qhzmXps,44719
|
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
|
24
24
|
modal/client.py,sha256=kyAIVB3Ay-XKJizQ_1ufUFB__EagV0MLmHJpyYyJ7J0,18636
|
|
25
|
-
modal/client.pyi,sha256=
|
|
25
|
+
modal/client.pyi,sha256=wPuVebsSsWHAKpR9d2uvXzLgSMdqGfFIQjSv0tOdmCk,15831
|
|
26
26
|
modal/cloud_bucket_mount.py,sha256=I2GRXYhOWLIz2kJZjXu75jAm9EJkBNcutGc6jR2ReUw,5928
|
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=VuUOipMIHqFXMkD-3g2bsoqpSxV5qswlFHDOqPQzYAo,7405
|
|
28
28
|
modal/cls.py,sha256=IZG9gLlssbhTgIn6iSEmBSKkbbkst3skASMae-59FII,40239
|
|
@@ -39,14 +39,14 @@ modal/file_io.py,sha256=OSKr77TujcXGJW1iikzYiHckLSmv07QBgBHcxxYEkoI,21456
|
|
|
39
39
|
modal/file_io.pyi,sha256=xtO6Glf_BFwDE7QiQQo24QqcMf_Vv-iz7WojcGVlLBU,15932
|
|
40
40
|
modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE,8116
|
|
41
41
|
modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
|
|
42
|
-
modal/functions.pyi,sha256=
|
|
42
|
+
modal/functions.pyi,sha256=CMwApS396tdElFrjnV6RuL2DTCz4C3jYzYoq1y_LPUQ,37988
|
|
43
43
|
modal/gpu.py,sha256=Fe5ORvVPDIstSq1xjmM6OoNgLYFWvogP9r5BgmD3hYg,6769
|
|
44
|
-
modal/image.py,sha256=
|
|
45
|
-
modal/image.pyi,sha256=
|
|
44
|
+
modal/image.py,sha256=MN5-pEmj-i66_XUxHo_z_VIu6KD186dF70417KKiRt0,106712
|
|
45
|
+
modal/image.pyi,sha256=Ba7rdjbktmibwG9yLf3SMRWycw34V8SScG-Krakx1Yk,76506
|
|
46
46
|
modal/io_streams.py,sha256=hZOVc5beOAm8S_VQQmmKUbk_BJ9OltN83RY0yMPqUDo,16545
|
|
47
47
|
modal/io_streams.pyi,sha256=aOun_jUFKHSJyUY6-7gKvNoxzcULsa8_hxdtEO7v-gk,13980
|
|
48
|
-
modal/mount.py,sha256=
|
|
49
|
-
modal/mount.pyi,sha256=
|
|
48
|
+
modal/mount.py,sha256=9AQEP7aF3kD1d5n_QBQsDtRB1OV74qaYdMbLyaxfOdw,33213
|
|
49
|
+
modal/mount.pyi,sha256=MD_zV2M7eCWxbOpQRjU60aHevN-bmbiywaCX82QoFlw,15380
|
|
50
50
|
modal/network_file_system.py,sha256=ZdEIRgdcR-p_ILyw_AecEtPOhhrSWJeADYCtFnhtaHM,13509
|
|
51
51
|
modal/network_file_system.pyi,sha256=zF4PIaiuIaC4OLQ0YCj1e2O3uepW9-2Jo1T3blc7RVg,15365
|
|
52
52
|
modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
|
|
@@ -153,7 +153,7 @@ modal/experimental/__init__.py,sha256=QkCGP1lZiOa8sY4ZNqMF8JsnuRaDI7PJpXkGtKMWgD
|
|
|
153
153
|
modal/experimental/flash.py,sha256=C4sef08rARYFllsgtqukFmYL18SZW0_JpMS0BejDcUs,28552
|
|
154
154
|
modal/experimental/flash.pyi,sha256=vV_OQhtdrPn8SW0XrBK-aLLHHIvxAzLzwFbWrke-m74,15463
|
|
155
155
|
modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
|
|
156
|
-
modal-1.1.5.
|
|
156
|
+
modal-1.1.5.dev66.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
157
157
|
modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
|
158
158
|
modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
|
|
159
159
|
modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
|
|
@@ -182,10 +182,10 @@ modal_proto/sandbox_router_pb2.py,sha256=INd9izYaIYqllESQt4MSv2Rj9Hf5bMjAvtCc9b4
|
|
|
182
182
|
modal_proto/sandbox_router_pb2.pyi,sha256=YCK0WnCgRos3-p7t4USQQ7x6WAuM278yeQX2IeU5mLg,13295
|
|
183
183
|
modal_proto/sandbox_router_pb2_grpc.py,sha256=zonC5flvCwxeZYJPENj1IJo2Mr0J58DpoC1_8IdPYik,8243
|
|
184
184
|
modal_proto/sandbox_router_pb2_grpc.pyi,sha256=4QgCB9b7_ykvH8YD-hfnogVH9CLyHVDC5QNb03l4_X8,2735
|
|
185
|
-
modal_version/__init__.py,sha256=
|
|
185
|
+
modal_version/__init__.py,sha256=zg2cNdUsd1AR7YrLggxRN7kcEhyGATD3RqCCOs5FRYk,121
|
|
186
186
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
|
187
|
-
modal-1.1.5.
|
|
188
|
-
modal-1.1.5.
|
|
189
|
-
modal-1.1.5.
|
|
190
|
-
modal-1.1.5.
|
|
191
|
-
modal-1.1.5.
|
|
187
|
+
modal-1.1.5.dev66.dist-info/METADATA,sha256=X7tz_PT6CDxaVHZEtI9xvOq8QLaLvQmuOFp8FZGygpw,2481
|
|
188
|
+
modal-1.1.5.dev66.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
189
|
+
modal-1.1.5.dev66.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
|
190
|
+
modal-1.1.5.dev66.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
|
191
|
+
modal-1.1.5.dev66.dist-info/RECORD,,
|
modal_version/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|