modal 0.67.9__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.
- modal/_runtime/user_code_imports.py +1 -1
- modal/client.pyi +2 -2
- modal/cls.py +14 -15
- modal/cls.pyi +12 -12
- modal/functions.py +2 -2
- {modal-0.67.9.dist-info → modal-0.67.10.dist-info}/METADATA +1 -1
- {modal-0.67.9.dist-info → modal-0.67.10.dist-info}/RECORD +12 -12
- modal_version/_version_generated.py +1 -1
- {modal-0.67.9.dist-info → modal-0.67.10.dist-info}/LICENSE +0 -0
- {modal-0.67.9.dist-info → modal-0.67.10.dist-info}/WHEEL +0 -0
- {modal-0.67.9.dist-info → modal-0.67.10.dist-info}/entry_points.txt +0 -0
- {modal-0.67.9.dist-info → modal-0.67.10.dist-info}/top_level.txt +0 -0
@@ -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.
|
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.
|
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.
|
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
|
-
|
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.
|
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
|
180
|
-
if not self.
|
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.
|
190
|
+
self._has_entered = True
|
192
191
|
|
193
192
|
@property
|
194
|
-
def
|
195
|
-
# needed because
|
196
|
-
return self.
|
193
|
+
def _entered(self) -> bool:
|
194
|
+
# needed because _aenter is nowrap
|
195
|
+
return self._has_entered
|
197
196
|
|
198
|
-
@
|
199
|
-
def
|
200
|
-
self.
|
197
|
+
@_entered.setter
|
198
|
+
def _entered(self, val: bool):
|
199
|
+
self._has_entered = val
|
201
200
|
|
202
201
|
@synchronizer.nowrap
|
203
|
-
async def
|
204
|
-
if not self.
|
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.
|
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
|
-
|
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
|
44
|
+
def _enter(self): ...
|
45
45
|
@property
|
46
|
-
def
|
47
|
-
@
|
48
|
-
def
|
49
|
-
async def
|
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
|
-
|
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
|
79
|
+
def _enter(self): ...
|
80
80
|
@property
|
81
|
-
def
|
82
|
-
@
|
83
|
-
def
|
84
|
-
async def
|
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.
|
1351
|
+
await obj._aenter()
|
1352
1352
|
return await fun(*args, **kwargs)
|
1353
1353
|
|
1354
1354
|
return coro() # type: ignore
|
1355
1355
|
else:
|
1356
|
-
obj.
|
1356
|
+
obj._enter()
|
1357
1357
|
return fun(*args, **kwargs)
|
1358
1358
|
|
1359
1359
|
@synchronizer.no_input_translation
|
@@ -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=
|
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=
|
26
|
-
modal/cls.pyi,sha256=
|
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,7 +33,7 @@ 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=
|
36
|
+
modal/functions.py,sha256=lXr32JDqWaGvzzquCmHXIMIuK61361ZeiQ0As7LobWc,66915
|
37
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
|
@@ -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=
|
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=
|
163
|
-
modal-0.67.
|
164
|
-
modal-0.67.
|
165
|
-
modal-0.67.
|
166
|
-
modal-0.67.
|
167
|
-
modal-0.67.
|
168
|
-
modal-0.67.
|
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,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|