modal 0.67.8__py3-none-any.whl → 0.67.10__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.
@@ -193,7 +193,7 @@ def get_user_class_instance(cls: typing.Union[type, modal.cls.Cls], args: tuple,
193
193
  if isinstance(cls, modal.cls.Cls):
194
194
  # globally @app.cls-decorated class
195
195
  modal_obj: modal.cls.Obj = cls(*args, **kwargs)
196
- modal_obj.entered = True # ugly but prevents .local() from triggering additional enter-logic
196
+ modal_obj._entered = True # ugly but prevents .local() from triggering additional enter-logic
197
197
  # TODO: unify lifecycle logic between .local() and container_entrypoint
198
198
  user_cls_instance = modal_obj._cached_user_cls_instance()
199
199
  else:
modal/client.pyi CHANGED
@@ -26,7 +26,7 @@ class _Client:
26
26
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
27
27
 
28
28
  def __init__(
29
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.8"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.10"
30
30
  ): ...
31
31
  def is_closed(self) -> bool: ...
32
32
  @property
@@ -81,7 +81,7 @@ class Client:
81
81
  _stub: typing.Optional[modal_proto.api_grpc.ModalClientStub]
82
82
 
83
83
  def __init__(
84
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.8"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.10"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/cls.py CHANGED
@@ -78,7 +78,7 @@ class _Obj:
78
78
  All this class does is to return `Function` objects."""
79
79
 
80
80
  _functions: dict[str, _Function]
81
- _entered: bool
81
+ _has_entered: bool
82
82
  _user_cls_instance: Optional[Any] = None
83
83
  _construction_args: tuple[tuple, dict[str, Any]]
84
84
 
@@ -121,8 +121,7 @@ class _Obj:
121
121
  self._method_functions[method_name] = method
122
122
 
123
123
  # Used for construction local object lazily
124
- self._entered = False
125
- self._local_user_cls_instance = None
124
+ self._has_entered = False
126
125
  self._user_cls = user_cls
127
126
  self._construction_args = (args, kwargs) # used for lazy construction in case of explicit constructors
128
127
 
@@ -176,8 +175,8 @@ class _Obj:
176
175
 
177
176
  return self._user_cls_instance
178
177
 
179
- def enter(self):
180
- if not self._entered:
178
+ def _enter(self):
179
+ if not self._has_entered:
181
180
  if hasattr(self._user_cls_instance, "__enter__"):
182
181
  self._user_cls_instance.__enter__()
183
182
 
@@ -188,26 +187,26 @@ class _Obj:
188
187
  for enter_method in _find_callables_for_obj(self._user_cls_instance, method_flag).values():
189
188
  enter_method()
190
189
 
191
- self._entered = True
190
+ self._has_entered = True
192
191
 
193
192
  @property
194
- def entered(self):
195
- # needed because aenter is nowrap
196
- return self._entered
193
+ def _entered(self) -> bool:
194
+ # needed because _aenter is nowrap
195
+ return self._has_entered
197
196
 
198
- @entered.setter
199
- def entered(self, val):
200
- self._entered = val
197
+ @_entered.setter
198
+ def _entered(self, val: bool):
199
+ self._has_entered = val
201
200
 
202
201
  @synchronizer.nowrap
203
- async def aenter(self):
204
- if not self.entered:
202
+ async def _aenter(self):
203
+ if not self._entered: # use the property to get at the impl class
205
204
  user_cls_instance = self._cached_user_cls_instance()
206
205
  if hasattr(user_cls_instance, "__aenter__"):
207
206
  await user_cls_instance.__aenter__()
208
207
  elif hasattr(user_cls_instance, "__enter__"):
209
208
  user_cls_instance.__enter__()
210
- self.entered = True
209
+ self._has_entered = True
211
210
 
212
211
  def __getattr__(self, k):
213
212
  if k in self._method_functions:
modal/cls.pyi CHANGED
@@ -22,7 +22,7 @@ def _get_class_constructor_signature(user_cls: type) -> inspect.Signature: ...
22
22
 
23
23
  class _Obj:
24
24
  _functions: dict[str, modal.functions._Function]
25
- _entered: bool
25
+ _has_entered: bool
26
26
  _user_cls_instance: typing.Optional[typing.Any]
27
27
  _construction_args: tuple[tuple, dict[str, typing.Any]]
28
28
  _instance_service_function: typing.Optional[modal.functions._Function]
@@ -41,17 +41,17 @@ class _Obj:
41
41
  def _new_user_cls_instance(self): ...
42
42
  async def keep_warm(self, warm_pool_size: int) -> None: ...
43
43
  def _cached_user_cls_instance(self): ...
44
- def enter(self): ...
44
+ def _enter(self): ...
45
45
  @property
46
- def entered(self): ...
47
- @entered.setter
48
- def entered(self, val): ...
49
- async def aenter(self): ...
46
+ def _entered(self) -> bool: ...
47
+ @_entered.setter
48
+ def _entered(self, val: bool): ...
49
+ async def _aenter(self): ...
50
50
  def __getattr__(self, k): ...
51
51
 
52
52
  class Obj:
53
53
  _functions: dict[str, modal.functions.Function]
54
- _entered: bool
54
+ _has_entered: bool
55
55
  _user_cls_instance: typing.Optional[typing.Any]
56
56
  _construction_args: tuple[tuple, dict[str, typing.Any]]
57
57
  _instance_service_function: typing.Optional[modal.functions.Function]
@@ -76,12 +76,12 @@ class Obj:
76
76
  keep_warm: __keep_warm_spec
77
77
 
78
78
  def _cached_user_cls_instance(self): ...
79
- def enter(self): ...
79
+ def _enter(self): ...
80
80
  @property
81
- def entered(self): ...
82
- @entered.setter
83
- def entered(self, val): ...
84
- async def aenter(self): ...
81
+ def _entered(self) -> bool: ...
82
+ @_entered.setter
83
+ def _entered(self, val: bool): ...
84
+ async def _aenter(self): ...
85
85
  def __getattr__(self, k): ...
86
86
 
87
87
  class _Cls(modal.object._Object):
modal/functions.py CHANGED
@@ -1348,12 +1348,12 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1348
1348
  if is_async(info.raw_f):
1349
1349
  # We want to run __aenter__ and fun in the same coroutine
1350
1350
  async def coro():
1351
- await obj.aenter()
1351
+ await obj._aenter()
1352
1352
  return await fun(*args, **kwargs)
1353
1353
 
1354
1354
  return coro() # type: ignore
1355
1355
  else:
1356
- obj.enter()
1356
+ obj._enter()
1357
1357
  return fun(*args, **kwargs)
1358
1358
 
1359
1359
  @synchronizer.no_input_translation
modal/functions.pyi CHANGED
@@ -433,11 +433,11 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
433
433
 
434
434
  _call_generator_nowait: ___call_generator_nowait_spec
435
435
 
436
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
436
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
437
437
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
438
438
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
439
439
 
440
- remote: __remote_spec[P, ReturnType]
440
+ remote: __remote_spec[ReturnType, P]
441
441
 
442
442
  class __remote_gen_spec(typing_extensions.Protocol):
443
443
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -449,17 +449,17 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
449
449
  def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
450
450
  def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
451
451
 
452
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
452
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
453
453
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
454
454
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
455
455
 
456
- _experimental_spawn: ___experimental_spawn_spec[P, ReturnType]
456
+ _experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
457
457
 
458
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
458
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
459
459
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
460
460
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
461
461
 
462
- spawn: __spawn_spec[P, ReturnType]
462
+ spawn: __spawn_spec[ReturnType, P]
463
463
 
464
464
  def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
465
465
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.67.8
3
+ Version: 0.67.10
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -19,11 +19,11 @@ modal/app.py,sha256=EJ7FUN6rWnSwLJoYJh8nmKg_t-8hdN8_rt0OrkP7JvQ,46084
19
19
  modal/app.pyi,sha256=BE5SlR5tRECuc6-e2lUuOknDdov3zxgZ4N0AsLb5ZVQ,25270
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=VMg_aIuo_LOEe2ttxBHEND3PLhTp5lo-onH4wELhIyY,16375
22
- modal/client.pyi,sha256=uyjL_5GgcmCm-4FP_5mZm6pYPOFp-jjfiB4zB9cVQ4w,7352
22
+ modal/client.pyi,sha256=0skCUbPqSA3HK_pQDcrHVTveRpJGE9b5ShO7lcOChlc,7354
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
- modal/cls.py,sha256=fCtqbwu5j7LOnuPYKWPFzL7DTvls3CBvLjV0PCPpIfo,24708
26
- modal/cls.pyi,sha256=2NzoOL9cdxTMAy0Tay8KqFaCoOa8COxAcNB79mBOp20,8101
25
+ modal/cls.py,sha256=F2jk5zFCAA8h-GfM0dbdBG3Mu5wiG9k9Z9JLYRYuT2Q,24758
26
+ modal/cls.pyi,sha256=2_nbvSlkh2d0tfibTIxsThPiL0Xcrcosc5f_ET-i0sk,8147
27
27
  modal/config.py,sha256=86vrmCPiH7PhrbC7-EDuU9yuUnqTpDGy1OEvGTdt7Fs,10923
28
28
  modal/container_process.py,sha256=c_jBPtyPeSxbIcbLfs_FzTrt-1eErtRSnsfxkDozFoY,5589
29
29
  modal/container_process.pyi,sha256=k2kClwaSzz11eci1pzFZgCm-ptXapHAyHTOENorlazA,2594
@@ -33,8 +33,8 @@ modal/environments.py,sha256=5cgA-zbm6ngKLsRA19zSOgtgo9-BarJK3FJK0BiF2Lo,6505
33
33
  modal/environments.pyi,sha256=XalNpiPkAtHWAvOU2Cotq0ozmtl-Jv0FDsR8h9mr27Q,3521
34
34
  modal/exception.py,sha256=EBkdWVved2XEPsXaoPRu56xfxFFHL9iuqvUsdj42WDA,6392
35
35
  modal/experimental.py,sha256=jFuNbwrNHos47viMB9q-cHJSvf2RDxDdoEcss9plaZE,2302
36
- modal/functions.py,sha256=KOhlt716_HnBZw9hwtIzC5i1mBfjeuw9zy0zcWJtw-w,66913
37
- modal/functions.pyi,sha256=2DnWEIOGUx7BKvLwNssUDTG_q4wSOpUpf1h1omMIqNo,24325
36
+ modal/functions.py,sha256=lXr32JDqWaGvzzquCmHXIMIuK61361ZeiQ0As7LobWc,66915
37
+ modal/functions.pyi,sha256=yAb8-EE-Y7bbZXC0P5lEvCvmNVgxZCYlZxdagGdC3_M,24325
38
38
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
39
  modal/image.py,sha256=ZIC8tgjJnqWamN4sZ0Gch3x2VmcM671MWfRLR5SMmoc,79423
40
40
  modal/image.pyi,sha256=JjicLNuaBsfuPZ_xo_eN0zKZkDrEm2alYg-szENhJjM,24591
@@ -78,7 +78,7 @@ modal/_runtime/asgi.py,sha256=GvuxZqWnIHMIR-Bx5f7toCQlkERaJO8CHjTPNM9IFIw,21537
78
78
  modal/_runtime/container_io_manager.py,sha256=yVKSBBybfciDaady7NxOPVU5cm9qL690OgdZ4dZN1bs,44134
79
79
  modal/_runtime/execution_context.py,sha256=E6ofm6j1POXGPxS841X3V7JU6NheVb8OkQc7JpLq4Kg,2712
80
80
  modal/_runtime/telemetry.py,sha256=T1RoAGyjBDr1swiM6pPsGRSITm7LI5FDK18oNXxY08U,5163
81
- modal/_runtime/user_code_imports.py,sha256=_sTWN4w1WjrO9b9oZIb5QNY_giTx3G5L_ly2UdZcy28,14520
81
+ modal/_runtime/user_code_imports.py,sha256=q_3JOYqCPDcVFZWCHEjyEqj8yzdFsQ49HzeqYmFDLbk,14521
82
82
  modal/_utils/__init__.py,sha256=waLjl5c6IPDhSsdWAm9Bji4e2PVxamYABKAze6CHVXY,28
83
83
  modal/_utils/app_utils.py,sha256=88BT4TPLWfYAQwKTHcyzNQRHg8n9B-QE2UyJs96iV-0,108
84
84
  modal/_utils/async_utils.py,sha256=CYXogDVqqUtSe-DVP2A3F-6KztjPZaW6ez2lrYBCW_Y,24917
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
159
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
161
161
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=BFUhAPLFAS2rJXHyIdY4T2VPn2qdaOEuD07D7XvEpJk,148
163
- modal-0.67.8.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.67.8.dist-info/METADATA,sha256=CnhzASvT1CHaJQz0LemAi4AkOgMSAPmpvn_SWqMyi0c,2328
165
- modal-0.67.8.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.67.8.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.67.8.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.67.8.dist-info/RECORD,,
162
+ modal_version/_version_generated.py,sha256=VjasJiIlfVPaP7-gpJdaquzgJzYHAGWOjcQUF7FZYng,149
163
+ modal-0.67.10.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
+ modal-0.67.10.dist-info/METADATA,sha256=H-AaVUFjPBcgdJVblJM0xr80oz0xS55-_rFd2_MCWPw,2329
165
+ modal-0.67.10.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
+ modal-0.67.10.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
+ modal-0.67.10.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
+ modal-0.67.10.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2024
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 8 # git: 38ce1e3
4
+ build_number = 10 # git: 0d5a2b8