modal 0.73.156__py3-none-any.whl → 0.73.158__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/_serialization.py +9 -9
- modal/_type_manager.py +24 -0
- modal/client.pyi +2 -2
- modal/functions.pyi +6 -6
- {modal-0.73.156.dist-info → modal-0.73.158.dist-info}/METADATA +1 -1
- {modal-0.73.156.dist-info → modal-0.73.158.dist-info}/RECORD +14 -14
- modal_proto/api.proto +8 -2
- modal_proto/api_pb2.py +723 -720
- modal_proto/api_pb2.pyi +24 -9
- modal_version/_version_generated.py +1 -1
- {modal-0.73.156.dist-info → modal-0.73.158.dist-info}/LICENSE +0 -0
- {modal-0.73.156.dist-info → modal-0.73.158.dist-info}/WHEEL +0 -0
- {modal-0.73.156.dist-info → modal-0.73.158.dist-info}/entry_points.txt +0 -0
- {modal-0.73.156.dist-info → modal-0.73.158.dist-info}/top_level.txt +0 -0
modal/_serialization.py
CHANGED
@@ -501,20 +501,20 @@ def _signature_parameter_to_spec(
|
|
501
501
|
has_default=has_default,
|
502
502
|
)
|
503
503
|
if include_legacy_parameter_fields:
|
504
|
+
# Specific to *class parameters*:
|
504
505
|
# add the .{type}_default and `.type` values as required by legacy clients
|
505
506
|
# looking at class parameter specs
|
506
|
-
|
507
|
-
|
507
|
+
field_spec.type = field_spec.full_type.base_type
|
508
|
+
|
509
|
+
if has_default:
|
510
|
+
if full_proto_type.base_type == api_pb2.PARAM_TYPE_INT:
|
508
511
|
field_spec.int_default = python_signature_parameter.default
|
509
|
-
|
510
|
-
elif full_proto_type.base_type == api_pb2.PARAM_TYPE_STRING:
|
511
|
-
if has_default:
|
512
|
+
elif full_proto_type.base_type == api_pb2.PARAM_TYPE_STRING:
|
512
513
|
field_spec.string_default = python_signature_parameter.default
|
513
|
-
|
514
|
-
elif full_proto_type.base_type == api_pb2.PARAM_TYPE_BYTES:
|
515
|
-
if has_default:
|
514
|
+
elif full_proto_type.base_type == api_pb2.PARAM_TYPE_BYTES:
|
516
515
|
field_spec.bytes_default = python_signature_parameter.default
|
517
|
-
|
516
|
+
elif full_proto_type.base_type == api_pb2.PARAM_TYPE_BOOL:
|
517
|
+
field_spec.bool_default = python_signature_parameter.default
|
518
518
|
|
519
519
|
return field_spec
|
520
520
|
|
modal/_type_manager.py
CHANGED
@@ -143,6 +143,23 @@ class BytesParameter:
|
|
143
143
|
raise TypeError(f"Expected bytes, got {type(python_value).__name__}")
|
144
144
|
|
145
145
|
|
146
|
+
@parameter_serde_registry.register_encoder(bool)
|
147
|
+
@parameter_serde_registry.register_decoder(api_pb2.PARAM_TYPE_BOOL)
|
148
|
+
class BoolParameter:
|
149
|
+
@staticmethod
|
150
|
+
def encode(value: Any) -> api_pb2.ClassParameterValue:
|
151
|
+
return api_pb2.ClassParameterValue(type=api_pb2.PARAM_TYPE_BOOL, bool_value=value)
|
152
|
+
|
153
|
+
@staticmethod
|
154
|
+
def decode(proto_value: api_pb2.ClassParameterValue) -> bool:
|
155
|
+
return proto_value.bool_value
|
156
|
+
|
157
|
+
@staticmethod
|
158
|
+
def validate(python_value: Any):
|
159
|
+
if not isinstance(python_value, bool):
|
160
|
+
raise TypeError(f"Expected bool, got {type(python_value).__name__}")
|
161
|
+
|
162
|
+
|
146
163
|
SCHEMA_FACTORY_TYPE = typing.Callable[[type], api_pb2.GenericPayloadType]
|
147
164
|
|
148
165
|
|
@@ -205,6 +222,13 @@ def str_schema(full_python_type: type) -> api_pb2.GenericPayloadType:
|
|
205
222
|
)
|
206
223
|
|
207
224
|
|
225
|
+
@schema_registry.add(bool)
|
226
|
+
def bool_schema(full_python_type: type) -> api_pb2.GenericPayloadType:
|
227
|
+
return api_pb2.GenericPayloadType(
|
228
|
+
base_type=api_pb2.PARAM_TYPE_BOOL,
|
229
|
+
)
|
230
|
+
|
231
|
+
|
208
232
|
@schema_registry.add(type(None))
|
209
233
|
def none_type_schema(declared_python_type: type) -> api_pb2.GenericPayloadType:
|
210
234
|
return api_pb2.GenericPayloadType(base_type=api_pb2.PARAM_TYPE_NONE)
|
modal/client.pyi
CHANGED
@@ -31,7 +31,7 @@ class _Client:
|
|
31
31
|
server_url: str,
|
32
32
|
client_type: int,
|
33
33
|
credentials: typing.Optional[tuple[str, str]],
|
34
|
-
version: str = "0.73.
|
34
|
+
version: str = "0.73.158",
|
35
35
|
): ...
|
36
36
|
def is_closed(self) -> bool: ...
|
37
37
|
@property
|
@@ -93,7 +93,7 @@ class Client:
|
|
93
93
|
server_url: str,
|
94
94
|
client_type: int,
|
95
95
|
credentials: typing.Optional[tuple[str, str]],
|
96
|
-
version: str = "0.73.
|
96
|
+
version: str = "0.73.158",
|
97
97
|
): ...
|
98
98
|
def is_closed(self) -> bool: ...
|
99
99
|
@property
|
modal/functions.pyi
CHANGED
@@ -200,11 +200,11 @@ class Function(
|
|
200
200
|
|
201
201
|
_call_generator_nowait: ___call_generator_nowait_spec[typing_extensions.Self]
|
202
202
|
|
203
|
-
class __remote_spec(typing_extensions.Protocol[
|
203
|
+
class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
204
204
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
205
205
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
206
206
|
|
207
|
-
remote: __remote_spec[modal._functions.
|
207
|
+
remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
208
208
|
|
209
209
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
210
210
|
def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
|
@@ -219,19 +219,19 @@ class Function(
|
|
219
219
|
self, *args: modal._functions.P.args, **kwargs: modal._functions.P.kwargs
|
220
220
|
) -> modal._functions.OriginalReturnType: ...
|
221
221
|
|
222
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
222
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
223
223
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
224
224
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
225
225
|
|
226
226
|
_experimental_spawn: ___experimental_spawn_spec[
|
227
|
-
modal._functions.
|
227
|
+
modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
|
228
228
|
]
|
229
229
|
|
230
|
-
class __spawn_spec(typing_extensions.Protocol[
|
230
|
+
class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
231
231
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
232
232
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
233
233
|
|
234
|
-
spawn: __spawn_spec[modal._functions.
|
234
|
+
spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
235
235
|
|
236
236
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
|
237
237
|
|
@@ -13,17 +13,17 @@ modal/_proxy_tunnel.py,sha256=gnKyCfmVB7x2d1A6c-JDysNIP3kEFxmXzhcXhPrzPn0,1906
|
|
13
13
|
modal/_pty.py,sha256=JZfPDDpzqICZqtyPI_oMJf_9w-p_lLNuzHhwhodUXio,1329
|
14
14
|
modal/_resolver.py,sha256=RtoXoYzSllPlFu0D1vel_FWiEmDO7RyToiC2bxeN8ZY,6917
|
15
15
|
modal/_resources.py,sha256=5qmcirXUI8dSH926nwkUaeX9H25mqYu9mXD_KuT79-o,1733
|
16
|
-
modal/_serialization.py,sha256=
|
16
|
+
modal/_serialization.py,sha256=wAgaALThfr-DBV9LMhM4qY_PCH7SRhA9xgoHL2bapBk,22963
|
17
17
|
modal/_traceback.py,sha256=IZQzB3fVlUfMHOSyKUgw0H6qv4yHnpyq-XVCNZKfUdA,5023
|
18
18
|
modal/_tunnel.py,sha256=zTBxBiuH1O22tS1OliAJdIsSmaZS8PlnifS_6S5z-mk,6320
|
19
19
|
modal/_tunnel.pyi,sha256=JmmDYAy9F1FpgJ_hWx0xkom2nTOFQjn4mTPYlU3PFo4,1245
|
20
|
-
modal/_type_manager.py,sha256=
|
20
|
+
modal/_type_manager.py,sha256=DWjgmjYJuOagw2erin506UUbG2H5UzZCFEekS-7hmfA,9087
|
21
21
|
modal/_watcher.py,sha256=K6LYnlmSGQB4tWWI9JADv-tvSvQ1j522FwT71B51CX8,3584
|
22
22
|
modal/app.py,sha256=w00bV9cjABAsS2ExE7zb1jY6Q_snXYmdKa3xRFg8iXA,47428
|
23
23
|
modal/app.pyi,sha256=pUEqciyGZ446sc_QoG8XcQ_oc6oU-U4dqjkxjhgOX98,26968
|
24
24
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
25
25
|
modal/client.py,sha256=U-YKSw0n7J1ZLREt9cbEJCtmHe5YoPKFxl0xlkan2yc,15565
|
26
|
-
modal/client.pyi,sha256=
|
26
|
+
modal/client.pyi,sha256=2xDnuSzcyAojtKfIiW4h13jQXTDGW_VqMrToQ_VwKVM,7661
|
27
27
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
28
28
|
modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
|
29
29
|
modal/cls.py,sha256=jlQE7qEwGG49FCSqqzYkcedi619G3K4PNnJCtPO8y_w,32954
|
@@ -40,7 +40,7 @@ modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
|
|
40
40
|
modal/file_io.pyi,sha256=NTRft1tbPSWf9TlWVeZmTlgB5AZ_Zhu2srWIrWr7brk,9445
|
41
41
|
modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw,6497
|
42
42
|
modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
|
43
|
-
modal/functions.pyi,sha256=
|
43
|
+
modal/functions.pyi,sha256=Bg_zlYSHMYuEXQYLcFU-j1Kwq5zHQ9jggMA_5ZO_du8,14785
|
44
44
|
modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
|
45
45
|
modal/image.py,sha256=HtkKomhX4inozqSRi7lf5Vt9IEqCnVHn5bEo59hD64A,92835
|
46
46
|
modal/image.pyi,sha256=iWclz2rxaP-LSsYMgU0X3ZcN5mEFvpyKzIPKJbohmsg,25591
|
@@ -153,10 +153,10 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
|
|
153
153
|
modal_docs/mdmd/mdmd.py,sha256=Irx49MCCTlBOP4FBdLR--JrpA3-WhsVeriq0LGgsRic,6232
|
154
154
|
modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
|
155
155
|
modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
|
156
|
-
modal_proto/api.proto,sha256=
|
156
|
+
modal_proto/api.proto,sha256=VwW2t0kpo9FMrYq1jHQpL4pvLbes2oCUxw7EXKAplpA,91432
|
157
157
|
modal_proto/api_grpc.py,sha256=9Rs0JyHcz_DSjVKhdtMbDuNt6qDkrE2718KsyA3QL4c,110702
|
158
|
-
modal_proto/api_pb2.py,sha256=
|
159
|
-
modal_proto/api_pb2.pyi,sha256=
|
158
|
+
modal_proto/api_pb2.py,sha256=JXOC0c4UtDJkNfpwTJTB-rkVoeW1pMHTxr6iAb9ckQI,322009
|
159
|
+
modal_proto/api_pb2.pyi,sha256=iJH5M3mh9TGO2nZV2Te0vfLawharrzxBsIndsoF9pWs,438965
|
160
160
|
modal_proto/api_pb2_grpc.py,sha256=olXvs6OQvy7pqvHP9bkSWC_DdIv0iO38xRlmkLo-ai8,239213
|
161
161
|
modal_proto/api_pb2_grpc.pyi,sha256=ybhcN2nwFBIPd4Z4kkMOv-M8Ejidz93Bl4zScLpYcK0,55706
|
162
162
|
modal_proto/modal_api_grpc.py,sha256=43ujbC_a8YAjuhtEvS-O-5lNpkG5d0K0ZIlryJ4weT4,14766
|
@@ -170,10 +170,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
|
|
170
170
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
171
171
|
modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
|
172
172
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
173
|
-
modal_version/_version_generated.py,sha256=
|
174
|
-
modal-0.73.
|
175
|
-
modal-0.73.
|
176
|
-
modal-0.73.
|
177
|
-
modal-0.73.
|
178
|
-
modal-0.73.
|
179
|
-
modal-0.73.
|
173
|
+
modal_version/_version_generated.py,sha256=W-Cjy5h17CL7l8Q5DFjspeFnQc1xP0KQ83zpkDXqVD4,150
|
174
|
+
modal-0.73.158.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
175
|
+
modal-0.73.158.dist-info/METADATA,sha256=V8G3VKDYed7Y6hnUEmwQNtFOrBO-0ORRHED2hfH9yxk,2453
|
176
|
+
modal-0.73.158.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
177
|
+
modal-0.73.158.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
178
|
+
modal-0.73.158.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
179
|
+
modal-0.73.158.dist-info/RECORD,,
|
modal_proto/api.proto
CHANGED
@@ -176,6 +176,7 @@ enum ParameterType {
|
|
176
176
|
PARAM_TYPE_LIST = 6;
|
177
177
|
PARAM_TYPE_DICT = 7;
|
178
178
|
PARAM_TYPE_NONE = 8;
|
179
|
+
PARAM_TYPE_BOOL = 9;
|
179
180
|
}
|
180
181
|
|
181
182
|
enum ProgressType {
|
@@ -710,6 +711,7 @@ message ClassParameterSpec { // TODO: rename into NamedPayloadType or similar
|
|
710
711
|
int64 int_default = 5;
|
711
712
|
bytes pickle_default = 6;
|
712
713
|
bytes bytes_default = 7;
|
714
|
+
bool bool_default = 9;
|
713
715
|
}
|
714
716
|
GenericPayloadType full_type = 8; // supersedes `type`
|
715
717
|
}
|
@@ -726,6 +728,7 @@ message ClassParameterValue { // TODO: rename into NamedPayloadValue
|
|
726
728
|
int64 int_value = 4;
|
727
729
|
bytes pickle_value = 5;
|
728
730
|
bytes bytes_value = 6;
|
731
|
+
bool bool_value = 7;
|
729
732
|
}
|
730
733
|
}
|
731
734
|
|
@@ -800,9 +803,12 @@ message ContainerExecPutInputRequest {
|
|
800
803
|
message ContainerExecRequest {
|
801
804
|
string task_id = 1;
|
802
805
|
repeated string command = 2;
|
803
|
-
|
806
|
+
// If pty_info is provided, open a PTY, but also this container exec is treated an
|
807
|
+
// "interactive shell" request, and it will be terminated if messages are not periodically
|
808
|
+
// sent on the stdin stream on some interval (currently 40 seconds).
|
809
|
+
optional PTYInfo pty_info = 3;
|
804
810
|
// Send SIGTERM to running container on exit of exec command.
|
805
|
-
bool terminate_container_on_exit = 4;
|
811
|
+
bool terminate_container_on_exit = 4 [deprecated=true];
|
806
812
|
bool runtime_debug = 5; // For internal debugging use only.
|
807
813
|
ExecOutputOption stdout_output = 6;
|
808
814
|
ExecOutputOption stderr_output = 7;
|