modal 0.73.2__py3-none-any.whl → 0.73.3__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.
- modal/_functions.py +1602 -0
- modal/_runtime/user_code_imports.py +1 -1
- modal/_utils/mount_utils.py +1 -1
- modal/app.py +2 -1
- modal/app.pyi +4 -3
- modal/cli/run.py +2 -1
- modal/client.pyi +2 -2
- modal/cls.py +1 -1
- modal/cls.pyi +9 -8
- modal/experimental.py +1 -1
- modal/functions.py +6 -1607
- modal/functions.pyi +30 -309
- modal/image.py +3 -3
- modal/image.pyi +2 -1
- modal/parallel_map.pyi +2 -2
- modal/partial_function.py +1 -1
- modal/partial_function.pyi +2 -1
- modal/runner.py +1 -1
- modal/runner.pyi +3 -3
- {modal-0.73.2.dist-info → modal-0.73.3.dist-info}/METADATA +2 -2
- {modal-0.73.2.dist-info → modal-0.73.3.dist-info}/RECORD +26 -25
- modal_version/_version_generated.py +1 -1
- {modal-0.73.2.dist-info → modal-0.73.3.dist-info}/LICENSE +0 -0
- {modal-0.73.2.dist-info → modal-0.73.3.dist-info}/WHEEL +0 -0
- {modal-0.73.2.dist-info → modal-0.73.3.dist-info}/entry_points.txt +0 -0
- {modal-0.73.2.dist-info → modal-0.73.3.dist-info}/top_level.txt +0 -0
@@ -9,10 +9,10 @@ import modal._object
|
|
9
9
|
import modal._runtime.container_io_manager
|
10
10
|
import modal.cls
|
11
11
|
from modal import Function
|
12
|
+
from modal._functions import _Function
|
12
13
|
from modal._utils.async_utils import synchronizer
|
13
14
|
from modal._utils.function_utils import LocalFunctionError, is_async as get_is_async, is_global_object
|
14
15
|
from modal.exception import ExecutionError, InvalidError
|
15
|
-
from modal.functions import _Function
|
16
16
|
from modal.partial_function import _find_partial_methods_for_user_cls, _PartialFunctionFlags
|
17
17
|
from modal_proto import api_pb2
|
18
18
|
|
modal/_utils/mount_utils.py
CHANGED
@@ -65,7 +65,7 @@ def validate_volumes(
|
|
65
65
|
volume_to_paths: dict[_Volume, list[str]] = {}
|
66
66
|
for path, volume in validated_volumes:
|
67
67
|
if not isinstance(volume, (_Volume, _CloudBucketMount)):
|
68
|
-
raise InvalidError(f"Object of type {type(volume)} mounted at '{path}' is not
|
68
|
+
raise InvalidError(f"Object of type {type(volume)} mounted at '{path}' is not usable as a volume.")
|
69
69
|
elif isinstance(volume, (_Volume)):
|
70
70
|
volume_to_paths.setdefault(volume, []).append(path)
|
71
71
|
for paths in volume_to_paths.values():
|
modal/app.py
CHANGED
@@ -20,6 +20,7 @@ from synchronicity.async_wrap import asynccontextmanager
|
|
20
20
|
|
21
21
|
from modal_proto import api_pb2
|
22
22
|
|
23
|
+
from ._functions import _Function
|
23
24
|
from ._ipython import is_notebook
|
24
25
|
from ._object import _get_environment_name, _Object
|
25
26
|
from ._utils.async_utils import synchronize_api
|
@@ -32,7 +33,7 @@ from .cloud_bucket_mount import _CloudBucketMount
|
|
32
33
|
from .cls import _Cls, parameter
|
33
34
|
from .config import logger
|
34
35
|
from .exception import ExecutionError, InvalidError
|
35
|
-
from .functions import Function
|
36
|
+
from .functions import Function
|
36
37
|
from .gpu import GPU_T
|
37
38
|
from .image import _Image
|
38
39
|
from .mount import _Mount
|
modal/app.pyi
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import collections.abc
|
2
|
+
import modal._functions
|
2
3
|
import modal._object
|
3
4
|
import modal._utils.function_utils
|
4
5
|
import modal.client
|
@@ -79,7 +80,7 @@ class _App:
|
|
79
80
|
_container_app: typing.ClassVar[typing.Optional[_App]]
|
80
81
|
_name: typing.Optional[str]
|
81
82
|
_description: typing.Optional[str]
|
82
|
-
_functions: dict[str, modal.
|
83
|
+
_functions: dict[str, modal._functions._Function]
|
83
84
|
_classes: dict[str, modal.cls._Cls]
|
84
85
|
_image: typing.Optional[modal.image._Image]
|
85
86
|
_mounts: collections.abc.Sequence[modal.mount._Mount]
|
@@ -137,11 +138,11 @@ class _App:
|
|
137
138
|
) -> typing.AsyncContextManager[_App]: ...
|
138
139
|
def _get_default_image(self): ...
|
139
140
|
def _get_watch_mounts(self): ...
|
140
|
-
def _add_function(self, function: modal.
|
141
|
+
def _add_function(self, function: modal._functions._Function, is_web_endpoint: bool): ...
|
141
142
|
def _add_class(self, tag: str, cls: modal.cls._Cls): ...
|
142
143
|
def _init_container(self, client: modal.client._Client, running_app: modal.running_app.RunningApp): ...
|
143
144
|
@property
|
144
|
-
def registered_functions(self) -> dict[str, modal.
|
145
|
+
def registered_functions(self) -> dict[str, modal._functions._Function]: ...
|
145
146
|
@property
|
146
147
|
def registered_classes(self) -> dict[str, modal.cls._Cls]: ...
|
147
148
|
@property
|
modal/cli/run.py
CHANGED
@@ -15,11 +15,12 @@ import typer
|
|
15
15
|
from click import ClickException
|
16
16
|
from typing_extensions import TypedDict
|
17
17
|
|
18
|
+
from .._functions import _FunctionSpec
|
18
19
|
from ..app import App, LocalEntrypoint
|
19
20
|
from ..config import config
|
20
21
|
from ..environments import ensure_env
|
21
22
|
from ..exception import ExecutionError, InvalidError, _CliUserExecutionError
|
22
|
-
from ..functions import Function
|
23
|
+
from ..functions import Function
|
23
24
|
from ..image import Image
|
24
25
|
from ..output import enable_output
|
25
26
|
from ..runner import deploy_app, interactive_shell, run_app
|
modal/client.pyi
CHANGED
@@ -27,7 +27,7 @@ class _Client:
|
|
27
27
|
_snapshotted: bool
|
28
28
|
|
29
29
|
def __init__(
|
30
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.
|
30
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.3"
|
31
31
|
): ...
|
32
32
|
def is_closed(self) -> bool: ...
|
33
33
|
@property
|
@@ -85,7 +85,7 @@ class Client:
|
|
85
85
|
_snapshotted: bool
|
86
86
|
|
87
87
|
def __init__(
|
88
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.
|
88
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.3"
|
89
89
|
): ...
|
90
90
|
def is_closed(self) -> bool: ...
|
91
91
|
@property
|
modal/cls.py
CHANGED
@@ -11,6 +11,7 @@ from grpclib import GRPCError, Status
|
|
11
11
|
from modal._utils.function_utils import CLASS_PARAM_TYPE_MAP
|
12
12
|
from modal_proto import api_pb2
|
13
13
|
|
14
|
+
from ._functions import _Function, _parse_retries
|
14
15
|
from ._object import _get_environment_name, _Object
|
15
16
|
from ._resolver import Resolver
|
16
17
|
from ._resources import convert_fn_config_to_resources_config
|
@@ -22,7 +23,6 @@ from ._utils.grpc_utils import retry_transient_errors
|
|
22
23
|
from ._utils.mount_utils import validate_volumes
|
23
24
|
from .client import _Client
|
24
25
|
from .exception import ExecutionError, InvalidError, NotFoundError, VersionError
|
25
|
-
from .functions import _Function, _parse_retries
|
26
26
|
from .gpu import GPU_T
|
27
27
|
from .partial_function import (
|
28
28
|
_find_callables_for_obj,
|
modal/cls.pyi
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import collections.abc
|
2
2
|
import google.protobuf.message
|
3
3
|
import inspect
|
4
|
+
import modal._functions
|
4
5
|
import modal._object
|
5
6
|
import modal.app
|
6
7
|
import modal.client
|
@@ -21,17 +22,17 @@ T = typing.TypeVar("T")
|
|
21
22
|
def _use_annotation_parameters(user_cls: type) -> bool: ...
|
22
23
|
def _get_class_constructor_signature(user_cls: type) -> inspect.Signature: ...
|
23
24
|
def _bind_instance_method(
|
24
|
-
service_function: modal.
|
25
|
+
service_function: modal._functions._Function, class_bound_method: modal._functions._Function
|
25
26
|
): ...
|
26
27
|
|
27
28
|
class _Obj:
|
28
29
|
_cls: _Cls
|
29
|
-
_functions: dict[str, modal.
|
30
|
+
_functions: dict[str, modal._functions._Function]
|
30
31
|
_has_entered: bool
|
31
32
|
_user_cls_instance: typing.Optional[typing.Any]
|
32
33
|
_args: tuple[typing.Any, ...]
|
33
34
|
_kwargs: dict[str, typing.Any]
|
34
|
-
_instance_service_function: typing.Optional[modal.
|
35
|
+
_instance_service_function: typing.Optional[modal._functions._Function]
|
35
36
|
|
36
37
|
def _uses_common_service_function(self): ...
|
37
38
|
def __init__(
|
@@ -42,7 +43,7 @@ class _Obj:
|
|
42
43
|
args,
|
43
44
|
kwargs,
|
44
45
|
): ...
|
45
|
-
def _cached_service_function(self) -> modal.
|
46
|
+
def _cached_service_function(self) -> modal._functions._Function: ...
|
46
47
|
def _get_parameter_values(self) -> dict[str, typing.Any]: ...
|
47
48
|
def _new_user_cls_instance(self): ...
|
48
49
|
async def keep_warm(self, warm_pool_size: int) -> None: ...
|
@@ -96,8 +97,8 @@ class Obj:
|
|
96
97
|
|
97
98
|
class _Cls(modal._object._Object):
|
98
99
|
_user_cls: typing.Optional[type]
|
99
|
-
_class_service_function: typing.Optional[modal.
|
100
|
-
_method_functions: typing.Optional[dict[str, modal.
|
100
|
+
_class_service_function: typing.Optional[modal._functions._Function]
|
101
|
+
_method_functions: typing.Optional[dict[str, modal._functions._Function]]
|
101
102
|
_options: typing.Optional[modal_proto.api_pb2.FunctionOptions]
|
102
103
|
_callables: dict[str, collections.abc.Callable[..., typing.Any]]
|
103
104
|
_app: typing.Optional[modal.app._App]
|
@@ -109,13 +110,13 @@ class _Cls(modal._object._Object):
|
|
109
110
|
def _get_app(self) -> modal.app._App: ...
|
110
111
|
def _get_user_cls(self) -> type: ...
|
111
112
|
def _get_name(self) -> str: ...
|
112
|
-
def _get_class_service_function(self) -> modal.
|
113
|
+
def _get_class_service_function(self) -> modal._functions._Function: ...
|
113
114
|
def _get_method_names(self) -> collections.abc.Collection[str]: ...
|
114
115
|
def _hydrate_metadata(self, metadata: google.protobuf.message.Message): ...
|
115
116
|
@staticmethod
|
116
117
|
def validate_construction_mechanism(user_cls): ...
|
117
118
|
@staticmethod
|
118
|
-
def from_local(user_cls, app: modal.app._App, class_service_function: modal.
|
119
|
+
def from_local(user_cls, app: modal.app._App, class_service_function: modal._functions._Function) -> _Cls: ...
|
119
120
|
def _uses_common_service_function(self): ...
|
120
121
|
@classmethod
|
121
122
|
def from_name(
|
modal/experimental.py
CHANGED
@@ -5,12 +5,12 @@ from typing import Any, Callable, Optional
|
|
5
5
|
from modal_proto import api_pb2
|
6
6
|
|
7
7
|
from ._clustered_functions import ClusterInfo, get_cluster_info as _get_cluster_info
|
8
|
+
from ._functions import _Function
|
8
9
|
from ._object import _get_environment_name
|
9
10
|
from ._runtime.container_io_manager import _ContainerIOManager
|
10
11
|
from ._utils.async_utils import synchronizer
|
11
12
|
from .client import _Client
|
12
13
|
from .exception import InvalidError
|
13
|
-
from .functions import _Function
|
14
14
|
from .partial_function import _PartialFunction, _PartialFunctionFlags
|
15
15
|
|
16
16
|
|