modAL 1.2.5.dev15__py3-none-any.whl → 1.2.5.dev17__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/_functions.py CHANGED
@@ -988,6 +988,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
988
988
  function_definition = api_pb2.Function(
989
989
  module_name=info.module_name or "",
990
990
  function_name=info.function_name,
991
+ implementation_name=info.implementation_name,
991
992
  mount_ids=loaded_mount_ids,
992
993
  secret_ids=[secret.object_id for secret in secrets],
993
994
  image_id=(image.object_id if image else ""),
@@ -1054,6 +1055,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1054
1055
  function_data = api_pb2.FunctionData(
1055
1056
  module_name=function_definition.module_name,
1056
1057
  function_name=function_definition.function_name,
1058
+ implementation_name=function_definition.implementation_name,
1057
1059
  function_type=function_definition.function_type,
1058
1060
  warm_pool_size=function_definition.warm_pool_size,
1059
1061
  concurrency_limit=function_definition.concurrency_limit,
@@ -465,7 +465,7 @@ def import_single_function_service(
465
465
  else:
466
466
  # Load the module dynamically
467
467
  module = importlib.import_module(function_def.module_name)
468
- qual_name: str = function_def.function_name
468
+ qual_name: str = function_def.implementation_name
469
469
 
470
470
  if not is_global_object(qual_name):
471
471
  raise LocalFunctionError("Attempted to load a function defined in a function scope")
@@ -129,6 +129,7 @@ class FunctionInfo:
129
129
 
130
130
  raw_f: Optional[Callable[..., Any]] # if None - this is a "class service function"
131
131
  function_name: str
132
+ implementation_name: str
132
133
  user_cls: Optional[type[Any]]
133
134
  module_name: Optional[str]
134
135
 
@@ -160,20 +161,16 @@ class FunctionInfo:
160
161
  self.raw_f = f
161
162
  self.user_cls = user_cls
162
163
 
163
- if name_override is not None:
164
- if not serialized:
165
- # We may relax this constraint in the future, but currently we don't track the distinction between
166
- # the Function's name inside modal and the name of the object that we need to import in a container.
167
- raise InvalidError("Setting a custom `name=` also requires setting `serialized=True`")
168
- self.function_name = name_override
169
- elif f is None and user_cls:
164
+ if f is None and user_cls:
170
165
  # "service function" for running all methods of a class
171
- self.function_name = f"{user_cls.__name__}.*"
166
+ self.implementation_name = f"{user_cls.__name__}.*"
172
167
  elif f and user_cls:
173
168
  # Method may be defined on superclass of the wrapped class
174
- self.function_name = f"{user_cls.__name__}.{f.__name__}"
169
+ self.implementation_name = f"{user_cls.__name__}.{f.__name__}"
175
170
  else:
176
- self.function_name = f.__qualname__
171
+ self.implementation_name = f.__qualname__
172
+
173
+ self.function_name = name_override or self.implementation_name
177
174
 
178
175
  # If it's a cls, the @method could be defined in a base class in a different file.
179
176
  if user_cls is not None:
modal/app.py CHANGED
@@ -509,6 +509,8 @@ class _App:
509
509
  if old_function is function:
510
510
  return # already added the same exact instance, ignore
511
511
 
512
+ # In notebooks, re-registering the same function with the same app will cause a named collision.
513
+ # This is common notebook coding behavior, so we hide the warning.
512
514
  if not is_notebook():
513
515
  logger.warning(
514
516
  f"Warning: function name '{function.tag}' collision!"
modal/client.pyi CHANGED
@@ -32,7 +32,7 @@ class _Client:
32
32
  server_url: str,
33
33
  client_type: int,
34
34
  credentials: typing.Optional[tuple[str, str]],
35
- version: str = "1.2.5.dev15",
35
+ version: str = "1.2.5.dev17",
36
36
  ):
37
37
  """mdmd:hidden
38
38
  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.2.5.dev15",
166
+ version: str = "1.2.5.dev17",
167
167
  ):
168
168
  """mdmd:hidden
169
169
  The Modal client object is not intended to be instantiated directly by users.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.2.5.dev15
3
+ Version: 1.2.5.dev17
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ modal/_billing.py,sha256=C1jUN9f_1WqozSZAt9EOk1nImXUdiLrgFeeAu3R23cI,3012
4
4
  modal/_clustered_functions.py,sha256=7amiOxErtlciWeBJBL2KvaxerUomJpTAJ3qElflFHQA,2884
5
5
  modal/_clustered_functions.pyi,sha256=JmYwAGOLEnD5AF-gYF9O5tu-SgGjeoJz-X1j48b1Ijg,1157
6
6
  modal/_container_entrypoint.py,sha256=aRuWG1xl3kDy28CfQrqQ-LU8liX2W_bwm2avVOE63Tw,19812
7
- modal/_functions.py,sha256=rfypQ0YyonKkgGeETGI3rY39WT_VoTrOR6Ra8c6v-hc,91651
7
+ modal/_functions.py,sha256=4s-lq4eY58VZimdErW3nezsz6R-VUcy2jW2IESLjKjI,91802
8
8
  modal/_grpc_client.py,sha256=KZcggVNvFL5jRQkFumshMppeFHMbaZI9Dzf13run6As,6083
9
9
  modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
10
10
  modal/_load_context.py,sha256=P7bMvu-_E1YXWhunYU46EqQX78r4D3b05YGz9blSsy8,3786
@@ -21,12 +21,12 @@ modal/_tunnel.py,sha256=hWTfAwrepjAEDjfsYvTWBpucVRZt78NJjwWDZBwyk_Y,6676
21
21
  modal/_tunnel.pyi,sha256=FoedJzHymbPk4Bmnbszm6uhay2rMq1JS9mIiHELYf3k,13804
22
22
  modal/_type_manager.py,sha256=DWjgmjYJuOagw2erin506UUbG2H5UzZCFEekS-7hmfA,9087
23
23
  modal/_watcher.py,sha256=K6LYnlmSGQB4tWWI9JADv-tvSvQ1j522FwT71B51CX8,3584
24
- modal/app.py,sha256=e85FmS4GspHYbSXlPoiqk3mMIoYQo6ALn3VbinsvqiI,57873
24
+ modal/app.py,sha256=kZ3BiZOTVZ7cjJFsa7Bv1aSpWB3FZo-vFtQYNr3Kuwc,58061
25
25
  modal/app.pyi,sha256=nI_Tibj-rI5I7dJFJnczbHvcmVzCvvCih0tMzoQlr_Y,50835
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=k1CqQ_0t4-vHylkqYZgYCnClg-FT0QrTPAKivL01A_k,14354
29
- modal/client.pyi,sha256=I6DJFFUHKZiziGQA4BhYcA_GVzfC2oSE9zm4crfhdrc,13148
29
+ modal/client.pyi,sha256=j_X6W9SH6W_FwlZCj_2NAXldmSOTliVreTLVFV9pGaY,13148
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=4T__mtYlQUnkatif1Wnr8Ld9DN_ySydHj2UwhRg89ok,41984
@@ -93,7 +93,7 @@ modal/_runtime/execution_context.pyi,sha256=FVzakehz72ndL-ufe8-EC7TM4IHO_MEBcAdg
93
93
  modal/_runtime/gpu_memory_snapshot.py,sha256=8T85kyfGJ11AnhFRCZTeWj9zin9e9f5XbrRqU8_WjAk,11955
94
94
  modal/_runtime/telemetry.py,sha256=T1RoAGyjBDr1swiM6pPsGRSITm7LI5FDK18oNXxY08U,5163
95
95
  modal/_runtime/user_code_event_loop.py,sha256=HwOuDyCZLOakr_DG7p2MrcscjSQNheIhBBuLgB5I3Cc,3014
96
- modal/_runtime/user_code_imports.py,sha256=8Pm8vHsMJtY7JfbUnsTh6t1Jqy1xTHfLCcCFbYdkT8s,25806
96
+ modal/_runtime/user_code_imports.py,sha256=A3BFLbm6SeuJkQYRLQTNYW9bty9u2C7eKdK5fGUFxbw,25812
97
97
  modal/_utils/__init__.py,sha256=waLjl5c6IPDhSsdWAm9Bji4e2PVxamYABKAze6CHVXY,28
98
98
  modal/_utils/app_utils.py,sha256=88BT4TPLWfYAQwKTHcyzNQRHg8n9B-QE2UyJs96iV-0,108
99
99
  modal/_utils/async_utils.py,sha256=PnwHfaHcqjLwMnlGC2kn8nqubxpXcSKcy4jHx6477dg,30625
@@ -102,7 +102,7 @@ modal/_utils/blob_utils.py,sha256=NoAWDqYQsqAjievWmH5mCFSXA6XxQStDt9otT-Nh7_g,22
102
102
  modal/_utils/bytes_io_segment_payload.py,sha256=vaXPq8b52-x6G2hwE7SrjS58pg_aRm7gV3bn3yjmTzQ,4261
103
103
  modal/_utils/deprecation.py,sha256=-Bgg7jZdcJU8lROy18YyVnQYbM8hue-hVmwJqlWAGH0,5504
104
104
  modal/_utils/docker_utils.py,sha256=h1uETghR40mp_y3fSWuZAfbIASH1HMzuphJHghAL6DU,3722
105
- modal/_utils/function_utils.py,sha256=H2dUgV3pAyAzDzdFXiqCZnQ2cgO1tyl9GcHqAP6o_-U,28695
105
+ modal/_utils/function_utils.py,sha256=kBMS4tGarKSKomp4BoxnmaNQ3nu72nodZ05Puqq5gUs,28361
106
106
  modal/_utils/git_utils.py,sha256=qtUU6JAttF55ZxYq51y55OR58B0tDPZsZWK5dJe6W5g,3182
107
107
  modal/_utils/grpc_testing.py,sha256=H1zHqthv19eGPJz2HKXDyWXWGSqO4BRsxah3L5Xaa8A,8619
108
108
  modal/_utils/grpc_utils.py,sha256=mCFloLzXzK3nMyQ2lE6rvMX_7bWBl5TV0YQU6kDDRvA,16468
@@ -160,7 +160,7 @@ modal/experimental/__init__.py,sha256=ls4ScjJOdCXW0HagDOrNTTnkP4_N7y93HUl10jNDrD
160
160
  modal/experimental/flash.py,sha256=ue2lL7W7QNTFOTL7hAPkMe5uy4GD2N2Ae6xTt0oXjPM,31104
161
161
  modal/experimental/flash.pyi,sha256=i03XOnaqrBK6zcvLdJW1KFbv2H9Pv6DxKZOw5kMzaCw,16905
162
162
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
163
- modal-1.2.5.dev15.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
163
+ modal-1.2.5.dev17.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
164
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
165
165
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
166
166
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -188,10 +188,10 @@ modal_proto/task_command_router_pb2.py,sha256=_pD2ZpU0bNzhwBdzmLoLyLtAtftI_Agxwn
188
188
  modal_proto/task_command_router_pb2.pyi,sha256=EyDgXPLr7alqjXYERV8w_MPuO404x0uCppmSkrfE9IE,14589
189
189
  modal_proto/task_command_router_pb2_grpc.py,sha256=uEQ0HdrCp8v-9bB5yIic9muA8spCShLHY6Bz9cCgOUE,10114
190
190
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=s3Yxsrawdj4nr8vqQqsAxyX6ilWaGbdECy425KKbLIA,3301
191
- modal_version/__init__.py,sha256=ERCH8l6zmITx9_jasF4pTQnm3FBtRTecqMHuLbqLVrk,121
191
+ modal_version/__init__.py,sha256=NmIq1t3Cg5zGNEFeo9PglF9NaSBp7qYZ8NdIdj0OOrQ,121
192
192
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
193
- modal-1.2.5.dev15.dist-info/METADATA,sha256=8JtEcZqf5Wh3C6vnvApwAmR9dId8enQG7Aw_dmAUXQY,2490
194
- modal-1.2.5.dev15.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
195
- modal-1.2.5.dev15.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
196
- modal-1.2.5.dev15.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
197
- modal-1.2.5.dev15.dist-info/RECORD,,
193
+ modal-1.2.5.dev17.dist-info/METADATA,sha256=XoQyxq2xzIAWFQK0gpf83hCZcWwy-4vDS9If27_JVC0,2490
194
+ modal-1.2.5.dev17.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
195
+ modal-1.2.5.dev17.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
196
+ modal-1.2.5.dev17.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
197
+ modal-1.2.5.dev17.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.2.5.dev15"
4
+ __version__ = "1.2.5.dev17"