modal 1.3.1.dev8__tar.gz → 1.3.1.dev10__tar.gz
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-1.3.1.dev8 → modal-1.3.1.dev10}/PKG-INFO +1 -1
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_partial_function.py +1 -22
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/app.py +0 -6
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/client.pyi +2 -2
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cls.py +0 -3
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/functions.pyi +6 -6
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/partial_function.pyi +0 -1
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/api.proto +16 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/api_pb2.py +370 -349
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/api_pb2.pyi +62 -2
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_version/__init__.py +1 -1
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/LICENSE +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/README.md +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/__main__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_billing.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_clustered_functions.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_clustered_functions.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_container_entrypoint.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_functions.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_grpc_client.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_ipython.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_load_context.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_location.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_object.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_output.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_pty.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_resolver.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_resources.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/asgi.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/execution_context.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/telemetry.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_serialization.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_traceback.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_tunnel.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_tunnel.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_type_manager.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/app_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/async_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/blob_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/deprecation.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/docker_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/function_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/git_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/hash_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/http_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/logger.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/mount_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/name_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/package_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/shell_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/task_command_router_client.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_utils/time_utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_vendor/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_vendor/tblib.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/_watcher.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/app.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/billing.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/2023.12.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/2024.04.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/2024.10.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/2025.06.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/README.md +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/builder/base-images.json +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/call_graph.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/_download.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/_traceback.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/app.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/cluster.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/config.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/container.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/dict.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/entry_point.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/environment.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/import_refs.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/launch.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/network_file_system.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/profile.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/programs/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/programs/vscode.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/queues.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/run.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/secret.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/shell.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/token.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/utils.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cli/volume.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/client.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/cls.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/config.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/container_process.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/container_process.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/dict.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/dict.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/environments.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/environments.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/exception.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/experimental/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/experimental/flash.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/experimental/flash.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/experimental/ipython.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/file_io.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/file_io.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/file_pattern_matcher.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/functions.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/gpu.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/image.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/image.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/io_streams.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/io_streams.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/mount.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/mount.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/network_file_system.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/network_file_system.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/object.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/object.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/output.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/parallel_map.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/parallel_map.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/partial_function.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/proxy.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/proxy.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/py.typed +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/queue.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/queue.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/retries.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/runner.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/runner.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/running_app.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/sandbox.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/sandbox.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/schedule.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/scheduler_placement.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/secret.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/secret.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/serving.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/serving.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/snapshot.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/snapshot.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/stream_type.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/token_flow.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/token_flow.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/volume.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal/volume.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal.egg-info/requires.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal.egg-info/top_level.txt +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_docs/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/__init__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/api_grpc.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/py.typed +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/task_command_router.proto +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/modal_version/__main__.py +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/pyproject.toml +0 -0
- {modal-1.3.1.dev8 → modal-1.3.1.dev10}/setup.cfg +0 -0
|
@@ -19,7 +19,7 @@ from ._functions import _Function
|
|
|
19
19
|
from ._utils.async_utils import synchronizer
|
|
20
20
|
from ._utils.deprecation import deprecation_warning
|
|
21
21
|
from ._utils.function_utils import callable_has_non_self_params
|
|
22
|
-
from .config import config
|
|
22
|
+
from .config import config
|
|
23
23
|
from .exception import InvalidError
|
|
24
24
|
|
|
25
25
|
MAX_MAX_BATCH_SIZE = 1000
|
|
@@ -125,7 +125,6 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
|
|
|
125
125
|
user_cls: Optional[type] = None # class
|
|
126
126
|
flags: _PartialFunctionFlags
|
|
127
127
|
params: _PartialFunctionParams
|
|
128
|
-
registered: bool
|
|
129
128
|
|
|
130
129
|
def __init__(
|
|
131
130
|
self,
|
|
@@ -141,7 +140,6 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
|
|
|
141
140
|
self.user_cls = None
|
|
142
141
|
self.flags = flags
|
|
143
142
|
self.params = params
|
|
144
|
-
self.registered = False
|
|
145
143
|
self.validate_flag_composition()
|
|
146
144
|
|
|
147
145
|
def stack(self, flags: _PartialFunctionFlags, params: _PartialFunctionParams) -> typing_extensions.Self:
|
|
@@ -156,13 +154,11 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
|
|
|
156
154
|
uses_interface_flags = self.flags & _PartialFunctionFlags.interface_flags()
|
|
157
155
|
uses_lifecycle_flags = self.flags & _PartialFunctionFlags.lifecycle_flags()
|
|
158
156
|
if uses_interface_flags and uses_lifecycle_flags:
|
|
159
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
160
157
|
raise InvalidError("Interface decorators cannot be combined with lifecycle decorators.")
|
|
161
158
|
|
|
162
159
|
has_web_interface = self.flags & _PartialFunctionFlags.WEB_INTERFACE
|
|
163
160
|
has_callable_interface = self.flags & _PartialFunctionFlags.CALLABLE_INTERFACE
|
|
164
161
|
if has_web_interface and has_callable_interface:
|
|
165
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
166
162
|
raise InvalidError("Callable decorators cannot be combined with web interface decorators.")
|
|
167
163
|
|
|
168
164
|
def validate_obj_compatibility(
|
|
@@ -174,20 +170,17 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
|
|
|
174
170
|
uses_lifecycle_flags = self.flags & _PartialFunctionFlags.lifecycle_flags()
|
|
175
171
|
uses_interface_flags = self.flags & _PartialFunctionFlags.interface_flags()
|
|
176
172
|
if self.user_cls is not None and (uses_lifecycle_flags or uses_interface_flags):
|
|
177
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
178
173
|
raise InvalidError(
|
|
179
174
|
f"Cannot apply `@modal.{decorator_name}` to a class. Hint: consider applying to a method instead."
|
|
180
175
|
)
|
|
181
176
|
|
|
182
177
|
wrapped_object = self.raw_f or self.user_cls
|
|
183
178
|
if isinstance(wrapped_object, _Function):
|
|
184
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
185
179
|
raise InvalidError(
|
|
186
180
|
f"Cannot stack `@modal.{decorator_name}` on top of `@app.function`."
|
|
187
181
|
" Hint: swap the order of the decorators."
|
|
188
182
|
)
|
|
189
183
|
elif isinstance(wrapped_object, _Cls):
|
|
190
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
191
184
|
raise InvalidError(
|
|
192
185
|
f"Cannot stack `@modal.{decorator_name}` on top of `@app.cls()`."
|
|
193
186
|
" Hint: swap the order of the decorators."
|
|
@@ -196,15 +189,12 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
|
|
|
196
189
|
# Run some assertions about a callable wrappee defined by the specific decorator used
|
|
197
190
|
if self.raw_f is not None:
|
|
198
191
|
if not callable(self.raw_f):
|
|
199
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
200
192
|
raise InvalidError(f"The object wrapped by `@modal.{decorator_name}` must be callable.")
|
|
201
193
|
|
|
202
194
|
if require_sync and inspect.iscoroutinefunction(self.raw_f):
|
|
203
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
204
195
|
raise InvalidError(f"The `@modal.{decorator_name}` decorator can't be applied to an async function.")
|
|
205
196
|
|
|
206
197
|
if require_nullary and callable_has_non_self_params(self.raw_f):
|
|
207
|
-
self.registered = True # Hacky, avoid false-positive warning
|
|
208
198
|
raise InvalidError(f"Functions decorated by `@modal.{decorator_name}` can't have parameters.")
|
|
209
199
|
|
|
210
200
|
def _get_raw_f(self) -> Callable[P, ReturnType]:
|
|
@@ -244,17 +234,6 @@ class _PartialFunction(typing.Generic[P, ReturnType, OriginalReturnType]):
|
|
|
244
234
|
# to let it be bound to a variable and become a Function later on
|
|
245
235
|
return self # type: ignore # this returns a PartialFunction in a special internal case
|
|
246
236
|
|
|
247
|
-
def __del__(self):
|
|
248
|
-
if self.registered is False:
|
|
249
|
-
if self.raw_f is not None:
|
|
250
|
-
name, object_type, suggestion = self.raw_f.__name__, "function", "@app.function or @app.cls"
|
|
251
|
-
elif self.user_cls is not None:
|
|
252
|
-
name, object_type, suggestion = self.user_cls.__name__, "class", "@app.cls"
|
|
253
|
-
logger.warning(
|
|
254
|
-
f"The `{name}` {object_type} was never registered with the App."
|
|
255
|
-
f" Did you forget an {suggestion} decorator?"
|
|
256
|
-
)
|
|
257
|
-
|
|
258
237
|
|
|
259
238
|
def _find_partial_methods_for_user_cls(user_cls: type[Any], flags: int) -> dict[str, _PartialFunction]:
|
|
260
239
|
"""Grabs all method on a user class, and returns partials. Includes legacy methods."""
|
|
@@ -813,7 +813,6 @@ class _App:
|
|
|
813
813
|
|
|
814
814
|
if isinstance(f, _PartialFunction):
|
|
815
815
|
# typically for @function-wrapped @web_endpoint, @asgi_app, or @batched
|
|
816
|
-
f.registered = True
|
|
817
816
|
|
|
818
817
|
# but we don't support @app.function wrapping a method.
|
|
819
818
|
if is_method_fn(f.raw_f.__qualname__):
|
|
@@ -1052,7 +1051,6 @@ class _App:
|
|
|
1052
1051
|
# Check if the decorated object is a class
|
|
1053
1052
|
http_config = None
|
|
1054
1053
|
if isinstance(wrapped_cls, _PartialFunction):
|
|
1055
|
-
wrapped_cls.registered = True
|
|
1056
1054
|
user_cls = wrapped_cls.user_cls
|
|
1057
1055
|
if wrapped_cls.flags & _PartialFunctionFlags.HTTP_WEB_INTERFACE:
|
|
1058
1056
|
http_config = wrapped_cls.params.http_config
|
|
@@ -1110,7 +1108,6 @@ class _App:
|
|
|
1110
1108
|
raise InvalidError("A class must have `enable_memory_snapshot=True` to use `snap=True` on its methods.")
|
|
1111
1109
|
|
|
1112
1110
|
for method in _find_partial_methods_for_user_cls(user_cls, _PartialFunctionFlags.CONCURRENT).values():
|
|
1113
|
-
method.registered = True # Avoid warning about not registering the method (hacky!)
|
|
1114
1111
|
raise InvalidError(
|
|
1115
1112
|
"The `@modal.concurrent` decorator cannot be used on methods; decorate the class instead."
|
|
1116
1113
|
)
|
|
@@ -1118,7 +1115,6 @@ class _App:
|
|
|
1118
1115
|
for method in _find_partial_methods_for_user_cls(
|
|
1119
1116
|
user_cls, _PartialFunctionFlags.HTTP_WEB_INTERFACE
|
|
1120
1117
|
).values():
|
|
1121
|
-
method.registered = True # Avoid warning about not registering the method (hacky!)
|
|
1122
1118
|
raise InvalidError(
|
|
1123
1119
|
"The `@modal.http_server` decorator cannot be used on methods; decorate the class instead."
|
|
1124
1120
|
)
|
|
@@ -1127,7 +1123,6 @@ class _App:
|
|
|
1127
1123
|
for method in _find_partial_methods_for_user_cls(
|
|
1128
1124
|
user_cls, _PartialFunctionFlags.CALLABLE_INTERFACE
|
|
1129
1125
|
).values():
|
|
1130
|
-
method.registered = True # Avoid warning about not registering the method (hacky!)
|
|
1131
1126
|
raise InvalidError("Callable decorators cannot be combined with web interface decorators.")
|
|
1132
1127
|
|
|
1133
1128
|
info = FunctionInfo(None, serialized=serialized, user_cls=user_cls)
|
|
@@ -1182,7 +1177,6 @@ class _App:
|
|
|
1182
1177
|
if partial_function.params.webhook_config is not None:
|
|
1183
1178
|
full_name = f"{user_cls.__name__}.{method_name}"
|
|
1184
1179
|
local_state.web_endpoints.append(full_name)
|
|
1185
|
-
partial_function.registered = True
|
|
1186
1180
|
|
|
1187
1181
|
tag: str = user_cls.__name__
|
|
1188
1182
|
self._add_class(tag, cls)
|
|
@@ -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.3.1.
|
|
36
|
+
version: str = "1.3.1.dev10",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -163,7 +163,7 @@ class Client:
|
|
|
163
163
|
server_url: str,
|
|
164
164
|
client_type: int,
|
|
165
165
|
credentials: typing.Optional[tuple[str, str]],
|
|
166
|
-
version: str = "1.3.1.
|
|
166
|
+
version: str = "1.3.1.dev10",
|
|
167
167
|
):
|
|
168
168
|
"""mdmd:hidden
|
|
169
169
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -579,12 +579,9 @@ More information on class parameterization can be found here: https://modal.com/
|
|
|
579
579
|
# validate signature
|
|
580
580
|
_Cls.validate_construction_mechanism(user_cls)
|
|
581
581
|
|
|
582
|
-
# Disable the warning that lifecycle methods are not wrapped
|
|
583
582
|
lifecycle_method_partials = _find_partial_methods_for_user_cls(
|
|
584
583
|
user_cls, ~_PartialFunctionFlags.interface_flags()
|
|
585
584
|
)
|
|
586
|
-
for partial_function in lifecycle_method_partials.values():
|
|
587
|
-
partial_function.registered = True
|
|
588
585
|
|
|
589
586
|
method_partials = _find_partial_methods_for_user_cls(user_cls, _PartialFunctionFlags.interface_flags())
|
|
590
587
|
|
|
@@ -407,7 +407,7 @@ class Function(
|
|
|
407
407
|
|
|
408
408
|
_call_generator: ___call_generator_spec
|
|
409
409
|
|
|
410
|
-
class __remote_spec(typing_extensions.Protocol[
|
|
410
|
+
class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
|
|
411
411
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
|
|
412
412
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
413
413
|
...
|
|
@@ -416,7 +416,7 @@ class Function(
|
|
|
416
416
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
417
417
|
...
|
|
418
418
|
|
|
419
|
-
remote: __remote_spec[modal._functions.
|
|
419
|
+
remote: __remote_spec[modal._functions.P, modal._functions.ReturnType]
|
|
420
420
|
|
|
421
421
|
class __remote_gen_spec(typing_extensions.Protocol):
|
|
422
422
|
def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
|
@@ -443,7 +443,7 @@ class Function(
|
|
|
443
443
|
"""
|
|
444
444
|
...
|
|
445
445
|
|
|
446
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
|
446
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
|
|
447
447
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
448
448
|
"""[Experimental] Calls the function with the given arguments, without waiting for the results.
|
|
449
449
|
|
|
@@ -466,7 +466,7 @@ class Function(
|
|
|
466
466
|
"""
|
|
467
467
|
...
|
|
468
468
|
|
|
469
|
-
_experimental_spawn: ___experimental_spawn_spec[modal._functions.
|
|
469
|
+
_experimental_spawn: ___experimental_spawn_spec[modal._functions.P, modal._functions.ReturnType]
|
|
470
470
|
|
|
471
471
|
class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER]):
|
|
472
472
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> None: ...
|
|
@@ -474,7 +474,7 @@ class Function(
|
|
|
474
474
|
|
|
475
475
|
_spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P]
|
|
476
476
|
|
|
477
|
-
class __spawn_spec(typing_extensions.Protocol[
|
|
477
|
+
class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
|
|
478
478
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
479
479
|
"""Calls the function with the given arguments, without waiting for the results.
|
|
480
480
|
|
|
@@ -495,7 +495,7 @@ class Function(
|
|
|
495
495
|
"""
|
|
496
496
|
...
|
|
497
497
|
|
|
498
|
-
spawn: __spawn_spec[modal._functions.
|
|
498
|
+
spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType]
|
|
499
499
|
|
|
500
500
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
|
|
501
501
|
"""Return the inner Python object wrapped by this Modal Function."""
|
|
@@ -2679,6 +2679,19 @@ message RateLimit {
|
|
|
2679
2679
|
RateLimitInterval interval = 2;
|
|
2680
2680
|
}
|
|
2681
2681
|
|
|
2682
|
+
message ResourceInfo {
|
|
2683
|
+
message ResourceValue {
|
|
2684
|
+
uint32 value = 1;
|
|
2685
|
+
bool is_default = 2;
|
|
2686
|
+
}
|
|
2687
|
+
ResourceValue memory_mb = 1; // MiB
|
|
2688
|
+
ResourceValue milli_cpu = 2; // milli CPU cores
|
|
2689
|
+
string gpu_type = 3;
|
|
2690
|
+
uint32 memory_mb_max = 4 ; // MiB
|
|
2691
|
+
uint32 ephemeral_disk_mb = 5; // MiB
|
|
2692
|
+
uint32 milli_cpu_max = 6; // milli CPU cores
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2682
2695
|
message Resources {
|
|
2683
2696
|
uint32 memory_mb = 2; // MiB
|
|
2684
2697
|
uint32 milli_cpu = 3; // milli CPU cores
|
|
@@ -2887,9 +2900,12 @@ message SandboxInfo {
|
|
|
2887
2900
|
repeated SandboxTag tags = 6; // TODO: Not yet exposed in client library.
|
|
2888
2901
|
string name = 7;
|
|
2889
2902
|
string image_id = 8;
|
|
2903
|
+
ResourceInfo resource_info = 9;
|
|
2904
|
+
repeated string regions = 10;
|
|
2890
2905
|
reserved 2; // modal.client.Sandbox definition
|
|
2891
2906
|
}
|
|
2892
2907
|
|
|
2908
|
+
|
|
2893
2909
|
message SandboxListRequest {
|
|
2894
2910
|
string app_id = 1;
|
|
2895
2911
|
double before_timestamp = 2;
|