modAL 1.4.4.dev2__py3-none-any.whl → 1.4.4.dev3__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,18 +193,25 @@ class TaskCommandRouterClient:
193
193
  ) -> "TaskCommandRouterClient":
194
194
  """Build a connected client from a jwt and url."""
195
195
  o = urllib.parse.urlparse(url)
196
- if o.scheme != "https":
196
+ is_localhost_client = server_client._is_localhost
197
+ if o.scheme == "http":
198
+ # plain http serving should only be used for unit tests
199
+ if not is_localhost_client:
200
+ raise ValueError(f"Task router URL must be https, got: {url}")
201
+ ssl_context = None
202
+ elif o.scheme == "https":
203
+ ssl_context = ssl.create_default_context()
204
+ if is_localhost_client:
205
+ # Allow insecure TLS when the Modal server client points to localhost
206
+ # This is typically triggered from local e2e testing
207
+ logger.warning("Using insecure TLS for task command router because server client points to localhost")
208
+ ssl_context.check_hostname = False
209
+ ssl_context.verify_mode = ssl.CERT_NONE
210
+ else:
197
211
  raise ValueError(f"Task router URL must be https, got: {url}")
198
212
 
199
213
  host, _, port_str = o.netloc.partition(":")
200
- port = int(port_str) if port_str else 443
201
- ssl_context = ssl.create_default_context()
202
-
203
- # Allow insecure TLS when explicitly enabled via config.
204
- if server_client._is_localhost:
205
- logger.warning("Using insecure TLS for task command router because server client points to localhost")
206
- ssl_context.check_hostname = False
207
- ssl_context.verify_mode = ssl.CERT_NONE
214
+ port = int(port_str) if port_str else (443 if o.scheme == "https" else 80)
208
215
 
209
216
  channel = PermanentCloseableChannel(
210
217
  host,
modal/client.pyi CHANGED
@@ -35,7 +35,7 @@ class _Client:
35
35
  server_url: str,
36
36
  client_type: int,
37
37
  credentials: typing.Optional[tuple[str, str]],
38
- version: str = "1.4.4.dev2",
38
+ version: str = "1.4.4.dev3",
39
39
  ):
40
40
  """mdmd:hidden
41
41
  The Modal client object is not intended to be instantiated directly by users.
@@ -175,7 +175,7 @@ class Client:
175
175
  server_url: str,
176
176
  client_type: int,
177
177
  credentials: typing.Optional[tuple[str, str]],
178
- version: str = "1.4.4.dev2",
178
+ version: str = "1.4.4.dev3",
179
179
  ):
180
180
  """mdmd:hidden
181
181
  The Modal client object is not intended to be instantiated directly by users.
modal/functions.pyi CHANGED
@@ -421,7 +421,7 @@ class Function(
421
421
 
422
422
  _call_generator: ___call_generator_spec
423
423
 
424
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
424
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
425
425
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
426
426
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
427
427
  ...
@@ -430,7 +430,7 @@ class Function(
430
430
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
431
431
  ...
432
432
 
433
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType]
433
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P]
434
434
 
435
435
  class __remote_gen_spec(typing_extensions.Protocol):
436
436
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
@@ -457,7 +457,7 @@ class Function(
457
457
  """
458
458
  ...
459
459
 
460
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
460
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
461
461
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
462
462
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
463
463
 
@@ -480,7 +480,7 @@ class Function(
480
480
  """
481
481
  ...
482
482
 
483
- _experimental_spawn: ___experimental_spawn_spec[modal._functions.P, modal._functions.ReturnType]
483
+ _experimental_spawn: ___experimental_spawn_spec[modal._functions.ReturnType, modal._functions.P]
484
484
 
485
485
  class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER]):
486
486
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> None: ...
@@ -488,7 +488,7 @@ class Function(
488
488
 
489
489
  _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P]
490
490
 
491
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
491
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
492
492
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
493
493
  """Calls the function with the given arguments, without waiting for the results.
494
494
 
@@ -509,7 +509,7 @@ class Function(
509
509
  """
510
510
  ...
511
511
 
512
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType]
512
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P]
513
513
 
514
514
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
515
515
  """Return the inner Python object wrapped by this Modal Function."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.4.4.dev2
3
+ Version: 1.4.4.dev3
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License-Expression: Apache-2.0
@@ -28,7 +28,7 @@ modal/app.pyi,sha256=KgYfkXXrwF31zvS0U-O3gpLCyPf-aenwOg_g97eMSoA,54010
28
28
  modal/billing.py,sha256=B2zXa7KeMnpqi2AQINycEk-KSXVYaLTTTAQTtuf2Gfs,257
29
29
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
30
30
  modal/client.py,sha256=jjT4eLFHGcvIF6Xw4kPptIx-VmExtphRN8XJ1JA7fWI,15502
31
- modal/client.pyi,sha256=qJl4Q-34RQzDTmRCxfibQ4yl123ydSag9AXVc9OuYJI,15701
31
+ modal/client.pyi,sha256=fsgU-pW7wYdAsVWd9YYUMyLI-6zM2V23xy0xhMQCSSI,15701
32
32
  modal/cloud_bucket_mount.py,sha256=KkaJVy5vpO_u2NtDYtv1JM-M3y4J0UtWBapTDKpQRcA,6034
33
33
  modal/cloud_bucket_mount.pyi,sha256=mGDeEd1XvxGpCE6O5jRBSfIvMXvZ5AtIybea5k-0w9w,7560
34
34
  modal/cls.py,sha256=UTtp9W3SuFIbkYEE2D94SUzKiMXM5BYgfHGzBQD6CEk,38304
@@ -45,7 +45,7 @@ modal/file_io.py,sha256=DYQXrPUNkKG-0lyzc81E3rh7g56Fg5y6eIQkTqhfqbU,22015
45
45
  modal/file_io.pyi,sha256=DPaq0BhySaiCX3g56QHhyIMdU1izbfWsjpSp30JoJUU,15745
46
46
  modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE,8116
47
47
  modal/functions.py,sha256=EZRcHFfnoYbvawUJnAHF5nIvoo9GX2Djy7mUmOCXmXc,258
48
- modal/functions.pyi,sha256=oQbuXhpMhPmOvDK5YvDaC19iGqa_gbtPG8yTe8MOhz4,37940
48
+ modal/functions.pyi,sha256=2iAOMlEZcKsDyTR1xay1gRpSw5VuhT_pE2beT75A_Ro,37940
49
49
  modal/image.py,sha256=1iHT8KmdWtvIfusupTf_AJGBMUI4PQuAciBp-f_uYL0,113221
50
50
  modal/image.pyi,sha256=FUAY23rnaUmpRBVazrzh3Z3b9tYTMikbyk2SbuIpihI,81004
51
51
  modal/io_streams.py,sha256=15dSqTktIFvqANRDO8pjFjuwgybGAdRBorEM-3ag-fw,25000
@@ -128,7 +128,7 @@ modal/_utils/pattern_utils.py,sha256=ZUffaECfe2iYBhH6cvCB-0-UWhmEBTZEl_TwG_So3ag
128
128
  modal/_utils/rand_pb_testing.py,sha256=OYfbSeEXNMgwy-nAi4hHbgZdb08Ss3BV6TyJp6-gwNs,4360
129
129
  modal/_utils/sandbox_fs_utils.py,sha256=lfYcYA8wQgnUWtSC0UxRzrEThFWOY5ppuA0GJeYzhrg,13914
130
130
  modal/_utils/shell_utils.py,sha256=GjMrO1YxnBr4_UlpA2ZYQKCHxV78QTg0mqxAMHWGTE4,3427
131
- modal/_utils/task_command_router_client.py,sha256=O116m39h569JgpF8w5zA3g9UzWJcsRKYKNG08Wcyaac,31510
131
+ modal/_utils/task_command_router_client.py,sha256=3WZXS9wljwOg7aYmFJkzCSMsrLw1POa2s4KPQ06J9H0,31967
132
132
  modal/_utils/time_utils.py,sha256=PBMHCGzysBVaEnsjc0BSf0bPdSOSXeV11rtTAu5vvus,8451
133
133
  modal/_vendor/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
134
134
  modal/_vendor/a2wsgi_wsgi.py,sha256=Q1AsjpV_Q_vzQsz_cSqmP9jWzsGsB-ARFU6vpQYml8k,21878
@@ -178,7 +178,7 @@ modal/experimental/__init__.py,sha256=Wb1YoAKAnNxH_0c2wA0T12I7bSu9PSO2nS_LuLska7
178
178
  modal/experimental/flash.py,sha256=3k7Co0JrrVMjUQxTmi1VPXJX4jgRWetlAJnwm_kxhqg,34301
179
179
  modal/experimental/flash.pyi,sha256=lpTqJFZRMGWscw0xpYZVdBMnAYjj16asXE4_64A6itQ,17774
180
180
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
181
- modal-1.4.4.dev2.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
181
+ modal-1.4.4.dev3.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
182
182
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
183
183
  modal_docs/gen_cli_docs.py,sha256=bfUSLscHfoQoKkKjIqJvQMe3fURzqcQK7gF1h9WQLtM,3742
184
184
  modal_docs/gen_cli_docs_main.py,sha256=UPGr7O1DYTIRLwfINe2rbdh89J3cPVTU1OWL-SjxnOQ,198
@@ -188,22 +188,22 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
188
188
  modal_docs/mdmd/mdmd.py,sha256=z9T3lMktTq3N4r6T6MSSyw8lebbqKc3Igw8l9EdMJNM,9998
189
189
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
190
190
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
191
- modal_proto/api_grpc.py,sha256=4ErwJFcD3jPUKXX_HHRgthaqgfTOq8dLqiB8ZohGXFg,154654
192
- modal_proto/api_pb2.py,sha256=4n_hmurYrvGZnuq-80RoXicuiGQohzK6RHvrhjGYaaA,434801
193
- modal_proto/api_pb2.pyi,sha256=pgb-ocPukY-knn-zjdDgNuClDWzUedS7oxd3nlEEZac,609680
194
- modal_proto/api_pb2_grpc.py,sha256=S4oYGdOi1gQlVugQ9zCvZUCRZp-F79cUmVw3op4by8I,333121
195
- modal_proto/api_pb2_grpc.pyi,sha256=Gljc73MSstLm_wnNroCcjr39hizIFgePwLTJGnxf5XU,77806
196
- modal_proto/modal_api_grpc.py,sha256=FZWpz-qO42QM_9IZTvzrn2GHrKWn48HLZBV8_IqEVUs,24405
191
+ modal_proto/api_grpc.py,sha256=XR3Roql3A9T8ADCLVtB9K7gI9BpdU3wUti7GXfb416o,155400
192
+ modal_proto/api_pb2.py,sha256=UMPzLtzLSC73C3Pu3grYa-EXukoteTL8qaBy7jKiMuQ,437864
193
+ modal_proto/api_pb2.pyi,sha256=gmCP0hULNx0uEg2Tr4EKs9M3tdM51SqpYzJbT1rzoDM,612780
194
+ modal_proto/api_pb2_grpc.py,sha256=F9j1jMfVDXpzgo8341GdvdwclTI8iCyi-yFpWtwM11s,334754
195
+ modal_proto/api_pb2_grpc.pyi,sha256=lXX9bu15Bn2rPrTnTky26gZgB2LBHyYRc4LmfcitJEc,78171
196
+ modal_proto/modal_api_grpc.py,sha256=6rZCAcGpgkzO6Sms-1-3fEoB0QBqJwH8t_VgXX8k6ec,24517
197
197
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
198
198
  modal_proto/task_command_router_grpc.py,sha256=VWwYwMSfCt7Yy-u8RNrr3swODsBvUw2FyYczbw-wuwo,17438
199
199
  modal_proto/task_command_router_pb2.py,sha256=-K4H-C7N-ILpdvFyM4PQMZcGZvXV1J89mfycupxxCvU,33745
200
200
  modal_proto/task_command_router_pb2.pyi,sha256=KNM7lPtngiv0_Ni_1zRg1rl65ynyjN8vpzd3XISxMGo,37281
201
201
  modal_proto/task_command_router_pb2_grpc.py,sha256=368j8b_h19L7bidFTRGSdSG4bK0zU9Y_Oq46_B2ACDg,34666
202
202
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=PbzkCj-uSlN1inYSdhncPQ1-04vhBnj3Wzvb-D2pLHY,11226
203
- modal_version/__init__.py,sha256=vE84STAXPQrjZmrV3-mDuxe5RE2Swoscu7BMcmoCuc4,120
203
+ modal_version/__init__.py,sha256=sIAKAF42X0xUrzlVP6HK9Mh15JlIsAylz--jiJsbXrI,120
204
204
  modal_version/__main__.py,sha256=nLUbubxKx7GXNzJIkTB7M7_u8080LyLM0IS0rzFkC_c,119
205
- modal-1.4.4.dev2.dist-info/METADATA,sha256=CaZD4-sP2z3FDBranHmUjeK-P3DvwLdaHfVg_FeHzTs,2338
206
- modal-1.4.4.dev2.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
207
- modal-1.4.4.dev2.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
208
- modal-1.4.4.dev2.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
209
- modal-1.4.4.dev2.dist-info/RECORD,,
205
+ modal-1.4.4.dev3.dist-info/METADATA,sha256=7aMGikjhT0UDXp_CTCYX0oSebpOGdrwD7mjDe70aLKg,2338
206
+ modal-1.4.4.dev3.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
207
+ modal-1.4.4.dev3.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
208
+ modal-1.4.4.dev3.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
209
+ modal-1.4.4.dev3.dist-info/RECORD,,
modal_proto/api_grpc.py CHANGED
@@ -267,6 +267,10 @@ class ModalClientBase(abc.ABC):
267
267
  async def EndpointList(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EndpointListRequest, modal_proto.api_pb2.EndpointListResponse]') -> None:
268
268
  pass
269
269
 
270
+ @abc.abstractmethod
271
+ async def EndpointStop(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EndpointStopRequest, modal_proto.api_pb2.EndpointStopResponse]') -> None:
272
+ pass
273
+
270
274
  @abc.abstractmethod
271
275
  async def EnvironmentCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.EnvironmentCreateRequest, google.protobuf.empty_pb2.Empty]') -> None:
272
276
  pass
@@ -1193,6 +1197,12 @@ class ModalClientBase(abc.ABC):
1193
1197
  modal_proto.api_pb2.EndpointListRequest,
1194
1198
  modal_proto.api_pb2.EndpointListResponse,
1195
1199
  ),
1200
+ '/modal.client.ModalClient/EndpointStop': grpclib.const.Handler(
1201
+ self.EndpointStop,
1202
+ grpclib.const.Cardinality.UNARY_UNARY,
1203
+ modal_proto.api_pb2.EndpointStopRequest,
1204
+ modal_proto.api_pb2.EndpointStopResponse,
1205
+ ),
1196
1206
  '/modal.client.ModalClient/EnvironmentCreate': grpclib.const.Handler(
1197
1207
  self.EnvironmentCreate,
1198
1208
  grpclib.const.Cardinality.UNARY_UNARY,
@@ -2399,6 +2409,12 @@ class ModalClientStub:
2399
2409
  modal_proto.api_pb2.EndpointListRequest,
2400
2410
  modal_proto.api_pb2.EndpointListResponse,
2401
2411
  )
2412
+ self.EndpointStop = grpclib.client.UnaryUnaryMethod(
2413
+ channel,
2414
+ '/modal.client.ModalClient/EndpointStop',
2415
+ modal_proto.api_pb2.EndpointStopRequest,
2416
+ modal_proto.api_pb2.EndpointStopResponse,
2417
+ )
2402
2418
  self.EnvironmentCreate = grpclib.client.UnaryUnaryMethod(
2403
2419
  channel,
2404
2420
  '/modal.client.ModalClient/EnvironmentCreate',