modal 0.72.36__py3-none-any.whl → 0.72.38__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/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.72.36"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.38"
31
31
  ): ...
32
32
  def is_closed(self) -> bool: ...
33
33
  @property
@@ -83,7 +83,7 @@ class Client:
83
83
  _snapshotted: bool
84
84
 
85
85
  def __init__(
86
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.36"
86
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.38"
87
87
  ): ...
88
88
  def is_closed(self) -> bool: ...
89
89
  @property
modal/experimental.py CHANGED
@@ -1,16 +1,16 @@
1
1
  # Copyright Modal Labs 2022
2
- from typing import (
3
- Any,
4
- Callable,
5
- )
2
+ from dataclasses import dataclass
3
+ from typing import Any, Callable, Optional
6
4
 
7
- import modal._clustered_functions
8
- from modal.functions import _Function
5
+ from modal_proto import api_pb2
9
6
 
7
+ from ._clustered_functions import ClusterInfo, get_cluster_info as _get_cluster_info
8
+ from ._object import _get_environment_name
10
9
  from ._runtime.container_io_manager import _ContainerIOManager
11
- from .exception import (
12
- InvalidError,
13
- )
10
+ from ._utils.async_utils import synchronizer
11
+ from .client import _Client
12
+ from .exception import InvalidError
13
+ from .functions import _Function
14
14
  from .partial_function import _PartialFunction, _PartialFunctionFlags
15
15
 
16
16
 
@@ -65,5 +65,41 @@ def clustered(size: int, broadcast: bool = True):
65
65
  return wrapper
66
66
 
67
67
 
68
- def get_cluster_info() -> modal._clustered_functions.ClusterInfo:
69
- return modal._clustered_functions.get_cluster_info()
68
+ def get_cluster_info() -> ClusterInfo:
69
+ return _get_cluster_info()
70
+
71
+
72
+ @dataclass
73
+ class AppInfo:
74
+ app_id: str
75
+ name: str
76
+ containers: int
77
+
78
+
79
+ @synchronizer.create_blocking
80
+ async def list_deployed_apps(environment_name: str = "", client: Optional[_Client] = None) -> list[AppInfo]:
81
+ """List deployed Apps along with the number of containers currently running."""
82
+ # This function exists to provide backwards compatibility for some users who had been
83
+ # calling into the private function that previously backed the `modal app list` CLI command.
84
+ # We plan to add more Python API for exposing this sort of information, but we haven't
85
+ # settled on a design we're happy with yet. In the meantime, this function will continue
86
+ # to support existing codebases. It's likely that the final API will be different
87
+ # (e.g. more oriented around the App object). This function should be gracefully deprecated
88
+ # one the new API is released.
89
+ client = client or await _Client.from_env()
90
+
91
+ resp: api_pb2.AppListResponse = await client.stub.AppList(
92
+ api_pb2.AppListRequest(environment_name=_get_environment_name(environment_name))
93
+ )
94
+
95
+ app_infos = []
96
+ for app_stats in resp.apps:
97
+ if app_stats.state == api_pb2.APP_STATE_DEPLOYED:
98
+ app_infos.append(
99
+ AppInfo(
100
+ app_id=app_stats.app_id,
101
+ name=app_stats.description,
102
+ containers=app_stats.n_running_tasks,
103
+ )
104
+ )
105
+ return app_infos
modal/experimental.pyi ADDED
@@ -0,0 +1,29 @@
1
+ import modal._clustered_functions
2
+ import modal.client
3
+ import typing
4
+ import typing_extensions
5
+
6
+ def stop_fetching_inputs(): ...
7
+ def get_local_input_concurrency(): ...
8
+ def set_local_input_concurrency(concurrency: int): ...
9
+ def clustered(size: int, broadcast: bool = True): ...
10
+ def get_cluster_info() -> modal._clustered_functions.ClusterInfo: ...
11
+
12
+ class AppInfo:
13
+ app_id: str
14
+ name: str
15
+ containers: int
16
+
17
+ def __init__(self, app_id: str, name: str, containers: int) -> None: ...
18
+ def __repr__(self): ...
19
+ def __eq__(self, other): ...
20
+
21
+ class __list_deployed_apps_spec(typing_extensions.Protocol):
22
+ def __call__(
23
+ self, environment_name: str = "", client: typing.Optional[modal.client.Client] = None
24
+ ) -> list[AppInfo]: ...
25
+ async def aio(
26
+ self, environment_name: str = "", client: typing.Optional[modal.client.Client] = None
27
+ ) -> list[AppInfo]: ...
28
+
29
+ list_deployed_apps: __list_deployed_apps_spec
modal/partial_function.py CHANGED
@@ -560,6 +560,7 @@ def _build(
560
560
  "The `@modal.build` decorator is deprecated and will be removed in a future release."
561
561
  "\n\nWe now recommend storing large assets (such as model weights) using a `modal.Volume`"
562
562
  " instead of writing them directly into the `modal.Image` filesystem."
563
+ " For other use cases we recommend using `Image.run_function` instead."
563
564
  "\n\nSee https://modal.com/docs/guide/modal-1-0-migration for more information.",
564
565
  )
565
566
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.72.36
3
+ Version: 0.72.38
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -20,7 +20,7 @@ modal/app.py,sha256=UOuqlCKlFAjOXCacXmoEMM90FnqFwPRXUhLh0Gi6xzg,45344
20
20
  modal/app.pyi,sha256=5D3LkPP6qvTIl2_YgiyhNQ9X4VsOVuxd69a23UmohDg,25477
21
21
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
22
22
  modal/client.py,sha256=8SQawr7P1PNUCq1UmJMUQXG2jIo4Nmdcs311XqrNLRE,15276
23
- modal/client.pyi,sha256=6X3cs5TRTn1yKyl5IPh2O7Tqkk_F6fJIOTw6f7Cb2JQ,7326
23
+ modal/client.pyi,sha256=-IxKSDLJNw_CwlYYSQ2aBdUaz3KMCqj9mWQKQWRwfZc,7326
24
24
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
25
25
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
26
26
  modal/cls.py,sha256=xHgZZAmymplw0I2YZGAA8raBboixdNKKTrnsxQZI7G8,32159
@@ -33,7 +33,8 @@ modal/dict.pyi,sha256=VM3dmNqQzV1piZbRncXDqkpiKpmVracmuZB_VXRkrTw,7137
33
33
  modal/environments.py,sha256=20doFhRnm1fae30LMOp8hSYbIfR7yFZTtbLdo5PrSj4,6661
34
34
  modal/environments.pyi,sha256=RXE3slyEr9tWpfS84Fj7iUzNJy-SujlqWOQTE8A4Qaw,3537
35
35
  modal/exception.py,sha256=4JyO-SACaLNDe2QC48EjsK8GMkZ8AgEurZ8j1YdRu8E,5263
36
- modal/experimental.py,sha256=npfKbyMpI41uZZs9HW_QiB3E4ykWfDXZbACXXbw6qeA,2385
36
+ modal/experimental.py,sha256=H9FXT3kshbjPLovshT10DicyOkGFrPqILy-qdTX-P7s,4015
37
+ modal/experimental.pyi,sha256=24tIYu_w9RLwFrz1cIsgYuqmDCtV8eg6-bQNz3zjhDo,939
37
38
  modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
38
39
  modal/file_io.pyi,sha256=NrIoB0YjIqZ8MDMe826xAnybT0ww_kxQM3iPLo82REU,8898
39
40
  modal/file_pattern_matcher.py,sha256=dSo7BMQGZBAuoBFOX-e_72HxmF3FLzjQlEtnGtJiaD4,6506
@@ -53,7 +54,7 @@ modal/object.pyi,sha256=xjTAMYjMm1t5SeFGHlHdyTiKKzoeg03NglufpY7tg5k,5116
53
54
  modal/output.py,sha256=N0xf4qeudEaYrslzdAl35VKV8rapstgIM2e9wO8_iy0,1967
54
55
  modal/parallel_map.py,sha256=POBTyiWabe2e4qBNlsjjksiu1AAPEsNqI-mM8cgNFco,16042
55
56
  modal/parallel_map.pyi,sha256=pOhT0P3DDYlwLx0fR3PTsecA7DI8uOdXC1N8i-ZkyOY,2328
56
- modal/partial_function.py,sha256=PjsbsQ11lcLFy69qYXzRzM3FkX6DcPh9aoUYm7nLP6U,28295
57
+ modal/partial_function.py,sha256=q93tHLpHhDYJK3Ok4dhrUOtHMoiPCwTtLyytr5I3wOM,28375
57
58
  modal/partial_function.pyi,sha256=osYgJWVKmtz_noJ8OzBjcp7oH46PuIpURD_M7B2tXPs,9388
58
59
  modal/proxy.py,sha256=NrOevrWxG3G7-zlyRzG6BcIvop7AWLeyahZxitbBaOk,1418
59
60
  modal/proxy.pyi,sha256=1OEKIVUyC-xb7fHMzngakQso0nTsK60TVhXtlcMj6Wk,390
@@ -166,10 +167,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
166
167
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
168
  modal_version/__init__.py,sha256=kGya2ZlItX2zB7oHORs-wvP4PG8lg_mtbi1QIK3G6SQ,470
168
169
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
169
- modal_version/_version_generated.py,sha256=_-XkotRkA8vwh-9aU2yqrQqZ-npHVab30PojNeEQ6Ko,149
170
- modal-0.72.36.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
171
- modal-0.72.36.dist-info/METADATA,sha256=5yAsDaawujE-MJ84Qy-ju9383RWwNKd0NMFe7Q57lnY,2329
172
- modal-0.72.36.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
173
- modal-0.72.36.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
174
- modal-0.72.36.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
175
- modal-0.72.36.dist-info/RECORD,,
170
+ modal_version/_version_generated.py,sha256=lPmJCRJTMN0LjCzOU5_TT6R6Y-jUfuzVwQAcYcat4oc,149
171
+ modal-0.72.38.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
172
+ modal-0.72.38.dist-info/METADATA,sha256=uAZq5pPvU7M2M9CldaO-j_TttBrtHw_QlLIlOKPTBRc,2329
173
+ modal-0.72.38.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
174
+ modal-0.72.38.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
175
+ modal-0.72.38.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
176
+ modal-0.72.38.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 36 # git: 136a620
4
+ build_number = 38 # git: deb5258