modal 0.72.18__py3-none-any.whl → 0.72.19__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
@@ -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.72.18"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.19"
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.72.18"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.72.19"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/functions.pyi CHANGED
@@ -462,11 +462,11 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
462
462
 
463
463
  _call_generator_nowait: ___call_generator_nowait_spec
464
464
 
465
- class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
465
+ class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
466
466
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
467
467
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
468
468
 
469
- remote: __remote_spec[ReturnType, P]
469
+ remote: __remote_spec[P, ReturnType]
470
470
 
471
471
  class __remote_gen_spec(typing_extensions.Protocol):
472
472
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -479,17 +479,17 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
479
479
  def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
480
480
  def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
481
481
 
482
- class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
482
+ class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
483
483
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
484
484
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
485
485
 
486
- _experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
486
+ _experimental_spawn: ___experimental_spawn_spec[P, ReturnType]
487
487
 
488
- class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
488
+ class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
489
489
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
490
490
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
491
491
 
492
- spawn: __spawn_spec[ReturnType, P]
492
+ spawn: __spawn_spec[P, ReturnType]
493
493
 
494
494
  def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
495
495
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.72.18
3
+ Version: 0.72.19
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -19,7 +19,7 @@ modal/app.py,sha256=t-INVjEAhSXppcu8m_rhaa1r5tzZmEPCS3lhAZg7xkc,45611
19
19
  modal/app.pyi,sha256=279Tf7Jmwq_SvAm_BKRnollAqefYI22g7wQqP94Er1Y,25453
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=JAnd4-GCN093BwkvOFAK5a6iy5ycxofjpUncMxlrIMw,15253
22
- modal/client.pyi,sha256=9OcKFllKVWWw3XW0L0bYVoShRaGqalqw2GPfq_mi9yY,7280
22
+ modal/client.pyi,sha256=nCp9rhz_AHgLbzzISFYY3qVP6ekAzgAHsYyQE3XffbY,7280
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
25
  modal/cls.py,sha256=jbGYPMM1AhS3Uj8Wh2lk0YARDCul_imUDiJmbyrfSSc,32158
@@ -37,7 +37,7 @@ modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
37
37
  modal/file_io.pyi,sha256=NrIoB0YjIqZ8MDMe826xAnybT0ww_kxQM3iPLo82REU,8898
38
38
  modal/file_pattern_matcher.py,sha256=dSo7BMQGZBAuoBFOX-e_72HxmF3FLzjQlEtnGtJiaD4,6506
39
39
  modal/functions.py,sha256=3uJPbrEAWhpFfLfUnoRjGmvEUC-_wVh-8yNJBx8eVeM,68249
40
- modal/functions.pyi,sha256=3ESJ61f8oEDycDmrpnuNB2vjFKuLBG_aqyliXPTdY7M,25407
40
+ modal/functions.pyi,sha256=LiSDgH-X7jcZ56pAoLMwo3x9Dzdp_3Sd7W5MVAJPoCg,25407
41
41
  modal/gpu.py,sha256=MTxj6ql8EpgfBg8YmZ5a1cLznyuZFssX1qXbEX4LKVM,7503
42
42
  modal/image.py,sha256=0eGAw3bImUTS0KzsfnsKreixaZlbWfutgoluo7Hq7RQ,90747
43
43
  modal/image.pyi,sha256=NfZyLkl4rmxpc5fokaO4mmEeGFOwGn0AndV1vKwBdbs,26027
@@ -148,13 +148,13 @@ modal_global_objects/mounts/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0
148
148
  modal_global_objects/mounts/modal_client_package.py,sha256=W0E_yShsRojPzWm6LtIQqNVolapdnrZkm2hVEQuZK_4,767
149
149
  modal_global_objects/mounts/python_standalone.py,sha256=pEML5GaV2_0ahci_1vpfc_FnySpsfi2fhYmFF5I7IiQ,1837
150
150
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
151
- modal_proto/api.proto,sha256=O3S8SS2DP9CHKZKcXM0fBvXjG8M7y90x1UrK47eD0VE,80390
152
- modal_proto/api_grpc.py,sha256=VakjV_Ge3fgZDRJN6EeG2yY_LMkZvn6yVXr5SnFKIDA,103542
153
- modal_proto/api_pb2.py,sha256=Lo8AfmZFDkHGJZp8OPmvD0eKpsZkuUNJo5x43O80918,295891
154
- modal_proto/api_pb2.pyi,sha256=2ZheT-U9j1uUoaUiVmMrSWRxYp9dV7H1TmNv2P6IMFQ,394334
155
- modal_proto/api_pb2_grpc.py,sha256=OAvrG7OCPKmF-6eawqc4X5iLN0WFBQ_AvufuWnHm3Es,224030
156
- modal_proto/api_pb2_grpc.pyi,sha256=-bE8AO-IJsg0WMwSzEEe_jnmeirta3tqj5IwTVIrF6c,52169
157
- modal_proto/modal_api_grpc.py,sha256=kOABHGzB81bAhxqKwj79DKqdK2HlcC4U0MkFETkQwfQ,13826
151
+ modal_proto/api.proto,sha256=cCephAhAzYqBzstMGl4oJitWm37u5-cfslCnoW7snTQ,82429
152
+ modal_proto/api_grpc.py,sha256=U2-xzAtfSS017rCpNHmscNHLl6FSQ1mjJY8BhPXovpk,104423
153
+ modal_proto/api_pb2.py,sha256=CxkkTLh7H0HHul_gII7yNxz4gcHFZyz3CpfCgJfX3OY,302179
154
+ modal_proto/api_pb2.pyi,sha256=hRJ4w5hb3r8CYhPPsQkSAtDd00O07c3yOnyqW_3HGrc,403130
155
+ modal_proto/api_pb2_grpc.py,sha256=upL_jT9kJXcvOq-fl6VU8OBPqvDj6bqh0UE2ipgrY4I,225767
156
+ modal_proto/api_pb2_grpc.pyi,sha256=zEO6zm_ImjG7a8PtkdohHRsPSnrZQKzg5y1ZVi6dFF8,52620
157
+ modal_proto/modal_api_grpc.py,sha256=f6SJgIPmHx4RJmi5vPIanOCtIFXFdxHoUqcU8wPdn8g,13952
158
158
  modal_proto/modal_options_grpc.py,sha256=qJ1cuwA54oRqrdTyPTbvfhFZYd9HhJKK5UCwt523r3Y,120
159
159
  modal_proto/options.proto,sha256=a-siq4swVbZPfaFRXAipRZzGP2bq8OsdUvjlyzAeodQ,488
160
160
  modal_proto/options_grpc.py,sha256=M18X3d-8F_cNYSVM3I25dUTO5rZ0rd-vCCfynfh13Nc,125
@@ -165,10 +165,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
165
165
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
166
166
  modal_version/__init__.py,sha256=kGya2ZlItX2zB7oHORs-wvP4PG8lg_mtbi1QIK3G6SQ,470
167
167
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
168
- modal_version/_version_generated.py,sha256=nFUjMwAfcqUBHR16RNefvEClggV4jhb2GS-uViypvj0,149
169
- modal-0.72.18.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
170
- modal-0.72.18.dist-info/METADATA,sha256=egX5FAZCbpaOQbhWfMwOimxAy52AI8DHnMELISAAJv8,2329
171
- modal-0.72.18.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
172
- modal-0.72.18.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
173
- modal-0.72.18.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
174
- modal-0.72.18.dist-info/RECORD,,
168
+ modal_version/_version_generated.py,sha256=6Hq4lSJ_DIFz_DVe-D10EzDe9nD8g6TzKPlHm1ikl2Q,149
169
+ modal-0.72.19.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
170
+ modal-0.72.19.dist-info/METADATA,sha256=L-aCv827WiIU3PdkGtWrxEBGtNPndtPGqmqnZYznj0M,2329
171
+ modal-0.72.19.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
172
+ modal-0.72.19.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
173
+ modal-0.72.19.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
174
+ modal-0.72.19.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -4,6 +4,7 @@ package modal.client;
4
4
 
5
5
  import "modal_proto/options.proto";
6
6
  import "google/protobuf/empty.proto";
7
+ import "google/protobuf/struct.proto";
7
8
  import "google/protobuf/wrappers.proto";
8
9
 
9
10
  enum AppDeployVisibility {
@@ -1880,6 +1881,73 @@ message NetworkAccess {
1880
1881
  repeated string allowed_cidrs = 2;
1881
1882
  }
1882
1883
 
1884
+ message NotebookKernelPublishResultsRequest {
1885
+ // See kernelshim.py for the differences between this and `ExecuteResult`.
1886
+ // https://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-results
1887
+ message ExecuteReply {
1888
+ string status = 1;
1889
+ uint32 execution_count = 2;
1890
+ }
1891
+
1892
+ // IOPub message or reply received from the kernel for a cell.
1893
+ message CellResult {
1894
+ string cell_id = 1;
1895
+
1896
+ oneof result_type {
1897
+ // Persistent output that is saved in the notebook.
1898
+ NotebookOutput output = 2;
1899
+
1900
+ // Clear all previous outputs of the cell.
1901
+ bool clear_outputs = 3;
1902
+
1903
+ // Cell has finished executing, return the kernel's execute_reply.
1904
+ ExecuteReply execute_reply = 4;
1905
+ }
1906
+ }
1907
+
1908
+ string notebook_id = 1;
1909
+ repeated CellResult results = 2;
1910
+ }
1911
+
1912
+ // A single output from a notebook. When you execute a cell, it produces an
1913
+ // array of these outputs as the code runs.
1914
+ //
1915
+ // https://github.com/jupyter/nbformat/blob/v5.10.4/nbformat/v4/nbformat.v4.schema.json#L301-L309
1916
+ message NotebookOutput {
1917
+ // Result of executing a code cell.
1918
+ message ExecuteResult {
1919
+ uint32 execution_count = 1;
1920
+ google.protobuf.Struct data = 2; // mimebundle
1921
+ google.protobuf.Struct metadata = 3;
1922
+ }
1923
+
1924
+ // Data displayed as a result of code cell execution.
1925
+ message DisplayData {
1926
+ google.protobuf.Struct data = 1; // mimebundle
1927
+ google.protobuf.Struct metadata = 2;
1928
+ }
1929
+
1930
+ // Stream output from a code cell (stdout / stderr).
1931
+ message Stream {
1932
+ string name = 1; // stdout | stderr
1933
+ string text = 2; // multiline_string
1934
+ }
1935
+
1936
+ // Output of an error that occurred during code cell execution.
1937
+ message Error {
1938
+ string ename = 1;
1939
+ string evalue = 2;
1940
+ repeated string traceback = 3;
1941
+ }
1942
+
1943
+ oneof output_type {
1944
+ ExecuteResult execute_result = 1;
1945
+ DisplayData display_data = 2;
1946
+ Stream stream = 3;
1947
+ Error error = 4;
1948
+ }
1949
+ }
1950
+
1883
1951
  message Object {
1884
1952
  string object_id = 1;
1885
1953
  oneof handle_metadata_oneof {
@@ -2821,6 +2889,9 @@ service ModalClient {
2821
2889
  rpc MountGetOrCreate(MountGetOrCreateRequest) returns (MountGetOrCreateResponse);
2822
2890
  rpc MountPutFile(MountPutFileRequest) returns (MountPutFileResponse);
2823
2891
 
2892
+ // Notebooks
2893
+ rpc NotebookKernelPublishResults(NotebookKernelPublishResultsRequest) returns (google.protobuf.Empty);
2894
+
2824
2895
  // Proxies
2825
2896
  rpc ProxyCreate(ProxyCreateRequest) returns (ProxyCreateResponse);
2826
2897
  rpc ProxyDelete(ProxyDeleteRequest) returns (google.protobuf.Empty);
modal_proto/api_grpc.py CHANGED
@@ -11,6 +11,7 @@ if typing.TYPE_CHECKING:
11
11
 
12
12
  import modal_proto.options_pb2
13
13
  import google.protobuf.empty_pb2
14
+ import google.protobuf.struct_pb2
14
15
  import google.protobuf.wrappers_pb2
15
16
  import modal_proto.api_pb2
16
17
 
@@ -329,6 +330,10 @@ class ModalClientBase(abc.ABC):
329
330
  async def MountPutFile(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.MountPutFileRequest, modal_proto.api_pb2.MountPutFileResponse]') -> None:
330
331
  pass
331
332
 
333
+ @abc.abstractmethod
334
+ async def NotebookKernelPublishResults(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.NotebookKernelPublishResultsRequest, google.protobuf.empty_pb2.Empty]') -> None:
335
+ pass
336
+
332
337
  @abc.abstractmethod
333
338
  async def ProxyCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ProxyCreateRequest, modal_proto.api_pb2.ProxyCreateResponse]') -> None:
334
339
  pass
@@ -1027,6 +1032,12 @@ class ModalClientBase(abc.ABC):
1027
1032
  modal_proto.api_pb2.MountPutFileRequest,
1028
1033
  modal_proto.api_pb2.MountPutFileResponse,
1029
1034
  ),
1035
+ '/modal.client.ModalClient/NotebookKernelPublishResults': grpclib.const.Handler(
1036
+ self.NotebookKernelPublishResults,
1037
+ grpclib.const.Cardinality.UNARY_UNARY,
1038
+ modal_proto.api_pb2.NotebookKernelPublishResultsRequest,
1039
+ google.protobuf.empty_pb2.Empty,
1040
+ ),
1030
1041
  '/modal.client.ModalClient/ProxyCreate': grpclib.const.Handler(
1031
1042
  self.ProxyCreate,
1032
1043
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -1843,6 +1854,12 @@ class ModalClientStub:
1843
1854
  modal_proto.api_pb2.MountPutFileRequest,
1844
1855
  modal_proto.api_pb2.MountPutFileResponse,
1845
1856
  )
1857
+ self.NotebookKernelPublishResults = grpclib.client.UnaryUnaryMethod(
1858
+ channel,
1859
+ '/modal.client.ModalClient/NotebookKernelPublishResults',
1860
+ modal_proto.api_pb2.NotebookKernelPublishResultsRequest,
1861
+ google.protobuf.empty_pb2.Empty,
1862
+ )
1846
1863
  self.ProxyCreate = grpclib.client.UnaryUnaryMethod(
1847
1864
  channel,
1848
1865
  '/modal.client.ModalClient/ProxyCreate',