modal 1.0.3.dev10__py3-none-any.whl → 1.2.3.dev7__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/__init__.py +0 -2
- modal/__main__.py +3 -4
- modal/_billing.py +80 -0
- modal/_clustered_functions.py +7 -3
- modal/_clustered_functions.pyi +15 -3
- modal/_container_entrypoint.py +51 -69
- modal/_functions.py +508 -240
- modal/_grpc_client.py +171 -0
- modal/_load_context.py +105 -0
- modal/_object.py +81 -21
- modal/_output.py +58 -45
- modal/_partial_function.py +48 -73
- modal/_pty.py +7 -3
- modal/_resolver.py +26 -46
- modal/_runtime/asgi.py +4 -3
- modal/_runtime/container_io_manager.py +358 -220
- modal/_runtime/container_io_manager.pyi +296 -101
- modal/_runtime/execution_context.py +18 -2
- modal/_runtime/execution_context.pyi +64 -7
- modal/_runtime/gpu_memory_snapshot.py +262 -57
- modal/_runtime/user_code_imports.py +28 -58
- modal/_serialization.py +90 -6
- modal/_traceback.py +42 -1
- modal/_tunnel.pyi +380 -12
- modal/_utils/async_utils.py +84 -29
- modal/_utils/auth_token_manager.py +111 -0
- modal/_utils/blob_utils.py +181 -58
- modal/_utils/deprecation.py +19 -0
- modal/_utils/function_utils.py +91 -47
- modal/_utils/grpc_utils.py +89 -66
- modal/_utils/mount_utils.py +26 -1
- modal/_utils/name_utils.py +17 -3
- modal/_utils/task_command_router_client.py +536 -0
- modal/_utils/time_utils.py +34 -6
- modal/app.py +256 -88
- modal/app.pyi +909 -92
- modal/billing.py +5 -0
- modal/builder/2025.06.txt +18 -0
- modal/builder/PREVIEW.txt +18 -0
- modal/builder/base-images.json +58 -0
- modal/cli/_download.py +19 -3
- modal/cli/_traceback.py +3 -2
- modal/cli/app.py +4 -4
- modal/cli/cluster.py +15 -7
- modal/cli/config.py +5 -3
- modal/cli/container.py +7 -6
- modal/cli/dict.py +22 -16
- modal/cli/entry_point.py +12 -5
- modal/cli/environment.py +5 -4
- modal/cli/import_refs.py +3 -3
- modal/cli/launch.py +102 -5
- modal/cli/network_file_system.py +11 -12
- modal/cli/profile.py +3 -2
- modal/cli/programs/launch_instance_ssh.py +94 -0
- modal/cli/programs/run_jupyter.py +1 -1
- modal/cli/programs/run_marimo.py +95 -0
- modal/cli/programs/vscode.py +1 -1
- modal/cli/queues.py +57 -26
- modal/cli/run.py +91 -23
- modal/cli/secret.py +48 -22
- modal/cli/token.py +7 -8
- modal/cli/utils.py +4 -7
- modal/cli/volume.py +31 -25
- modal/client.py +15 -85
- modal/client.pyi +183 -62
- modal/cloud_bucket_mount.py +5 -3
- modal/cloud_bucket_mount.pyi +197 -5
- modal/cls.py +200 -126
- modal/cls.pyi +446 -68
- modal/config.py +29 -11
- modal/container_process.py +319 -19
- modal/container_process.pyi +190 -20
- modal/dict.py +290 -71
- modal/dict.pyi +835 -83
- modal/environments.py +15 -27
- modal/environments.pyi +46 -24
- modal/exception.py +14 -2
- modal/experimental/__init__.py +194 -40
- modal/experimental/flash.py +618 -0
- modal/experimental/flash.pyi +380 -0
- modal/experimental/ipython.py +11 -7
- modal/file_io.py +29 -36
- modal/file_io.pyi +251 -53
- modal/file_pattern_matcher.py +56 -16
- modal/functions.pyi +673 -92
- modal/gpu.py +1 -1
- modal/image.py +528 -176
- modal/image.pyi +1572 -145
- modal/io_streams.py +458 -128
- modal/io_streams.pyi +433 -52
- modal/mount.py +216 -151
- modal/mount.pyi +225 -78
- modal/network_file_system.py +45 -62
- modal/network_file_system.pyi +277 -56
- modal/object.pyi +93 -17
- modal/parallel_map.py +942 -129
- modal/parallel_map.pyi +294 -15
- modal/partial_function.py +0 -2
- modal/partial_function.pyi +234 -19
- modal/proxy.py +17 -8
- modal/proxy.pyi +36 -3
- modal/queue.py +270 -65
- modal/queue.pyi +817 -57
- modal/runner.py +115 -101
- modal/runner.pyi +205 -49
- modal/sandbox.py +512 -136
- modal/sandbox.pyi +845 -111
- modal/schedule.py +1 -1
- modal/secret.py +300 -70
- modal/secret.pyi +589 -34
- modal/serving.py +7 -11
- modal/serving.pyi +7 -8
- modal/snapshot.py +11 -8
- modal/snapshot.pyi +25 -4
- modal/token_flow.py +4 -4
- modal/token_flow.pyi +28 -8
- modal/volume.py +416 -158
- modal/volume.pyi +1117 -121
- {modal-1.0.3.dev10.dist-info → modal-1.2.3.dev7.dist-info}/METADATA +10 -9
- modal-1.2.3.dev7.dist-info/RECORD +195 -0
- modal_docs/mdmd/mdmd.py +17 -4
- modal_proto/api.proto +534 -79
- modal_proto/api_grpc.py +337 -1
- modal_proto/api_pb2.py +1522 -968
- modal_proto/api_pb2.pyi +1619 -134
- modal_proto/api_pb2_grpc.py +699 -4
- modal_proto/api_pb2_grpc.pyi +226 -14
- modal_proto/modal_api_grpc.py +175 -154
- modal_proto/sandbox_router.proto +145 -0
- modal_proto/sandbox_router_grpc.py +105 -0
- modal_proto/sandbox_router_pb2.py +149 -0
- modal_proto/sandbox_router_pb2.pyi +333 -0
- modal_proto/sandbox_router_pb2_grpc.py +203 -0
- modal_proto/sandbox_router_pb2_grpc.pyi +75 -0
- modal_proto/task_command_router.proto +144 -0
- modal_proto/task_command_router_grpc.py +105 -0
- modal_proto/task_command_router_pb2.py +149 -0
- modal_proto/task_command_router_pb2.pyi +333 -0
- modal_proto/task_command_router_pb2_grpc.py +203 -0
- modal_proto/task_command_router_pb2_grpc.pyi +75 -0
- modal_version/__init__.py +1 -1
- modal/requirements/PREVIEW.txt +0 -16
- modal/requirements/base-images.json +0 -26
- modal-1.0.3.dev10.dist-info/RECORD +0 -179
- modal_proto/modal_options_grpc.py +0 -3
- modal_proto/options.proto +0 -19
- modal_proto/options_grpc.py +0 -3
- modal_proto/options_pb2.py +0 -35
- modal_proto/options_pb2.pyi +0 -20
- modal_proto/options_pb2_grpc.py +0 -4
- modal_proto/options_pb2_grpc.pyi +0 -7
- /modal/{requirements → builder}/2023.12.312.txt +0 -0
- /modal/{requirements → builder}/2023.12.txt +0 -0
- /modal/{requirements → builder}/2024.04.txt +0 -0
- /modal/{requirements → builder}/2024.10.txt +0 -0
- /modal/{requirements → builder}/README.md +0 -0
- {modal-1.0.3.dev10.dist-info → modal-1.2.3.dev7.dist-info}/WHEEL +0 -0
- {modal-1.0.3.dev10.dist-info → modal-1.2.3.dev7.dist-info}/entry_points.txt +0 -0
- {modal-1.0.3.dev10.dist-info → modal-1.2.3.dev7.dist-info}/licenses/LICENSE +0 -0
- {modal-1.0.3.dev10.dist-info → modal-1.2.3.dev7.dist-info}/top_level.txt +0 -0
modal/mount.pyi
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import collections.abc
|
|
2
2
|
import google.protobuf.message
|
|
3
|
+
import modal._load_context
|
|
3
4
|
import modal._object
|
|
4
5
|
import modal._resolver
|
|
5
6
|
import modal._utils.blob_utils
|
|
6
7
|
import modal.client
|
|
8
|
+
import modal.file_pattern_matcher
|
|
7
9
|
import modal.object
|
|
8
10
|
import modal_proto.api_pb2
|
|
9
11
|
import pathlib
|
|
10
12
|
import typing
|
|
11
13
|
import typing_extensions
|
|
12
14
|
|
|
13
|
-
def client_mount_name() -> str:
|
|
14
|
-
|
|
15
|
+
def client_mount_name() -> str:
|
|
16
|
+
"""Get the deployed name of the client package mount."""
|
|
17
|
+
...
|
|
18
|
+
|
|
19
|
+
def python_standalone_mount_name(version: str) -> str:
|
|
20
|
+
"""Get the deployed name of the python-build-standalone mount."""
|
|
21
|
+
...
|
|
15
22
|
|
|
16
23
|
class _MountEntry:
|
|
17
24
|
def description(self) -> str: ...
|
|
@@ -22,6 +29,8 @@ class _MountEntry:
|
|
|
22
29
|
def _select_files(entries: list[_MountEntry]) -> list[tuple[pathlib.Path, pathlib.PurePosixPath]]: ...
|
|
23
30
|
|
|
24
31
|
class _MountFile(_MountEntry):
|
|
32
|
+
"""_MountFile(local_file: pathlib.Path, remote_path: pathlib.PurePosixPath)"""
|
|
33
|
+
|
|
25
34
|
local_file: pathlib.Path
|
|
26
35
|
remote_path: pathlib.PurePosixPath
|
|
27
36
|
|
|
@@ -29,17 +38,37 @@ class _MountFile(_MountEntry):
|
|
|
29
38
|
def get_files_to_upload(self): ...
|
|
30
39
|
def watch_entry(self): ...
|
|
31
40
|
def top_level_paths(self) -> list[tuple[pathlib.Path, pathlib.PurePosixPath]]: ...
|
|
32
|
-
def __init__(self, local_file: pathlib.Path, remote_path: pathlib.PurePosixPath) -> None:
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
def __init__(self, local_file: pathlib.Path, remote_path: pathlib.PurePosixPath) -> None:
|
|
42
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
43
|
+
...
|
|
44
|
+
|
|
45
|
+
def __repr__(self):
|
|
46
|
+
"""Return repr(self)."""
|
|
47
|
+
...
|
|
48
|
+
|
|
49
|
+
def __eq__(self, other):
|
|
50
|
+
"""Return self==value."""
|
|
51
|
+
...
|
|
35
52
|
|
|
36
53
|
class _MountDir(_MountEntry):
|
|
54
|
+
"""_MountDir(local_dir: pathlib.Path, remote_path: pathlib.PurePosixPath, ignore: Union[Callable[[pathlib.Path], bool], modal.file_pattern_matcher._AbstractPatternMatcher], recursive: bool)"""
|
|
55
|
+
|
|
37
56
|
local_dir: pathlib.Path
|
|
38
57
|
remote_path: pathlib.PurePosixPath
|
|
39
|
-
ignore:
|
|
58
|
+
ignore: typing.Union[
|
|
59
|
+
collections.abc.Callable[[pathlib.Path], bool], modal.file_pattern_matcher._AbstractPatternMatcher
|
|
60
|
+
]
|
|
40
61
|
recursive: bool
|
|
41
62
|
|
|
42
63
|
def description(self): ...
|
|
64
|
+
def _walk_and_prune(self, top_dir: pathlib.Path) -> collections.abc.Generator[str, None, None]:
|
|
65
|
+
"""Walk directories and prune ignored directories early."""
|
|
66
|
+
...
|
|
67
|
+
|
|
68
|
+
def _walk_all(self, top_dir: pathlib.Path) -> collections.abc.Generator[str, None, None]:
|
|
69
|
+
"""Walk all directories without early pruning - safe for complex/inverted ignore patterns."""
|
|
70
|
+
...
|
|
71
|
+
|
|
43
72
|
def get_files_to_upload(self): ...
|
|
44
73
|
def watch_entry(self): ...
|
|
45
74
|
def top_level_paths(self) -> list[tuple[pathlib.Path, pathlib.PurePosixPath]]: ...
|
|
@@ -47,16 +76,28 @@ class _MountDir(_MountEntry):
|
|
|
47
76
|
self,
|
|
48
77
|
local_dir: pathlib.Path,
|
|
49
78
|
remote_path: pathlib.PurePosixPath,
|
|
50
|
-
ignore:
|
|
79
|
+
ignore: typing.Union[
|
|
80
|
+
collections.abc.Callable[[pathlib.Path], bool], modal.file_pattern_matcher._AbstractPatternMatcher
|
|
81
|
+
],
|
|
51
82
|
recursive: bool,
|
|
52
|
-
) -> None:
|
|
53
|
-
|
|
54
|
-
|
|
83
|
+
) -> None:
|
|
84
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
85
|
+
...
|
|
86
|
+
|
|
87
|
+
def __repr__(self):
|
|
88
|
+
"""Return repr(self)."""
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
def __eq__(self, other):
|
|
92
|
+
"""Return self==value."""
|
|
93
|
+
...
|
|
55
94
|
|
|
56
95
|
def module_mount_condition(module_base: pathlib.Path): ...
|
|
57
96
|
def module_mount_ignore_condition(module_base: pathlib.Path): ...
|
|
58
97
|
|
|
59
98
|
class _MountedPythonModule(_MountEntry):
|
|
99
|
+
"""_MountedPythonModule(module_name: str, remote_dir: Union[pathlib.PurePosixPath, str] = '/root', ignore: Optional[Callable[[pathlib.Path], bool]] = None)"""
|
|
100
|
+
|
|
60
101
|
module_name: str
|
|
61
102
|
remote_dir: typing.Union[pathlib.PurePosixPath, str]
|
|
62
103
|
ignore: typing.Optional[collections.abc.Callable[[pathlib.Path], bool]]
|
|
@@ -71,27 +112,66 @@ class _MountedPythonModule(_MountEntry):
|
|
|
71
112
|
module_name: str,
|
|
72
113
|
remote_dir: typing.Union[pathlib.PurePosixPath, str] = "/root",
|
|
73
114
|
ignore: typing.Optional[collections.abc.Callable[[pathlib.Path], bool]] = None,
|
|
74
|
-
) -> None:
|
|
75
|
-
|
|
76
|
-
|
|
115
|
+
) -> None:
|
|
116
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
117
|
+
...
|
|
77
118
|
|
|
78
|
-
|
|
119
|
+
def __repr__(self):
|
|
120
|
+
"""Return repr(self)."""
|
|
121
|
+
...
|
|
122
|
+
|
|
123
|
+
def __eq__(self, other):
|
|
124
|
+
"""Return self==value."""
|
|
125
|
+
...
|
|
126
|
+
|
|
127
|
+
class NonLocalMountError(Exception):
|
|
128
|
+
"""Common base class for all non-exit exceptions."""
|
|
129
|
+
|
|
130
|
+
...
|
|
79
131
|
|
|
80
132
|
class _Mount(modal._object._Object):
|
|
133
|
+
"""**Deprecated**: Mounts should not be used explicitly anymore, use `Image.add_local_*` commands instead.
|
|
134
|
+
|
|
135
|
+
Create a mount for a local directory or file that can be attached
|
|
136
|
+
to one or more Modal functions.
|
|
137
|
+
|
|
138
|
+
**Usage**
|
|
139
|
+
|
|
140
|
+
```python notest
|
|
141
|
+
import modal
|
|
142
|
+
import os
|
|
143
|
+
app = modal.App()
|
|
144
|
+
|
|
145
|
+
@app.function(mounts=[modal.Mount.from_local_dir("~/foo", remote_path="/root/foo")])
|
|
146
|
+
def f():
|
|
147
|
+
# `/root/foo` has the contents of `~/foo`.
|
|
148
|
+
print(os.listdir("/root/foo/"))
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Modal syncs the contents of the local directory every time the app runs, but uses the hash of
|
|
152
|
+
the file's contents to skip uploading files that have been uploaded before.
|
|
153
|
+
"""
|
|
154
|
+
|
|
81
155
|
_entries: typing.Optional[list[_MountEntry]]
|
|
82
156
|
_deployment_name: typing.Optional[str]
|
|
83
157
|
_namespace: typing.Optional[int]
|
|
84
|
-
|
|
158
|
+
_allow_overwrite: bool
|
|
85
159
|
_content_checksum_sha256_hex: typing.Optional[str]
|
|
86
160
|
|
|
87
161
|
@staticmethod
|
|
88
162
|
def _new(entries: list[_MountEntry] = []) -> _Mount: ...
|
|
89
163
|
def _extend(self, entry: _MountEntry) -> _Mount: ...
|
|
90
164
|
@property
|
|
91
|
-
def entries(self):
|
|
165
|
+
def entries(self):
|
|
166
|
+
"""mdmd:hidden"""
|
|
167
|
+
...
|
|
168
|
+
|
|
92
169
|
def _hydrate_metadata(self, handle_metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
93
170
|
def _top_level_paths(self) -> list[tuple[pathlib.Path, pathlib.PurePosixPath]]: ...
|
|
94
|
-
def is_local(self) -> bool:
|
|
171
|
+
def is_local(self) -> bool:
|
|
172
|
+
"""mdmd:hidden"""
|
|
173
|
+
...
|
|
174
|
+
|
|
95
175
|
@staticmethod
|
|
96
176
|
def _add_local_dir(
|
|
97
177
|
local_path: pathlib.Path,
|
|
@@ -105,15 +185,10 @@ class _Mount(modal._object._Object):
|
|
|
105
185
|
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
106
186
|
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
107
187
|
recursive: bool = True,
|
|
108
|
-
) -> _Mount:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*,
|
|
113
|
-
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
114
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
115
|
-
recursive: bool = True,
|
|
116
|
-
) -> _Mount: ...
|
|
188
|
+
) -> _Mount:
|
|
189
|
+
"""Add a local directory to the `Mount` object."""
|
|
190
|
+
...
|
|
191
|
+
|
|
117
192
|
@staticmethod
|
|
118
193
|
def _from_local_dir(
|
|
119
194
|
local_path: typing.Union[str, pathlib.Path],
|
|
@@ -126,11 +201,10 @@ class _Mount(modal._object._Object):
|
|
|
126
201
|
self,
|
|
127
202
|
local_path: typing.Union[str, pathlib.Path],
|
|
128
203
|
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
129
|
-
) -> _Mount:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
) -> _Mount: ...
|
|
204
|
+
) -> _Mount:
|
|
205
|
+
"""Add a local file to the `Mount` object."""
|
|
206
|
+
...
|
|
207
|
+
|
|
134
208
|
@staticmethod
|
|
135
209
|
def _from_local_file(
|
|
136
210
|
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
@@ -142,16 +216,12 @@ class _Mount(modal._object._Object):
|
|
|
142
216
|
entries: list[_MountEntry],
|
|
143
217
|
) -> collections.abc.AsyncGenerator[modal._utils.blob_utils.FileUploadSpec, None]: ...
|
|
144
218
|
async def _load_mount(
|
|
145
|
-
self: _Mount,
|
|
219
|
+
self: _Mount,
|
|
220
|
+
resolver: modal._resolver.Resolver,
|
|
221
|
+
load_context: modal._load_context.LoadContext,
|
|
222
|
+
existing_object_id: typing.Optional[str],
|
|
146
223
|
): ...
|
|
147
224
|
@staticmethod
|
|
148
|
-
def from_local_python_packages(
|
|
149
|
-
*module_names: str,
|
|
150
|
-
remote_dir: typing.Union[str, pathlib.PurePosixPath] = "/root",
|
|
151
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
152
|
-
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
153
|
-
) -> _Mount: ...
|
|
154
|
-
@staticmethod
|
|
155
225
|
def _from_local_python_packages(
|
|
156
226
|
*module_names: str,
|
|
157
227
|
remote_dir: typing.Union[str, pathlib.PurePosixPath] = "/root",
|
|
@@ -159,20 +229,23 @@ class _Mount(modal._object._Object):
|
|
|
159
229
|
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
160
230
|
) -> _Mount: ...
|
|
161
231
|
@staticmethod
|
|
162
|
-
def from_name(
|
|
163
|
-
@classmethod
|
|
164
|
-
async def lookup(
|
|
165
|
-
cls: type[_Mount],
|
|
232
|
+
def from_name(
|
|
166
233
|
name: str,
|
|
234
|
+
*,
|
|
167
235
|
namespace=1,
|
|
168
|
-
client: typing.Optional[modal.client._Client] = None,
|
|
169
236
|
environment_name: typing.Optional[str] = None,
|
|
170
|
-
|
|
237
|
+
client: typing.Optional[modal.client._Client] = None,
|
|
238
|
+
) -> _Mount:
|
|
239
|
+
"""mdmd:hidden"""
|
|
240
|
+
...
|
|
241
|
+
|
|
171
242
|
async def _deploy(
|
|
172
243
|
self: _Mount,
|
|
173
244
|
deployment_name: typing.Optional[str] = None,
|
|
174
245
|
namespace=1,
|
|
246
|
+
*,
|
|
175
247
|
environment_name: typing.Optional[str] = None,
|
|
248
|
+
allow_overwrite: bool = False,
|
|
176
249
|
client: typing.Optional[modal.client._Client] = None,
|
|
177
250
|
) -> None: ...
|
|
178
251
|
def _get_metadata(self) -> modal_proto.api_pb2.MountHandleMetadata: ...
|
|
@@ -180,21 +253,52 @@ class _Mount(modal._object._Object):
|
|
|
180
253
|
SUPERSELF = typing.TypeVar("SUPERSELF", covariant=True)
|
|
181
254
|
|
|
182
255
|
class Mount(modal.object.Object):
|
|
256
|
+
"""**Deprecated**: Mounts should not be used explicitly anymore, use `Image.add_local_*` commands instead.
|
|
257
|
+
|
|
258
|
+
Create a mount for a local directory or file that can be attached
|
|
259
|
+
to one or more Modal functions.
|
|
260
|
+
|
|
261
|
+
**Usage**
|
|
262
|
+
|
|
263
|
+
```python notest
|
|
264
|
+
import modal
|
|
265
|
+
import os
|
|
266
|
+
app = modal.App()
|
|
267
|
+
|
|
268
|
+
@app.function(mounts=[modal.Mount.from_local_dir("~/foo", remote_path="/root/foo")])
|
|
269
|
+
def f():
|
|
270
|
+
# `/root/foo` has the contents of `~/foo`.
|
|
271
|
+
print(os.listdir("/root/foo/"))
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Modal syncs the contents of the local directory every time the app runs, but uses the hash of
|
|
275
|
+
the file's contents to skip uploading files that have been uploaded before.
|
|
276
|
+
"""
|
|
277
|
+
|
|
183
278
|
_entries: typing.Optional[list[_MountEntry]]
|
|
184
279
|
_deployment_name: typing.Optional[str]
|
|
185
280
|
_namespace: typing.Optional[int]
|
|
186
|
-
|
|
281
|
+
_allow_overwrite: bool
|
|
187
282
|
_content_checksum_sha256_hex: typing.Optional[str]
|
|
188
283
|
|
|
189
|
-
def __init__(self, *args, **kwargs):
|
|
284
|
+
def __init__(self, *args, **kwargs):
|
|
285
|
+
"""mdmd:hidden"""
|
|
286
|
+
...
|
|
287
|
+
|
|
190
288
|
@staticmethod
|
|
191
289
|
def _new(entries: list[_MountEntry] = []) -> Mount: ...
|
|
192
290
|
def _extend(self, entry: _MountEntry) -> Mount: ...
|
|
193
291
|
@property
|
|
194
|
-
def entries(self):
|
|
292
|
+
def entries(self):
|
|
293
|
+
"""mdmd:hidden"""
|
|
294
|
+
...
|
|
295
|
+
|
|
195
296
|
def _hydrate_metadata(self, handle_metadata: typing.Optional[google.protobuf.message.Message]): ...
|
|
196
297
|
def _top_level_paths(self) -> list[tuple[pathlib.Path, pathlib.PurePosixPath]]: ...
|
|
197
|
-
def is_local(self) -> bool:
|
|
298
|
+
def is_local(self) -> bool:
|
|
299
|
+
"""mdmd:hidden"""
|
|
300
|
+
...
|
|
301
|
+
|
|
198
302
|
@staticmethod
|
|
199
303
|
def _add_local_dir(
|
|
200
304
|
local_path: pathlib.Path,
|
|
@@ -208,15 +312,10 @@ class Mount(modal.object.Object):
|
|
|
208
312
|
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
209
313
|
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
210
314
|
recursive: bool = True,
|
|
211
|
-
) -> Mount:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*,
|
|
216
|
-
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
217
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
218
|
-
recursive: bool = True,
|
|
219
|
-
) -> Mount: ...
|
|
315
|
+
) -> Mount:
|
|
316
|
+
"""Add a local directory to the `Mount` object."""
|
|
317
|
+
...
|
|
318
|
+
|
|
220
319
|
@staticmethod
|
|
221
320
|
def _from_local_dir(
|
|
222
321
|
local_path: typing.Union[str, pathlib.Path],
|
|
@@ -229,11 +328,10 @@ class Mount(modal.object.Object):
|
|
|
229
328
|
self,
|
|
230
329
|
local_path: typing.Union[str, pathlib.Path],
|
|
231
330
|
remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None,
|
|
232
|
-
) -> Mount:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
) -> Mount: ...
|
|
331
|
+
) -> Mount:
|
|
332
|
+
"""Add a local file to the `Mount` object."""
|
|
333
|
+
...
|
|
334
|
+
|
|
237
335
|
@staticmethod
|
|
238
336
|
def _from_local_file(
|
|
239
337
|
local_path: typing.Union[str, pathlib.Path], remote_path: typing.Union[str, pathlib.PurePosixPath, None] = None
|
|
@@ -252,18 +350,23 @@ class Mount(modal.object.Object):
|
|
|
252
350
|
_get_files: ___get_files_spec
|
|
253
351
|
|
|
254
352
|
class ___load_mount_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
255
|
-
def __call__(
|
|
256
|
-
|
|
353
|
+
def __call__(
|
|
354
|
+
self,
|
|
355
|
+
/,
|
|
356
|
+
resolver: modal._resolver.Resolver,
|
|
357
|
+
load_context: modal._load_context.LoadContext,
|
|
358
|
+
existing_object_id: typing.Optional[str],
|
|
359
|
+
): ...
|
|
360
|
+
async def aio(
|
|
361
|
+
self,
|
|
362
|
+
/,
|
|
363
|
+
resolver: modal._resolver.Resolver,
|
|
364
|
+
load_context: modal._load_context.LoadContext,
|
|
365
|
+
existing_object_id: typing.Optional[str],
|
|
366
|
+
): ...
|
|
257
367
|
|
|
258
368
|
_load_mount: ___load_mount_spec[typing_extensions.Self]
|
|
259
369
|
|
|
260
|
-
@staticmethod
|
|
261
|
-
def from_local_python_packages(
|
|
262
|
-
*module_names: str,
|
|
263
|
-
remote_dir: typing.Union[str, pathlib.PurePosixPath] = "/root",
|
|
264
|
-
condition: typing.Optional[collections.abc.Callable[[str], bool]] = None,
|
|
265
|
-
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
266
|
-
) -> Mount: ...
|
|
267
370
|
@staticmethod
|
|
268
371
|
def _from_local_python_packages(
|
|
269
372
|
*module_names: str,
|
|
@@ -272,15 +375,15 @@ class Mount(modal.object.Object):
|
|
|
272
375
|
ignore: typing.Union[typing.Sequence[str], collections.abc.Callable[[pathlib.Path], bool], None] = None,
|
|
273
376
|
) -> Mount: ...
|
|
274
377
|
@staticmethod
|
|
275
|
-
def from_name(
|
|
276
|
-
@classmethod
|
|
277
|
-
def lookup(
|
|
278
|
-
cls: type[Mount],
|
|
378
|
+
def from_name(
|
|
279
379
|
name: str,
|
|
380
|
+
*,
|
|
280
381
|
namespace=1,
|
|
281
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
282
382
|
environment_name: typing.Optional[str] = None,
|
|
283
|
-
|
|
383
|
+
client: typing.Optional[modal.client.Client] = None,
|
|
384
|
+
) -> Mount:
|
|
385
|
+
"""mdmd:hidden"""
|
|
386
|
+
...
|
|
284
387
|
|
|
285
388
|
class ___deploy_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
286
389
|
def __call__(
|
|
@@ -288,7 +391,9 @@ class Mount(modal.object.Object):
|
|
|
288
391
|
/,
|
|
289
392
|
deployment_name: typing.Optional[str] = None,
|
|
290
393
|
namespace=1,
|
|
394
|
+
*,
|
|
291
395
|
environment_name: typing.Optional[str] = None,
|
|
396
|
+
allow_overwrite: bool = False,
|
|
292
397
|
client: typing.Optional[modal.client.Client] = None,
|
|
293
398
|
) -> None: ...
|
|
294
399
|
async def aio(
|
|
@@ -296,7 +401,9 @@ class Mount(modal.object.Object):
|
|
|
296
401
|
/,
|
|
297
402
|
deployment_name: typing.Optional[str] = None,
|
|
298
403
|
namespace=1,
|
|
404
|
+
*,
|
|
299
405
|
environment_name: typing.Optional[str] = None,
|
|
406
|
+
allow_overwrite: bool = False,
|
|
300
407
|
client: typing.Optional[modal.client.Client] = None,
|
|
301
408
|
) -> None: ...
|
|
302
409
|
|
|
@@ -308,6 +415,46 @@ def _create_client_mount(): ...
|
|
|
308
415
|
def create_client_mount(): ...
|
|
309
416
|
def _get_client_mount(): ...
|
|
310
417
|
def _is_modal_path(remote_path: pathlib.PurePosixPath): ...
|
|
418
|
+
async def _create_single_client_dependency_mount(
|
|
419
|
+
client: modal.client._Client,
|
|
420
|
+
builder_version: str,
|
|
421
|
+
python_version: str,
|
|
422
|
+
arch: str,
|
|
423
|
+
platform: str,
|
|
424
|
+
uv_python_platform: str,
|
|
425
|
+
check_if_exists: bool = True,
|
|
426
|
+
allow_overwrite: bool = False,
|
|
427
|
+
dry_run: bool = False,
|
|
428
|
+
): ...
|
|
429
|
+
async def _create_client_dependency_mounts(
|
|
430
|
+
client=None,
|
|
431
|
+
python_versions: list[str] = ["3.9", "3.10", "3.11", "3.12", "3.13"],
|
|
432
|
+
builder_versions: list[str] = ["2025.06"],
|
|
433
|
+
check_if_exists=True,
|
|
434
|
+
dry_run=False,
|
|
435
|
+
): ...
|
|
436
|
+
|
|
437
|
+
class __create_client_dependency_mounts_spec(typing_extensions.Protocol):
|
|
438
|
+
def __call__(
|
|
439
|
+
self,
|
|
440
|
+
/,
|
|
441
|
+
client=None,
|
|
442
|
+
python_versions: list[str] = ["3.9", "3.10", "3.11", "3.12", "3.13"],
|
|
443
|
+
builder_versions: list[str] = ["2025.06"],
|
|
444
|
+
check_if_exists=True,
|
|
445
|
+
dry_run=False,
|
|
446
|
+
): ...
|
|
447
|
+
async def aio(
|
|
448
|
+
self,
|
|
449
|
+
/,
|
|
450
|
+
client=None,
|
|
451
|
+
python_versions: list[str] = ["3.9", "3.10", "3.11", "3.12", "3.13"],
|
|
452
|
+
builder_versions: list[str] = ["2025.06"],
|
|
453
|
+
check_if_exists=True,
|
|
454
|
+
dry_run=False,
|
|
455
|
+
): ...
|
|
456
|
+
|
|
457
|
+
create_client_dependency_mounts: __create_client_dependency_mounts_spec
|
|
311
458
|
|
|
312
459
|
ROOT_DIR: pathlib.PurePosixPath
|
|
313
460
|
|