modAL 1.3.1.dev18__py3-none-any.whl → 1.3.1.dev20__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/_output.py CHANGED
@@ -169,9 +169,9 @@ class OutputManager:
169
169
 
170
170
  @classmethod
171
171
  @contextlib.contextmanager
172
- def enable_output(cls, show_progress: bool = True) -> Generator[None]:
172
+ def enable_output(cls, show_progress: bool = True, show_timestamps: bool = False) -> Generator[None]:
173
173
  if show_progress:
174
- cls._instance = OutputManager()
174
+ cls._instance = OutputManager(show_timestamps=show_timestamps)
175
175
  try:
176
176
  yield
177
177
  finally:
modal/cli/run.py CHANGED
@@ -185,7 +185,8 @@ def _make_click_function(app, signature: CliRunnableSignature, inner: Callable[[
185
185
  _validate_interactive_quiet_params(ctx)
186
186
 
187
187
  show_progress: bool = ctx.obj["show_progress"]
188
- with enable_output(show_progress):
188
+ show_timestamps: bool = ctx.obj["show_timestamps"]
189
+ with enable_output(show_progress, show_timestamps=show_timestamps):
189
190
  with run_app(
190
191
  app,
191
192
  detach=ctx.obj["detach"],
@@ -314,7 +315,8 @@ def _get_click_command_for_local_entrypoint(app: App, entrypoint: LocalEntrypoin
314
315
  _validate_interactive_quiet_params(ctx)
315
316
 
316
317
  show_progress: bool = ctx.obj["show_progress"]
317
- with enable_output(show_progress):
318
+ show_timestamps: bool = ctx.obj["show_timestamps"]
319
+ with enable_output(show_progress, show_timestamps=show_timestamps):
318
320
  with run_app(
319
321
  app,
320
322
  detach=ctx.obj["detach"],
@@ -404,8 +406,9 @@ class RunGroup(click.Group):
404
406
  @click.option("-i", "--interactive", is_flag=True, help="Run the app in interactive mode.")
405
407
  @click.option("-e", "--env", help=ENV_OPTION_HELP, default=None)
406
408
  @click.option("-m", is_flag=True, help="Interpret argument as a Python module path instead of a file/script path")
409
+ @click.option("--timestamps", is_flag=True, help="Show timestamps for each log line.")
407
410
  @click.pass_context
408
- def run(ctx, write_result, detach, quiet, interactive, env, m):
411
+ def run(ctx, write_result, detach, quiet, interactive, env, m, timestamps):
409
412
  """Run a Modal function or local entrypoint.
410
413
 
411
414
  `FUNC_REF` should be of the format `{file or module}::{function name}`.
@@ -442,6 +445,7 @@ def run(ctx, write_result, detach, quiet, interactive, env, m):
442
445
  ctx.obj["detach"] = detach # if subcommand would be a click command...
443
446
  ctx.obj["show_progress"] = False if quiet else True
444
447
  ctx.obj["interactive"] = interactive
448
+ ctx.obj["show_timestamps"] = timestamps
445
449
 
446
450
 
447
451
  def deploy(
@@ -453,6 +457,7 @@ def deploy(
453
457
  use_module_mode: bool = typer.Option(
454
458
  False, "-m", help="Interpret argument as a Python module path instead of a file/script path"
455
459
  ),
460
+ timestamps: bool = typer.Option(False, "--timestamps", help="Show timestamps for each log line."),
456
461
  ):
457
462
  """Deploy a Modal application.
458
463
 
@@ -477,11 +482,11 @@ def deploy(
477
482
  "modal deploy ... --name=some-name"
478
483
  )
479
484
 
480
- with enable_output():
485
+ with enable_output(show_timestamps=timestamps):
481
486
  res = deploy_app(app, name=name, environment_name=env or "", tag=tag)
482
487
 
483
488
  if stream_logs:
484
- stream_app_logs(app_id=res.app_id, app_logs_url=res.app_logs_url)
489
+ stream_app_logs(app_id=res.app_id, app_logs_url=res.app_logs_url, show_timestamps=timestamps)
485
490
 
486
491
 
487
492
  def serve(
@@ -491,6 +496,7 @@ def serve(
491
496
  use_module_mode: bool = typer.Option(
492
497
  False, "-m", help="Interpret argument as a Python module path instead of a file/script path"
493
498
  ),
499
+ timestamps: bool = typer.Option(False, "--timestamps", help="Show timestamps for each log line."),
494
500
  ):
495
501
  """Run a web endpoint(s) associated with a Modal app and hot-reload code.
496
502
 
@@ -512,7 +518,7 @@ def serve(
512
518
  if app.description is None:
513
519
  app.set_description(_get_clean_app_description(app_ref))
514
520
 
515
- with enable_output():
521
+ with enable_output(show_timestamps=timestamps):
516
522
  with serve_app(app, import_ref, environment_name=env):
517
523
  if timeout is None:
518
524
  timeout = config["serve_timeout"]
modal/client.pyi CHANGED
@@ -33,7 +33,7 @@ class _Client:
33
33
  server_url: str,
34
34
  client_type: int,
35
35
  credentials: typing.Optional[tuple[str, str]],
36
- version: str = "1.3.1.dev18",
36
+ version: str = "1.3.1.dev20",
37
37
  ):
38
38
  """mdmd:hidden
39
39
  The Modal client object is not intended to be instantiated directly by users.
@@ -163,7 +163,7 @@ class Client:
163
163
  server_url: str,
164
164
  client_type: int,
165
165
  credentials: typing.Optional[tuple[str, str]],
166
- version: str = "1.3.1.dev18",
166
+ version: str = "1.3.1.dev20",
167
167
  ):
168
168
  """mdmd:hidden
169
169
  The Modal client object is not intended to be instantiated directly by users.
modal/functions.pyi CHANGED
@@ -407,7 +407,7 @@ class Function(
407
407
 
408
408
  _call_generator: ___call_generator_spec
409
409
 
410
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
410
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
411
411
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
412
412
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
413
413
  ...
@@ -416,7 +416,7 @@ class Function(
416
416
  """Calls the function remotely, executing it with the given arguments and returning the execution's result."""
417
417
  ...
418
418
 
419
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType]
419
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P]
420
420
 
421
421
  class __remote_gen_spec(typing_extensions.Protocol):
422
422
  def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
@@ -443,7 +443,7 @@ class Function(
443
443
  """
444
444
  ...
445
445
 
446
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
446
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
447
447
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
448
448
  """[Experimental] Calls the function with the given arguments, without waiting for the results.
449
449
 
@@ -466,7 +466,7 @@ class Function(
466
466
  """
467
467
  ...
468
468
 
469
- _experimental_spawn: ___experimental_spawn_spec[modal._functions.P, modal._functions.ReturnType]
469
+ _experimental_spawn: ___experimental_spawn_spec[modal._functions.ReturnType, modal._functions.P]
470
470
 
471
471
  class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER]):
472
472
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> None: ...
@@ -474,7 +474,7 @@ class Function(
474
474
 
475
475
  _spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P]
476
476
 
477
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
477
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
478
478
  def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
479
479
  """Calls the function with the given arguments, without waiting for the results.
480
480
 
@@ -495,7 +495,7 @@ class Function(
495
495
  """
496
496
  ...
497
497
 
498
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType]
498
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P]
499
499
 
500
500
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
501
501
  """Return the inner Python object wrapped by this Modal Function."""
modal/output.py CHANGED
@@ -19,7 +19,7 @@ OUTPUT_ENABLED = False
19
19
 
20
20
 
21
21
  @contextlib.contextmanager
22
- def enable_output(show_progress: bool = True) -> Generator[None, None, None]:
22
+ def enable_output(show_progress: bool = True, show_timestamps: bool = False) -> Generator[None, None, None]:
23
23
  """Context manager that enable output when using the Python SDK.
24
24
 
25
25
  This will print to stdout and stderr things such as
@@ -47,7 +47,7 @@ def enable_output(show_progress: bool = True) -> Generator[None, None, None]:
47
47
  global OUTPUT_ENABLED
48
48
 
49
49
  try:
50
- with OutputManager.enable_output(show_progress):
50
+ with OutputManager.enable_output(show_progress, show_timestamps=show_timestamps):
51
51
  OUTPUT_ENABLED = True
52
52
  yield
53
53
  finally:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.3.1.dev18
3
+ Version: 1.3.1.dev20
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -10,7 +10,7 @@ modal/_ipython.py,sha256=Bu9fc3hm3xt2O47qLe_d-Mu2jS81LwMsmXNJ1sawBA0,575
10
10
  modal/_load_context.py,sha256=P7bMvu-_E1YXWhunYU46EqQX78r4D3b05YGz9blSsy8,3786
11
11
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
12
12
  modal/_object.py,sha256=-LgLXdWlSQ2V-UhmKgswBE7uLTy7E6KgJmV1G4loCMw,13726
13
- modal/_output.py,sha256=pKRLDyoEXjLe-oV12-hb6gYOpdUmNzrq7FQna-maC70,26832
13
+ modal/_output.py,sha256=z7cLrcf0Cu7c697SVTxl4uPsg9yVK2Q4zsIfV9NkcYY,26894
14
14
  modal/_partial_function.py,sha256=6HsV3xqwzmaTgytZ-CL5sNKIttxNjVQv_QgUF-sR20E,37489
15
15
  modal/_pty.py,sha256=E58MQ8d5-wkbMatRKpQR-G9FdbCRcZGiZxOpGy__VuY,1481
16
16
  modal/_resolver.py,sha256=01fdEP-ujXlw2LG0sthPqanm3b0DAiRG81xiQcHHkhY,7317
@@ -26,7 +26,7 @@ modal/app.pyi,sha256=0myfmGDqVoEoxTUWFG_Z4-0KFMlXZXe8k5hcFzl8k2I,50863
26
26
  modal/billing.py,sha256=zmQ3bcCJlwa4KD1IA_QgdWpm1pn13c-7qfy79iEauYI,195
27
27
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
28
28
  modal/client.py,sha256=CXnyJYLhY--xaCkjv3tpjYDca8AuXGQG1IiaXQVX4y4,14436
29
- modal/client.pyi,sha256=Ix6fXDB9h3GzsGcE1MVKT8WtYZcNtdNfb4BKR1LrlPY,14473
29
+ modal/client.pyi,sha256=qDEPwUfk0KqMHgVvsNH47GvarBBeTt0NfR7nJRgkGvQ,14473
30
30
  modal/cloud_bucket_mount.py,sha256=cvVj5Rt4nDHoQbTneoJPTaAcnl_Ab_mrsjnnzd0v9OI,6013
31
31
  modal/cloud_bucket_mount.pyi,sha256=vXusGMOUk9HjCs4lhxteuCK4xLQclPfugGWKo7LECEA,7539
32
32
  modal/cls.py,sha256=DNXcOrd9l2DoX-nLGdpwXm-N9V0BbQEvWA7d2UwFf44,41510
@@ -43,7 +43,7 @@ modal/file_io.py,sha256=dx90C5L8cQv2Z7pVVPaQmE0R3pUOGv2h-wn1qNNXbGQ,19818
43
43
  modal/file_io.pyi,sha256=up9OhV2Y54n-X7nlfV6j_eBwJ8D2cNMEswZ1iddrEQw,15877
44
44
  modal/file_pattern_matcher.py,sha256=A_Kdkej6q7YQyhM_2-BvpFmPqJ0oHb54B6yf9VqvPVE,8116
45
45
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
46
- modal/functions.pyi,sha256=fDH5yZSKq_uUrcze_zwWWZyxSCeEI1PfGlGOqCutCTY,36465
46
+ modal/functions.pyi,sha256=fkjxeYAqh6sX9C84gjUGoLVgHT1IfNB_07h0fpmIyWw,36465
47
47
  modal/gpu.py,sha256=Fe5ORvVPDIstSq1xjmM6OoNgLYFWvogP9r5BgmD3hYg,6769
48
48
  modal/image.py,sha256=HKPUQwdXCwuP7d_KZyEYXMVvtyIQH1_H3_BslQEk6ck,109094
49
49
  modal/image.pyi,sha256=x8a6gohK9XD35z8MejOmKHauOnI7JwbQcZhp3bVfB5I,78383
@@ -55,7 +55,7 @@ modal/network_file_system.py,sha256=23GUYz2DZ5kCzlUrdWBq1siBse6fP_CeGt2Lo9xHkR8,
55
55
  modal/network_file_system.pyi,sha256=oRQzPxSF3ZmY8BDtBFU3CCyGwPLl5jkobtN6ekexLog,16161
56
56
  modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
57
57
  modal/object.pyi,sha256=IiWqkhIVNryH9mbpOpZiG21W9UWW5T7l8gf98J3fVIk,10088
58
- modal/output.py,sha256=q4T9uHduunj4NwY-YSwkHGgjZlCXMuJbfQ5UFaAGRAc,1968
58
+ modal/output.py,sha256=ga4glXYUbUKdlj_R3Ra2AlxqCEJjhYORR90spJrrqTs,2032
59
59
  modal/parallel_map.py,sha256=VAfhkgCKFXtpba01Dvq7kc-xg5nlP-AdvmJW0LoyfD8,68670
60
60
  modal/parallel_map.pyi,sha256=CPX8c8sxCGjrMGFYdm6u8x28b9T2UnW96O2dRbiqWPI,15426
61
61
  modal/partial_function.py,sha256=aIdlGfTjjgqY6Fpr-biCjvRU9W542_S5N2xkNN_rYGM,1127
@@ -145,7 +145,7 @@ modal/cli/launch.py,sha256=1inePjuiqV3HHwk0H-Lk-UAxhkoodCwFoRswD_dat2U,3840
145
145
  modal/cli/network_file_system.py,sha256=AOT24KkYEM3YaHIPIZGe8SsA4-mDyj50o9HNwDsHiaE,7664
146
146
  modal/cli/profile.py,sha256=g8X6tFFK9ccKyu2he9Yu19WLSLNdztzECgmIV__XJFs,3257
147
147
  modal/cli/queues.py,sha256=S5dqk6lEd_2fJolHqoN9iRs6EkeTa0k7KqJWBBGS23k,6170
148
- modal/cli/run.py,sha256=j0NJqxZrfPikpuIjLtQV9dwi2GK3rUHcr6_BJabZXBQ,18728
148
+ modal/cli/run.py,sha256=iYMx45Q3IqjVj_KA7GB5QkreayJCv_hPTQ14deGdacE,19341
149
149
  modal/cli/secret.py,sha256=zkCztov8c4x8CI8G0EoyieUfv9XLQQtVXV8xeMLK-Os,8044
150
150
  modal/cli/shell.py,sha256=L5Dw8yeuu9-f6vNlBGbUT4oh9AVSK4GuB5J6m6vYLBk,12613
151
151
  modal/cli/token.py,sha256=OiVPDsFo6EpCGVuOOx7Q9WjKxVKIka2gRx_676MaITU,4017
@@ -158,7 +158,7 @@ modal/experimental/__init__.py,sha256=GOuo3t4-Le0ZVddiHIOw0MQxkdTJge-bVbhDvgnblm
158
158
  modal/experimental/flash.py,sha256=GJZwSr-4OHlP6gCIZdcbsSb8D8WX9xJwMphjwcfsRoU,31262
159
159
  modal/experimental/flash.pyi,sha256=W62a0AhmLUuH9a0n8Y3-DYhyEEFH3-bRUQFphOQfKHg,16418
160
160
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
161
- modal-1.3.1.dev18.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
161
+ modal-1.3.1.dev20.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
162
162
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
163
163
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
164
164
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -180,10 +180,10 @@ modal_proto/task_command_router_pb2.py,sha256=2Y8wRvnq4_7RiQ-5ZAPIgXaxrHv_MXzgS5
180
180
  modal_proto/task_command_router_pb2.pyi,sha256=yI4tFteErLlonFA2HyaWtONfhY_VGSe7KCWFIspvmkE,16323
181
181
  modal_proto/task_command_router_pb2_grpc.py,sha256=q2VWfK2-4uDcPaPLhAqPZkgxhuQRYnWmwUcnEbPbGuk,13895
182
182
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=e1MM10VGUgDkm041v53QeTglGQPzTpA0FUsFtezjp74,4536
183
- modal_version/__init__.py,sha256=EfXayThZffAU1M5OAZz6UhKjBsJDEE_GqgkSwLRVJ-Q,121
183
+ modal_version/__init__.py,sha256=WxHZGkzFiz41oK0hdem8D2j2Xjvol_Bq6YPKLYG2n5I,121
184
184
  modal_version/__main__.py,sha256=nLUbubxKx7GXNzJIkTB7M7_u8080LyLM0IS0rzFkC_c,119
185
- modal-1.3.1.dev18.dist-info/METADATA,sha256=k9qIefAa-6PAFhkAwXVyBg5PKCRyzCWv_kl4hb9HftE,2582
186
- modal-1.3.1.dev18.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
187
- modal-1.3.1.dev18.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
188
- modal-1.3.1.dev18.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
189
- modal-1.3.1.dev18.dist-info/RECORD,,
185
+ modal-1.3.1.dev20.dist-info/METADATA,sha256=gc-cwtWinrXR9hkn_EI73rtxAQVMEpj6NoXn7TjdEf4,2582
186
+ modal-1.3.1.dev20.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
187
+ modal-1.3.1.dev20.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
188
+ modal-1.3.1.dev20.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
189
+ modal-1.3.1.dev20.dist-info/RECORD,,
modal_version/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
  """Supplies the current version of the modal client library."""
3
3
 
4
- __version__ = "1.3.1.dev18"
4
+ __version__ = "1.3.1.dev20"