modal 0.72.18__py3-none-any.whl → 0.72.20__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.20"
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.20"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.72.18
3
+ Version: 0.72.20
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=a2mB9oSY1YqpOm_edPpVKhsjXaq4LPDM7dbtNC4o0Zo,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
@@ -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=JPmJxNdZPbBPumoC018p8u3boMuuvyR1d7guf_ykBEY,82787
152
+ modal_proto/api_grpc.py,sha256=U2-xzAtfSS017rCpNHmscNHLl6FSQ1mjJY8BhPXovpk,104423
153
+ modal_proto/api_pb2.py,sha256=QejGk8FYbFoCHJCXwjnVEh9E5CmLNHT-e9nAqJWeZpo,302428
154
+ modal_proto/api_pb2.pyi,sha256=mD3smLXwdjMl_DSI2DBCxsgGiSyBeG2082I2e0Lb9lQ,404511
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=CLWfgZkQPsf3XLd9kY1jdY3K199IH5j-dTF4CUXXm9Y,149
169
+ modal-0.72.20.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
170
+ modal-0.72.20.dist-info/METADATA,sha256=seTqZtPNGxMHFSOo-DQ0BmftYJuUSUrGcKEFE7gDkJM,2329
171
+ modal-0.72.20.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
172
+ modal-0.72.20.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
173
+ modal-0.72.20.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
174
+ modal-0.72.20.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 {
@@ -2174,10 +2242,13 @@ message SandboxGetLogsRequest {
2174
2242
 
2175
2243
  message SandboxGetTaskIdRequest {
2176
2244
  string sandbox_id = 1;
2245
+ float timeout = 2;
2246
+ bool wait_until_ready = 3; // If true, waits until the container's postStart hook has been run before returning. Useful for detecting init failures.
2177
2247
  }
2178
2248
 
2179
2249
  message SandboxGetTaskIdResponse {
2180
- string task_id = 1;
2250
+ optional string task_id = 1; // This is None if the sandbox was terminated before a task could be scheduled.
2251
+ optional GenericResult task_result = 2; // If the task has already exited, this is the result.
2181
2252
  }
2182
2253
 
2183
2254
  message SandboxGetTunnelsRequest {
@@ -2821,6 +2892,9 @@ service ModalClient {
2821
2892
  rpc MountGetOrCreate(MountGetOrCreateRequest) returns (MountGetOrCreateResponse);
2822
2893
  rpc MountPutFile(MountPutFileRequest) returns (MountPutFileResponse);
2823
2894
 
2895
+ // Notebooks
2896
+ rpc NotebookKernelPublishResults(NotebookKernelPublishResultsRequest) returns (google.protobuf.Empty);
2897
+
2824
2898
  // Proxies
2825
2899
  rpc ProxyCreate(ProxyCreateRequest) returns (ProxyCreateResponse);
2826
2900
  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',