modal 0.74.59__py3-none-any.whl → 0.74.61__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.74.59"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.61"
31
31
  ): ...
32
32
  def is_closed(self) -> bool: ...
33
33
  @property
@@ -86,7 +86,7 @@ class Client:
86
86
  _snapshotted: bool
87
87
 
88
88
  def __init__(
89
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.59"
89
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.74.61"
90
90
  ): ...
91
91
  def is_closed(self) -> bool: ...
92
92
  @property
modal/dict.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # Copyright Modal Labs 2022
2
- from collections.abc import AsyncIterator
2
+ from collections.abc import AsyncIterator, Mapping
3
3
  from typing import Any, Optional
4
4
 
5
5
  from grpclib import GRPCError
@@ -73,7 +73,7 @@ class _Dict(_Object, type_prefix="di"):
73
73
  @asynccontextmanager
74
74
  async def ephemeral(
75
75
  cls: type["_Dict"],
76
- data: Optional[dict] = None,
76
+ data: Optional[dict] = None, # DEPRECATED
77
77
  client: Optional[_Client] = None,
78
78
  environment_name: Optional[str] = None,
79
79
  _heartbeat_sleep: float = EPHEMERAL_OBJECT_HEARTBEAT_SLEEP,
@@ -95,6 +95,11 @@ class _Dict(_Object, type_prefix="di"):
95
95
  """
96
96
  if client is None:
97
97
  client = await _Client.from_env()
98
+ if data:
99
+ deprecation_warning(
100
+ (2025, 5, 6),
101
+ "Passing data to `modal.Dict.ephemeral` is deprecated and will stop working in a future release.",
102
+ )
98
103
  serialized = _serialize_dict(data if data is not None else {})
99
104
  request = api_pb2.DictGetOrCreateRequest(
100
105
  object_creation_type=api_pb2.OBJECT_CREATION_TYPE_EPHEMERAL,
@@ -111,7 +116,7 @@ class _Dict(_Object, type_prefix="di"):
111
116
  @renamed_parameter((2024, 12, 18), "label", "name")
112
117
  def from_name(
113
118
  name: str,
114
- data: Optional[dict] = None,
119
+ data: Optional[dict] = None, # DEPRECATED
115
120
  *,
116
121
  namespace=api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
117
122
  environment_name: Optional[str] = None,
@@ -130,6 +135,12 @@ class _Dict(_Object, type_prefix="di"):
130
135
  """
131
136
  check_object_name(name, "Dict")
132
137
 
138
+ if data:
139
+ deprecation_warning(
140
+ (2025, 5, 6),
141
+ "Passing data to `modal.Dict.from_name` is deprecated and will stop working in a future release.",
142
+ )
143
+
133
144
  async def _load(self: _Dict, resolver: Resolver, existing_object_id: Optional[str]):
134
145
  serialized = _serialize_dict(data if data is not None else {})
135
146
  req = api_pb2.DictGetOrCreateRequest(
@@ -244,9 +255,16 @@ class _Dict(_Object, type_prefix="di"):
244
255
  return value
245
256
 
246
257
  @live_method
247
- async def update(self, **kwargs) -> None:
258
+ async def update(self, other: Optional[Mapping] = None, /, **kwargs) -> None:
248
259
  """Update the dictionary with additional items."""
249
- serialized = _serialize_dict(kwargs)
260
+ # Support the Python dict.update API
261
+ # https://docs.python.org/3/library/stdtypes.html#dict.update
262
+ contents = {}
263
+ if other:
264
+ contents.update({k: other[k] for k in other.keys()})
265
+ if kwargs:
266
+ contents.update(kwargs)
267
+ serialized = _serialize_dict(contents)
250
268
  req = api_pb2.DictUpdateRequest(dict_id=self.object_id, updates=serialized)
251
269
  try:
252
270
  await retry_transient_errors(self._client.stub.DictUpdate, req)
modal/dict.pyi CHANGED
@@ -48,7 +48,7 @@ class _Dict(modal._object._Object):
48
48
  async def contains(self, key: typing.Any) -> bool: ...
49
49
  async def len(self) -> int: ...
50
50
  async def __getitem__(self, key: typing.Any) -> typing.Any: ...
51
- async def update(self, **kwargs) -> None: ...
51
+ async def update(self, other: typing.Optional[collections.abc.Mapping] = None, /, **kwargs) -> None: ...
52
52
  async def put(self, key: typing.Any, value: typing.Any) -> None: ...
53
53
  async def __setitem__(self, key: typing.Any, value: typing.Any) -> None: ...
54
54
  async def pop(self, key: typing.Any) -> typing.Any: ...
@@ -155,8 +155,8 @@ class Dict(modal.object.Object):
155
155
  __getitem__: ____getitem___spec[typing_extensions.Self]
156
156
 
157
157
  class __update_spec(typing_extensions.Protocol[SUPERSELF]):
158
- def __call__(self, /, **kwargs) -> None: ...
159
- async def aio(self, /, **kwargs) -> None: ...
158
+ def __call__(self, other: typing.Optional[collections.abc.Mapping] = None, /, **kwargs) -> None: ...
159
+ async def aio(self, other: typing.Optional[collections.abc.Mapping] = None, /, **kwargs) -> None: ...
160
160
 
161
161
  update: __update_spec[typing_extensions.Self]
162
162
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 0.74.59
3
+ Version: 0.74.61
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.0
22
22
  Requires-Dist: grpclib==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.9.10
25
+ Requires-Dist: synchronicity~=0.9.12
26
26
  Requires-Dist: toml
27
27
  Requires-Dist: typer>=0.9
28
28
  Requires-Dist: types-certifi
@@ -22,7 +22,7 @@ modal/app.py,sha256=xojuGZv4LaQwZU5ntj7WbmMjeNuB9Gll8Mzqe2LyiEs,51323
22
22
  modal/app.pyi,sha256=zNwR1_2LpmQc9AhemuAeVdk90XNYDw9keOkXAwAATeA,28732
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=o-aQThHpvDHUzg_kUafyhWzACViUBhY2WLZ2EitnSHA,16787
25
- modal/client.pyi,sha256=DHS5JgIcHrXAE9ADaeYMxYw_IcuSVQbDo8oaRZly784,8385
25
+ modal/client.pyi,sha256=ovp070KG2mvqSv7MYb5iO5fdJC0zxH_4C2385nqj48g,8385
26
26
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
27
27
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
28
28
  modal/cls.py,sha256=aHoMEWMZUN7bOezs3tRPxzS1FP3gTxZBORVjbPmtxyg,35338
@@ -30,8 +30,8 @@ modal/cls.pyi,sha256=klQkXHXhl5gTjRo_XDV6PGecnJeFOudSMXid_kanumI,12090
30
30
  modal/config.py,sha256=OOMEJ5LHNFbHRW5wUpuhl0TH6EPW8D1XV9I3OJXrZrk,12668
31
31
  modal/container_process.py,sha256=vvyK3DVPUMsuqvkKdUiQ49cDLF9JawGrxpglLk5vfgI,6208
32
32
  modal/container_process.pyi,sha256=cR4aRHTbcVvmxGCc1_k2Ey8JllJIAQYq9PBKx0_1TuI,2916
33
- modal/dict.py,sha256=7NJVI05hisF9gTuJMYestH9X0LIOaE9PPqbCeYtwSRs,13365
34
- modal/dict.pyi,sha256=X4BhtAYry2TOW6fEj2t3nklHLJJpoh8fQw77lXQvfB4,7850
33
+ modal/dict.py,sha256=rYOTNtUIOoIVibC1KGC6-fnsXD88ij8o0xNKFpR9BVs,14134
34
+ modal/dict.pyi,sha256=ou2rospKvSNl0PffrsSABruTjspUlqwbkjJ22fzg-yE,8021
35
35
  modal/environments.py,sha256=t_TdUyORfIjlEAOS7I4My1qHi0cVsjPxwKloLmAAZMc,6935
36
36
  modal/environments.pyi,sha256=4HbI0kywveaUVI7HqDtZ4HphCTGXYi_wie2hz87up5A,3425
37
37
  modal/exception.py,sha256=4JyO-SACaLNDe2QC48EjsK8GMkZ8AgEurZ8j1YdRu8E,5263
@@ -146,7 +146,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
146
146
  modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
147
147
  modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
148
148
  modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
149
- modal-0.74.59.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
149
+ modal-0.74.61.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
150
150
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
151
151
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
152
152
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -171,9 +171,9 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
171
171
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
172
  modal_version/__init__.py,sha256=m94xZNWIjH8oUtJk4l9xfovzDJede2o7X-q0MHVECtM,470
173
173
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
174
- modal_version/_version_generated.py,sha256=gO9v_hSDkfPZyxi6-dUheFZ5pAFiRJ0MvryhC8RNw8w,149
175
- modal-0.74.59.dist-info/METADATA,sha256=FjOM1ctCE-exDej2RbPnPh3Pcm5HjkV4M7lgk8vFjBY,2451
176
- modal-0.74.59.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
- modal-0.74.59.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.74.59.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.74.59.dist-info/RECORD,,
174
+ modal_version/_version_generated.py,sha256=4-ON1-h9iA3C9MsP6JGXh8ptYdvZodGSEadMj_BJh4c,149
175
+ modal-0.74.61.dist-info/METADATA,sha256=WopIMuSoHOPLr-8QYhYAfSJcbsUpUnL-nAJkP2qifUk,2451
176
+ modal-0.74.61.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
177
+ modal-0.74.61.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.74.61.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.74.61.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 = 59 # git: 57679cb
4
+ build_number = 61 # git: 7447a11