modal 1.1.2.dev10__tar.gz → 1.1.2.dev12__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.1.2.dev10 → modal-1.1.2.dev12}/PKG-INFO +2 -2
- modal-1.1.2.dev12/modal/_utils/time_utils.py +43 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/dict.py +6 -7
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/queues.py +40 -15
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/secret.py +33 -7
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/volume.py +6 -9
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/client.pyi +2 -2
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/dict.py +78 -5
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/dict.pyi +115 -1
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/functions.pyi +6 -6
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/queue.py +76 -3
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/queue.pyi +114 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/secret.py +68 -1
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/secret.pyi +114 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/volume.py +79 -6
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/volume.pyi +118 -4
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal.egg-info/PKG-INFO +2 -2
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal.egg-info/requires.txt +1 -1
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_docs/mdmd/mdmd.py +11 -1
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/api.proto +6 -4
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/api_pb2.py +320 -320
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/api_pb2.pyi +10 -5
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_version/__init__.py +1 -1
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/pyproject.toml +1 -1
- modal-1.1.2.dev10/modal/_utils/time_utils.py +0 -19
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/LICENSE +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/README.md +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/__main__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_clustered_functions.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_clustered_functions.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_container_entrypoint.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_functions.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_ipython.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_location.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_object.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_output.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_partial_function.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_pty.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_resolver.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_resources.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/asgi.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/execution_context.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/telemetry.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_serialization.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_traceback.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_tunnel.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_tunnel.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_type_manager.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/app_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/async_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/blob_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/deprecation.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/docker_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/function_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/git_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/hash_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/http_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/logger.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/mount_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/name_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/package_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_utils/shell_utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_vendor/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_vendor/tblib.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/_watcher.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/app.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/app.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/2023.12.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/2024.04.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/2024.10.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/2025.06.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/README.md +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/builder/base-images.json +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/call_graph.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/_download.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/_traceback.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/app.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/cluster.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/config.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/container.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/entry_point.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/environment.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/import_refs.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/launch.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/network_file_system.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/profile.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/programs/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/programs/vscode.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/run.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/token.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cli/utils.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/client.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cls.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/cls.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/config.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/container_process.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/container_process.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/environments.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/environments.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/exception.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/experimental/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/experimental/flash.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/experimental/flash.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/experimental/ipython.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/file_io.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/file_io.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/file_pattern_matcher.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/functions.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/gpu.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/image.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/image.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/io_streams.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/io_streams.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/mount.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/mount.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/network_file_system.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/network_file_system.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/object.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/object.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/output.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/parallel_map.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/parallel_map.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/partial_function.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/partial_function.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/proxy.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/proxy.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/py.typed +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/retries.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/runner.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/runner.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/running_app.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/sandbox.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/sandbox.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/schedule.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/scheduler_placement.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/serving.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/serving.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/snapshot.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/snapshot.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/stream_type.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/token_flow.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal/token_flow.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal.egg-info/top_level.txt +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_docs/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/__init__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/api_grpc.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/modal_options_grpc.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/options.proto +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/options_grpc.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/options_pb2.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/options_pb2.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/options_pb2_grpc.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/options_pb2_grpc.pyi +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_proto/py.typed +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/modal_version/__main__.py +0 -0
- {modal-1.1.2.dev10 → modal-1.1.2.dev12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: modal
|
3
|
-
Version: 1.1.2.
|
3
|
+
Version: 1.1.2.dev12
|
4
4
|
Summary: Python client library for Modal
|
5
5
|
Author-email: Modal Labs <support@modal.com>
|
6
6
|
License: Apache-2.0
|
@@ -22,7 +22,7 @@ Requires-Dist: click~=8.1
|
|
22
22
|
Requires-Dist: grpclib<0.4.9,>=0.4.7
|
23
23
|
Requires-Dist: protobuf!=4.24.0,<7.0,>=3.19
|
24
24
|
Requires-Dist: rich>=12.0.0
|
25
|
-
Requires-Dist: synchronicity~=0.10.
|
25
|
+
Requires-Dist: synchronicity~=0.10.2
|
26
26
|
Requires-Dist: toml
|
27
27
|
Requires-Dist: typer>=0.9
|
28
28
|
Requires-Dist: types-certifi
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Copyright Modal Labs 2025
|
2
|
+
from datetime import datetime, tzinfo
|
3
|
+
from typing import Optional, Union
|
4
|
+
|
5
|
+
|
6
|
+
def locale_tz() -> tzinfo:
|
7
|
+
return datetime.now().astimezone().tzinfo
|
8
|
+
|
9
|
+
|
10
|
+
def as_timestamp(arg: Optional[Union[datetime, str]]) -> float:
|
11
|
+
"""Coerce a user-provided argument to a timestamp.
|
12
|
+
|
13
|
+
An argument provided without timezone information will be treated as local time.
|
14
|
+
|
15
|
+
When the argument is null, returns the current time.
|
16
|
+
"""
|
17
|
+
if arg is None:
|
18
|
+
dt = datetime.now().astimezone()
|
19
|
+
elif isinstance(arg, str):
|
20
|
+
dt = datetime.fromisoformat(arg)
|
21
|
+
elif isinstance(arg, datetime):
|
22
|
+
dt = arg
|
23
|
+
else:
|
24
|
+
raise TypeError(f"Invalid argument: {arg}")
|
25
|
+
|
26
|
+
if dt.tzinfo is None:
|
27
|
+
dt = dt.replace(tzinfo=locale_tz())
|
28
|
+
return dt.timestamp()
|
29
|
+
|
30
|
+
|
31
|
+
def timestamp_to_localized_dt(ts: float) -> datetime:
|
32
|
+
return datetime.fromtimestamp(ts, tz=locale_tz())
|
33
|
+
|
34
|
+
|
35
|
+
def timestamp_to_localized_str(ts: float, isotz: bool = True) -> Optional[str]:
|
36
|
+
if ts > 0:
|
37
|
+
dt = timestamp_to_localized_dt(ts)
|
38
|
+
if isotz:
|
39
|
+
return dt.isoformat(sep=" ", timespec="seconds")
|
40
|
+
else:
|
41
|
+
return f"{dt:%Y-%m-%d %H:%M %Z}"
|
42
|
+
else:
|
43
|
+
return None
|
@@ -7,13 +7,11 @@ from typer import Argument, Option, Typer
|
|
7
7
|
from modal._output import make_console
|
8
8
|
from modal._resolver import Resolver
|
9
9
|
from modal._utils.async_utils import synchronizer
|
10
|
-
from modal._utils.grpc_utils import retry_transient_errors
|
11
10
|
from modal._utils.time_utils import timestamp_to_localized_str
|
12
11
|
from modal.cli.utils import ENV_OPTION, YES_OPTION, display_table
|
13
12
|
from modal.client import _Client
|
14
13
|
from modal.dict import _Dict
|
15
14
|
from modal.environments import ensure_env
|
16
|
-
from modal_proto import api_pb2
|
17
15
|
|
18
16
|
dict_cli = Typer(
|
19
17
|
name="dict",
|
@@ -40,12 +38,13 @@ async def create(name: str, *, env: Optional[str] = ENV_OPTION):
|
|
40
38
|
async def list_(*, json: bool = False, env: Optional[str] = ENV_OPTION):
|
41
39
|
"""List all named Dicts."""
|
42
40
|
env = ensure_env(env)
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
dicts = await _Dict.objects.list(environment_name=env)
|
42
|
+
rows = []
|
43
|
+
for obj in dicts:
|
44
|
+
info = await obj.info()
|
45
|
+
rows.append((info.name, timestamp_to_localized_str(info.created_at.timestamp(), json), info.created_by))
|
46
46
|
|
47
|
-
|
48
|
-
display_table(["Name", "Created at"], rows, json)
|
47
|
+
display_table(["Name", "Created at", "Created by"], rows, json)
|
49
48
|
|
50
49
|
|
51
50
|
@dict_cli.command("clear", rich_help_panel="Management")
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# Copyright Modal Labs 2024
|
2
|
+
from datetime import datetime
|
2
3
|
from typing import Optional
|
3
4
|
|
4
5
|
import typer
|
@@ -62,22 +63,46 @@ async def delete(name: str, *, yes: bool = YES_OPTION, env: Optional[str] = ENV_
|
|
62
63
|
async def list_(*, json: bool = False, env: Optional[str] = ENV_OPTION):
|
63
64
|
"""List all named Queues."""
|
64
65
|
env = ensure_env(env)
|
65
|
-
|
66
|
-
max_total_size = 100_000
|
67
66
|
client = await _Client.from_env()
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
67
|
+
max_total_size = 100_000 # Limit on the *Queue size* that we report
|
68
|
+
|
69
|
+
items: list[api_pb2.QueueListResponse.QueueInfo] = []
|
70
|
+
|
71
|
+
# Note that we need to continue using the gRPC API directly here rather than using Queue.objects.list.
|
72
|
+
# There is some metadata that historically appears in the CLI output (num_partitions, total_size) that
|
73
|
+
# doesn't make sense to transmit as hydration metadata, because the values can change over time and
|
74
|
+
# the metadata retrieved at hydration time could get stale. Alternatively, we could rewrite this using
|
75
|
+
# only public API by sequentially retrieving the queues and then querying their dynamic metadata, but
|
76
|
+
# that would require multiple round trips and would add lag to the CLI.
|
77
|
+
async def retrieve_page(created_before: float) -> bool:
|
78
|
+
max_page_size = 100
|
79
|
+
pagination = api_pb2.ListPagination(max_objects=max_page_size, created_before=created_before)
|
80
|
+
req = api_pb2.QueueListRequest(environment_name=env, pagination=pagination, total_size_limit=max_total_size)
|
81
|
+
resp = await retry_transient_errors(client.stub.QueueList, req)
|
82
|
+
items.extend(resp.queues)
|
83
|
+
return len(resp.queues) < max_page_size
|
84
|
+
|
85
|
+
finished = await retrieve_page(datetime.now().timestamp())
|
86
|
+
while True:
|
87
|
+
if finished:
|
88
|
+
break
|
89
|
+
finished = await retrieve_page(items[-1].metadata.creation_info.created_at)
|
90
|
+
|
91
|
+
queues = [_Queue._new_hydrated(item.queue_id, client, item.metadata, is_another_app=True) for item in items]
|
92
|
+
|
93
|
+
rows = []
|
94
|
+
for obj, resp_data in zip(queues, items):
|
95
|
+
info = await obj.info()
|
96
|
+
rows.append(
|
97
|
+
(
|
98
|
+
obj.name,
|
99
|
+
timestamp_to_localized_str(info.created_at.timestamp(), json),
|
100
|
+
info.created_by,
|
101
|
+
str(resp_data.num_partitions),
|
102
|
+
str(resp_data.total_size) if resp_data.total_size <= max_total_size else f">{max_total_size}",
|
103
|
+
)
|
77
104
|
)
|
78
|
-
|
79
|
-
]
|
80
|
-
display_table(["Name", "Created at", "Partitions", "Total size"], rows, json)
|
105
|
+
display_table(["Name", "Created at", "Created by", "Partitions", "Total size"], rows, json)
|
81
106
|
|
82
107
|
|
83
108
|
@queue_cli.command(name="clear", rich_help_panel="Management")
|
@@ -119,7 +144,7 @@ async def peek(
|
|
119
144
|
|
120
145
|
@queue_cli.command(name="len", rich_help_panel="Inspection")
|
121
146
|
@synchronizer.create_blocking
|
122
|
-
async def
|
147
|
+
async def len_(
|
123
148
|
name: str,
|
124
149
|
partition: Optional[str] = PARTITION_OPTION,
|
125
150
|
total: bool = Option(False, "-t", "--total", help="Compute the sum of the queue lengths across all partitions"),
|
@@ -3,6 +3,7 @@ import json
|
|
3
3
|
import os
|
4
4
|
import platform
|
5
5
|
import subprocess
|
6
|
+
from datetime import datetime
|
6
7
|
from pathlib import Path
|
7
8
|
from tempfile import NamedTemporaryFile
|
8
9
|
from typing import Optional
|
@@ -30,20 +31,45 @@ secret_cli = typer.Typer(name="secret", help="Manage secrets.", no_args_is_help=
|
|
30
31
|
async def list_(env: Optional[str] = ENV_OPTION, json: bool = False):
|
31
32
|
env = ensure_env(env)
|
32
33
|
client = await _Client.from_env()
|
33
|
-
response = await retry_transient_errors(client.stub.SecretList, api_pb2.SecretListRequest(environment_name=env))
|
34
|
-
column_names = ["Name", "Created at", "Last used at"]
|
35
|
-
rows = []
|
36
34
|
|
37
|
-
|
35
|
+
items: list[api_pb2.SecretListItem] = []
|
36
|
+
|
37
|
+
# Note that we need to continue using the gRPC API directly here rather than using Secret.objects.list.
|
38
|
+
# There is some metadata that historically appears in the CLI output (last_used_at) that
|
39
|
+
# doesn't make sense to transmit as hydration metadata, because the value can change over time and
|
40
|
+
# the metadata retrieved at hydration time could get stale. Alternatively, we could rewrite this using
|
41
|
+
# only public API by sequentially retrieving the secrets and then querying their dynamic metadata, but
|
42
|
+
# that would require multiple round trips and would add lag to the CLI.
|
43
|
+
async def retrieve_page(created_before: float) -> bool:
|
44
|
+
max_page_size = 100
|
45
|
+
pagination = api_pb2.ListPagination(max_objects=max_page_size, created_before=created_before)
|
46
|
+
req = api_pb2.SecretListRequest(environment_name=env, pagination=pagination)
|
47
|
+
resp = await retry_transient_errors(client.stub.SecretList, req)
|
48
|
+
items.extend(resp.items)
|
49
|
+
return len(resp.items) < max_page_size
|
50
|
+
|
51
|
+
finished = await retrieve_page(datetime.now().timestamp())
|
52
|
+
while True:
|
53
|
+
if finished:
|
54
|
+
break
|
55
|
+
finished = await retrieve_page(items[-1].metadata.creation_info.created_at)
|
56
|
+
|
57
|
+
secrets = [_Secret._new_hydrated(item.secret_id, client, item.metadata, is_another_app=True) for item in items]
|
58
|
+
|
59
|
+
rows = []
|
60
|
+
for obj, resp_data in zip(secrets, items):
|
61
|
+
info = await obj.info()
|
38
62
|
rows.append(
|
39
63
|
[
|
40
|
-
|
41
|
-
timestamp_to_localized_str(
|
42
|
-
|
64
|
+
obj.name,
|
65
|
+
timestamp_to_localized_str(info.created_at.timestamp(), json),
|
66
|
+
info.created_by,
|
67
|
+
timestamp_to_localized_str(resp_data.last_used_at, json) if resp_data.last_used_at else "-",
|
43
68
|
]
|
44
69
|
)
|
45
70
|
|
46
71
|
env_part = f" in environment '{env}'" if env else ""
|
72
|
+
column_names = ["Name", "Created at", "Created by", "Last used at"]
|
47
73
|
display_table(column_names, rows, json, title=f"Secrets{env_part}")
|
48
74
|
|
49
75
|
|
@@ -13,11 +13,9 @@ from typer import Argument, Option, Typer
|
|
13
13
|
import modal
|
14
14
|
from modal._output import OutputManager, ProgressHandler, make_console
|
15
15
|
from modal._utils.async_utils import synchronizer
|
16
|
-
from modal._utils.grpc_utils import retry_transient_errors
|
17
16
|
from modal._utils.time_utils import timestamp_to_localized_str
|
18
17
|
from modal.cli._download import _volume_download
|
19
18
|
from modal.cli.utils import ENV_OPTION, YES_OPTION, display_table
|
20
|
-
from modal.client import _Client
|
21
19
|
from modal.environments import ensure_env
|
22
20
|
from modal.volume import _AbstractVolumeUploadContextManager, _Volume
|
23
21
|
from modal_proto import api_pb2
|
@@ -110,14 +108,13 @@ async def get(
|
|
110
108
|
@synchronizer.create_blocking
|
111
109
|
async def list_(env: Optional[str] = ENV_OPTION, json: Optional[bool] = False):
|
112
110
|
env = ensure_env(env)
|
113
|
-
|
114
|
-
response = await retry_transient_errors(client.stub.VolumeList, api_pb2.VolumeListRequest(environment_name=env))
|
115
|
-
env_part = f" in environment '{env}'" if env else ""
|
116
|
-
column_names = ["Name", "Created at"]
|
111
|
+
volumes = await _Volume.objects.list(environment_name=env)
|
117
112
|
rows = []
|
118
|
-
for
|
119
|
-
|
120
|
-
|
113
|
+
for obj in volumes:
|
114
|
+
info = await obj.info()
|
115
|
+
rows.append((info.name, timestamp_to_localized_str(info.created_at.timestamp(), json), info.created_by))
|
116
|
+
|
117
|
+
display_table(["Name", "Created at", "Created by"], rows, json)
|
121
118
|
|
122
119
|
|
123
120
|
@volume_cli.command(
|
@@ -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.2.
|
36
|
+
version: str = "1.1.2.dev12",
|
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.2.
|
167
|
+
version: str = "1.1.2.dev12",
|
168
168
|
):
|
169
169
|
"""mdmd:hidden
|
170
170
|
The Modal client object is not intended to be instantiated directly by users.
|
@@ -2,25 +2,32 @@
|
|
2
2
|
from collections.abc import AsyncIterator, Mapping
|
3
3
|
from dataclasses import dataclass
|
4
4
|
from datetime import datetime
|
5
|
-
from typing import Any, Optional
|
5
|
+
from typing import Any, Optional, Union
|
6
6
|
|
7
7
|
from google.protobuf.message import Message
|
8
8
|
from grpclib import GRPCError
|
9
|
+
from synchronicity import classproperty
|
9
10
|
from synchronicity.async_wrap import asynccontextmanager
|
10
11
|
|
11
12
|
from modal_proto import api_pb2
|
12
13
|
|
13
|
-
from ._object import
|
14
|
+
from ._object import (
|
15
|
+
EPHEMERAL_OBJECT_HEARTBEAT_SLEEP,
|
16
|
+
_get_environment_name,
|
17
|
+
_Object,
|
18
|
+
live_method,
|
19
|
+
live_method_gen,
|
20
|
+
)
|
14
21
|
from ._resolver import Resolver
|
15
22
|
from ._serialization import deserialize, serialize
|
16
23
|
from ._utils.async_utils import TaskContext, synchronize_api
|
17
24
|
from ._utils.deprecation import deprecation_warning, warn_if_passing_namespace
|
18
25
|
from ._utils.grpc_utils import retry_transient_errors
|
19
26
|
from ._utils.name_utils import check_object_name
|
20
|
-
from ._utils.time_utils import timestamp_to_localized_dt
|
27
|
+
from ._utils.time_utils import as_timestamp, timestamp_to_localized_dt
|
21
28
|
from .client import _Client
|
22
29
|
from .config import logger
|
23
|
-
from .exception import RequestSizeError
|
30
|
+
from .exception import InvalidError, RequestSizeError
|
24
31
|
|
25
32
|
|
26
33
|
def _serialize_dict(data):
|
@@ -29,7 +36,7 @@ def _serialize_dict(data):
|
|
29
36
|
|
30
37
|
@dataclass
|
31
38
|
class DictInfo:
|
32
|
-
"""Information about
|
39
|
+
"""Information about a Dict object."""
|
33
40
|
|
34
41
|
# This dataclass should be limited to information that is unchanging over the lifetime of the Dict,
|
35
42
|
# since it is transmitted from the server when the object is hydrated and could be stale when accessed.
|
@@ -39,6 +46,68 @@ class DictInfo:
|
|
39
46
|
created_by: Optional[str]
|
40
47
|
|
41
48
|
|
49
|
+
class _DictManager:
|
50
|
+
"""Namespace with methods for managing named Dict objects."""
|
51
|
+
|
52
|
+
@staticmethod
|
53
|
+
async def list(
|
54
|
+
*,
|
55
|
+
max_objects: Optional[int] = None, # Limit results to this size
|
56
|
+
created_before: Optional[Union[datetime, str]] = None, # Limit based on creation date
|
57
|
+
environment_name: str = "", # Uses active environment if not specified
|
58
|
+
client: Optional[_Client] = None, # Optional client with Modal credentials
|
59
|
+
) -> list["_Dict"]:
|
60
|
+
"""Return a list of hydrated Dict objects.
|
61
|
+
|
62
|
+
**Examples:**
|
63
|
+
|
64
|
+
```python
|
65
|
+
dicts = modal.Dict.objects.list()
|
66
|
+
print([d.name for d in dicts])
|
67
|
+
```
|
68
|
+
|
69
|
+
Dicts will be retreived from the active environment, or another one can be specified:
|
70
|
+
|
71
|
+
```python notest
|
72
|
+
dev_dicts = modal.Dict.objects.list(environment_name="dev")
|
73
|
+
```
|
74
|
+
|
75
|
+
By default, all named Dict are returned, newest to oldest. It's also possible to limit the
|
76
|
+
number of results and to filter by creation date:
|
77
|
+
|
78
|
+
```python
|
79
|
+
dicts = modal.Dict.objects.list(max_objects=10, created_before="2025-01-01")
|
80
|
+
```
|
81
|
+
|
82
|
+
"""
|
83
|
+
client = await _Client.from_env() if client is None else client
|
84
|
+
if max_objects is not None and max_objects < 0:
|
85
|
+
raise InvalidError("max_objects cannot be negative")
|
86
|
+
|
87
|
+
items: list[api_pb2.DictListResponse.DictInfo] = []
|
88
|
+
|
89
|
+
async def retrieve_page(created_before: float) -> bool:
|
90
|
+
max_page_size = 100 if max_objects is None else min(100, max_objects - len(items))
|
91
|
+
pagination = api_pb2.ListPagination(max_objects=max_page_size, created_before=created_before)
|
92
|
+
req = api_pb2.DictListRequest(environment_name=environment_name, pagination=pagination)
|
93
|
+
resp = await retry_transient_errors(client.stub.DictList, req)
|
94
|
+
items.extend(resp.dicts)
|
95
|
+
finished = (len(resp.dicts) < max_page_size) or (max_objects is not None and len(items) >= max_objects)
|
96
|
+
return finished
|
97
|
+
|
98
|
+
finished = await retrieve_page(as_timestamp(created_before))
|
99
|
+
while True:
|
100
|
+
if finished:
|
101
|
+
break
|
102
|
+
finished = await retrieve_page(items[-1].metadata.creation_info.created_at)
|
103
|
+
|
104
|
+
dicts = [_Dict._new_hydrated(item.dict_id, client, item.metadata, is_another_app=True) for item in items]
|
105
|
+
return dicts[:max_objects] if max_objects is not None else dicts
|
106
|
+
|
107
|
+
|
108
|
+
DictManager = synchronize_api(_DictManager)
|
109
|
+
|
110
|
+
|
42
111
|
class _Dict(_Object, type_prefix="di"):
|
43
112
|
"""Distributed dictionary for storage in Modal apps.
|
44
113
|
|
@@ -90,6 +159,10 @@ class _Dict(_Object, type_prefix="di"):
|
|
90
159
|
"`Dict(...)` constructor is not allowed. Please use `Dict.from_name` or `Dict.ephemeral` instead"
|
91
160
|
)
|
92
161
|
|
162
|
+
@classproperty
|
163
|
+
def objects(cls) -> _DictManager:
|
164
|
+
return _DictManager
|
165
|
+
|
93
166
|
@property
|
94
167
|
def name(self) -> Optional[str]:
|
95
168
|
return self._name
|
@@ -5,6 +5,7 @@ import modal._object
|
|
5
5
|
import modal.client
|
6
6
|
import modal.object
|
7
7
|
import modal_proto.api_pb2
|
8
|
+
import synchronicity
|
8
9
|
import synchronicity.combined_types
|
9
10
|
import typing
|
10
11
|
import typing_extensions
|
@@ -12,7 +13,7 @@ import typing_extensions
|
|
12
13
|
def _serialize_dict(data): ...
|
13
14
|
|
14
15
|
class DictInfo:
|
15
|
-
"""Information about
|
16
|
+
"""Information about a Dict object."""
|
16
17
|
|
17
18
|
name: typing.Optional[str]
|
18
19
|
created_at: datetime.datetime
|
@@ -32,6 +33,115 @@ class DictInfo:
|
|
32
33
|
"""Return self==value."""
|
33
34
|
...
|
34
35
|
|
36
|
+
class _DictManager:
|
37
|
+
"""Namespace with methods for managing named Dict objects."""
|
38
|
+
@staticmethod
|
39
|
+
async def list(
|
40
|
+
*,
|
41
|
+
max_objects: typing.Optional[int] = None,
|
42
|
+
created_before: typing.Union[datetime.datetime, str, None] = None,
|
43
|
+
environment_name: str = "",
|
44
|
+
client: typing.Optional[modal.client._Client] = None,
|
45
|
+
) -> list[_Dict]:
|
46
|
+
"""Return a list of hydrated Dict objects.
|
47
|
+
|
48
|
+
**Examples:**
|
49
|
+
|
50
|
+
```python
|
51
|
+
dicts = modal.Dict.objects.list()
|
52
|
+
print([d.name for d in dicts])
|
53
|
+
```
|
54
|
+
|
55
|
+
Dicts will be retreived from the active environment, or another one can be specified:
|
56
|
+
|
57
|
+
```python notest
|
58
|
+
dev_dicts = modal.Dict.objects.list(environment_name="dev")
|
59
|
+
```
|
60
|
+
|
61
|
+
By default, all named Dict are returned, newest to oldest. It's also possible to limit the
|
62
|
+
number of results and to filter by creation date:
|
63
|
+
|
64
|
+
```python
|
65
|
+
dicts = modal.Dict.objects.list(max_objects=10, created_before="2025-01-01")
|
66
|
+
```
|
67
|
+
"""
|
68
|
+
...
|
69
|
+
|
70
|
+
class DictManager:
|
71
|
+
"""Namespace with methods for managing named Dict objects."""
|
72
|
+
def __init__(self, /, *args, **kwargs):
|
73
|
+
"""Initialize self. See help(type(self)) for accurate signature."""
|
74
|
+
...
|
75
|
+
|
76
|
+
class __list_spec(typing_extensions.Protocol):
|
77
|
+
def __call__(
|
78
|
+
self,
|
79
|
+
/,
|
80
|
+
*,
|
81
|
+
max_objects: typing.Optional[int] = None,
|
82
|
+
created_before: typing.Union[datetime.datetime, str, None] = None,
|
83
|
+
environment_name: str = "",
|
84
|
+
client: typing.Optional[modal.client.Client] = None,
|
85
|
+
) -> list[Dict]:
|
86
|
+
"""Return a list of hydrated Dict objects.
|
87
|
+
|
88
|
+
**Examples:**
|
89
|
+
|
90
|
+
```python
|
91
|
+
dicts = modal.Dict.objects.list()
|
92
|
+
print([d.name for d in dicts])
|
93
|
+
```
|
94
|
+
|
95
|
+
Dicts will be retreived from the active environment, or another one can be specified:
|
96
|
+
|
97
|
+
```python notest
|
98
|
+
dev_dicts = modal.Dict.objects.list(environment_name="dev")
|
99
|
+
```
|
100
|
+
|
101
|
+
By default, all named Dict are returned, newest to oldest. It's also possible to limit the
|
102
|
+
number of results and to filter by creation date:
|
103
|
+
|
104
|
+
```python
|
105
|
+
dicts = modal.Dict.objects.list(max_objects=10, created_before="2025-01-01")
|
106
|
+
```
|
107
|
+
"""
|
108
|
+
...
|
109
|
+
|
110
|
+
async def aio(
|
111
|
+
self,
|
112
|
+
/,
|
113
|
+
*,
|
114
|
+
max_objects: typing.Optional[int] = None,
|
115
|
+
created_before: typing.Union[datetime.datetime, str, None] = None,
|
116
|
+
environment_name: str = "",
|
117
|
+
client: typing.Optional[modal.client.Client] = None,
|
118
|
+
) -> list[Dict]:
|
119
|
+
"""Return a list of hydrated Dict objects.
|
120
|
+
|
121
|
+
**Examples:**
|
122
|
+
|
123
|
+
```python
|
124
|
+
dicts = modal.Dict.objects.list()
|
125
|
+
print([d.name for d in dicts])
|
126
|
+
```
|
127
|
+
|
128
|
+
Dicts will be retreived from the active environment, or another one can be specified:
|
129
|
+
|
130
|
+
```python notest
|
131
|
+
dev_dicts = modal.Dict.objects.list(environment_name="dev")
|
132
|
+
```
|
133
|
+
|
134
|
+
By default, all named Dict are returned, newest to oldest. It's also possible to limit the
|
135
|
+
number of results and to filter by creation date:
|
136
|
+
|
137
|
+
```python
|
138
|
+
dicts = modal.Dict.objects.list(max_objects=10, created_before="2025-01-01")
|
139
|
+
```
|
140
|
+
"""
|
141
|
+
...
|
142
|
+
|
143
|
+
list: __list_spec
|
144
|
+
|
35
145
|
class _Dict(modal._object._Object):
|
36
146
|
"""Distributed dictionary for storage in Modal apps.
|
37
147
|
|
@@ -81,6 +191,8 @@ class _Dict(modal._object._Object):
|
|
81
191
|
"""mdmd:hidden"""
|
82
192
|
...
|
83
193
|
|
194
|
+
@synchronicity.classproperty
|
195
|
+
def objects(cls) -> _DictManager: ...
|
84
196
|
@property
|
85
197
|
def name(self) -> typing.Optional[str]: ...
|
86
198
|
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
@@ -308,6 +420,8 @@ class Dict(modal.object.Object):
|
|
308
420
|
"""mdmd:hidden"""
|
309
421
|
...
|
310
422
|
|
423
|
+
@synchronicity.classproperty
|
424
|
+
def objects(cls) -> DictManager: ...
|
311
425
|
@property
|
312
426
|
def name(self) -> typing.Optional[str]: ...
|
313
427
|
def _hydrate_metadata(self, metadata: typing.Optional[google.protobuf.message.Message]): ...
|
@@ -433,7 +433,7 @@ class Function(
|
|
433
433
|
|
434
434
|
_call_generator: ___call_generator_spec[typing_extensions.Self]
|
435
435
|
|
436
|
-
class __remote_spec(typing_extensions.Protocol[
|
436
|
+
class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
437
437
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
|
438
438
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
439
439
|
...
|
@@ -442,7 +442,7 @@ class Function(
|
|
442
442
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
443
443
|
...
|
444
444
|
|
445
|
-
remote: __remote_spec[modal._functions.
|
445
|
+
remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
446
446
|
|
447
447
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
448
448
|
def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
@@ -469,7 +469,7 @@ class Function(
|
|
469
469
|
"""
|
470
470
|
...
|
471
471
|
|
472
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
472
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
473
473
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
474
474
|
"""[Experimental] Calls the function with the given arguments, without waiting for the results.
|
475
475
|
|
@@ -493,7 +493,7 @@ class Function(
|
|
493
493
|
...
|
494
494
|
|
495
495
|
_experimental_spawn: ___experimental_spawn_spec[
|
496
|
-
modal._functions.
|
496
|
+
modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
|
497
497
|
]
|
498
498
|
|
499
499
|
class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
|
@@ -502,7 +502,7 @@ class Function(
|
|
502
502
|
|
503
503
|
_spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
|
504
504
|
|
505
|
-
class __spawn_spec(typing_extensions.Protocol[
|
505
|
+
class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
506
506
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
507
507
|
"""Calls the function with the given arguments, without waiting for the results.
|
508
508
|
|
@@ -523,7 +523,7 @@ class Function(
|
|
523
523
|
"""
|
524
524
|
...
|
525
525
|
|
526
|
-
spawn: __spawn_spec[modal._functions.
|
526
|
+
spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
527
527
|
|
528
528
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
|
529
529
|
"""Return the inner Python object wrapped by this Modal Function."""
|