modal 0.73.35__py3-none-any.whl → 0.73.37__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
@@ -603,6 +603,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
603
603
  is_builder_function=True,
604
604
  is_auto_snapshot=True,
605
605
  scheduler_placement=scheduler_placement,
606
+ include_source=include_source,
606
607
  )
607
608
  image = _Image._from_args(
608
609
  base_images={"base": image},
@@ -1074,25 +1075,9 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1074
1075
  await retry_transient_errors(self.client.stub.FunctionUpdateSchedulingParams, request)
1075
1076
 
1076
1077
  @classmethod
1077
- @renamed_parameter((2024, 12, 18), "tag", "name")
1078
- def from_name(
1079
- cls: type["_Function"],
1080
- app_name: str,
1081
- name: str,
1082
- namespace=api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
1083
- environment_name: Optional[str] = None,
1084
- ) -> "_Function":
1085
- """Reference a Function from a deployed App by its name.
1086
-
1087
- In contrast to `modal.Function.lookup`, this is a lazy method
1088
- that defers hydrating the local object with metadata from
1089
- Modal servers until the first time it is actually used.
1090
-
1091
- ```python
1092
- f = modal.Function.from_name("other-app", "function")
1093
- ```
1094
- """
1095
-
1078
+ def _from_name(cls, app_name: str, name: str, namespace, environment_name: Optional[str]):
1079
+ # internal function lookup implementation that allows lookup of class "service functions"
1080
+ # in addition to non-class functions
1096
1081
  async def _load_remote(self: _Function, resolver: Resolver, existing_object_id: Optional[str]):
1097
1082
  assert resolver.client and resolver.client.stub
1098
1083
  request = api_pb2.FunctionGetRequest(
@@ -1116,6 +1101,38 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
1116
1101
  rep = f"Function.from_name({app_name}, {name})"
1117
1102
  return cls._from_loader(_load_remote, rep, is_another_app=True, hydrate_lazily=True)
1118
1103
 
1104
+ @classmethod
1105
+ @renamed_parameter((2024, 12, 18), "tag", "name")
1106
+ def from_name(
1107
+ cls: type["_Function"],
1108
+ app_name: str,
1109
+ name: str,
1110
+ namespace=api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
1111
+ environment_name: Optional[str] = None,
1112
+ ) -> "_Function":
1113
+ """Reference a Function from a deployed App by its name.
1114
+
1115
+ In contrast to `modal.Function.lookup`, this is a lazy method
1116
+ that defers hydrating the local object with metadata from
1117
+ Modal servers until the first time it is actually used.
1118
+
1119
+ ```python
1120
+ f = modal.Function.from_name("other-app", "function")
1121
+ ```
1122
+ """
1123
+ if "." in name:
1124
+ class_name, method_name = name.split(".", 1)
1125
+ deprecation_warning(
1126
+ (2025, 2, 11),
1127
+ "Looking up class methods using Function.from_name will be deprecated"
1128
+ " in a future version of Modal.\nUse modal.Cls.from_name instead, e.g.\n\n"
1129
+ f'{class_name} = modal.Cls.from_name("{app_name}", "{class_name}")\n'
1130
+ f"instance = {class_name}(...)\n"
1131
+ f"instance.{method_name}.remote(...)\n",
1132
+ )
1133
+
1134
+ return cls._from_name(app_name, name, namespace, environment_name)
1135
+
1119
1136
  @staticmethod
1120
1137
  @renamed_parameter((2024, 12, 18), "tag", "name")
1121
1138
  async def lookup(
modal/client.pyi CHANGED
@@ -27,7 +27,7 @@ class _Client:
27
27
  _snapshotted: bool
28
28
 
29
29
  def __init__(
30
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.35"
30
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.37"
31
31
  ): ...
32
32
  def is_closed(self) -> bool: ...
33
33
  @property
@@ -85,7 +85,7 @@ class Client:
85
85
  _snapshotted: bool
86
86
 
87
87
  def __init__(
88
- self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.35"
88
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.37"
89
89
  ): ...
90
90
  def is_closed(self) -> bool: ...
91
91
  @property
modal/cls.py CHANGED
@@ -558,9 +558,10 @@ class _Cls(_Object, type_prefix="cs"):
558
558
  cls = cls._from_loader(_load_remote, rep, is_another_app=True, hydrate_lazily=True)
559
559
 
560
560
  class_service_name = f"{name}.*" # special name of the base service function for the class
561
- cls._class_service_function = _Function.from_name(
561
+ cls._class_service_function = _Function._from_name(
562
562
  app_name,
563
563
  class_service_name,
564
+ namespace=namespace,
564
565
  environment_name=_environment_name,
565
566
  )
566
567
  cls._name = name
modal/functions.pyi CHANGED
@@ -116,6 +116,8 @@ class Function(
116
116
 
117
117
  keep_warm: __keep_warm_spec[typing_extensions.Self]
118
118
 
119
+ @classmethod
120
+ def _from_name(cls, app_name: str, name: str, namespace, environment_name: typing.Optional[str]): ...
119
121
  @classmethod
120
122
  def from_name(
121
123
  cls: type[Function], app_name: str, name: str, namespace=1, environment_name: typing.Optional[str] = None
modal/image.py CHANGED
@@ -1924,6 +1924,8 @@ class _Image(_Object, type_prefix="im"):
1924
1924
  region: Optional[Union[str, Sequence[str]]] = None, # Region or regions to run the function on.
1925
1925
  args: Sequence[Any] = (), # Positional arguments to the function.
1926
1926
  kwargs: dict[str, Any] = {}, # Keyword arguments to the function.
1927
+ *,
1928
+ include_source: Optional[bool] = None,
1927
1929
  ) -> "_Image":
1928
1930
  """Run user-defined function `raw_f` as an image build step. The function runs just like an ordinary Modal
1929
1931
  function, and any kwargs accepted by `@app.function` (such as `Mount`s, `NetworkFileSystem`s,
@@ -1979,6 +1981,7 @@ class _Image(_Object, type_prefix="im"):
1979
1981
  timeout=timeout,
1980
1982
  cpu=cpu,
1981
1983
  is_builder_function=True,
1984
+ include_source=include_source,
1982
1985
  )
1983
1986
  if len(args) + len(kwargs) > 0:
1984
1987
  args_serialized = serialize((args, kwargs))
modal/image.pyi CHANGED
@@ -341,6 +341,8 @@ class _Image(modal._object._Object):
341
341
  region: typing.Union[str, collections.abc.Sequence[str], None] = None,
342
342
  args: collections.abc.Sequence[typing.Any] = (),
343
343
  kwargs: dict[str, typing.Any] = {},
344
+ *,
345
+ include_source: typing.Optional[bool] = None,
344
346
  ) -> _Image: ...
345
347
  def env(self, vars: dict[str, str]) -> _Image: ...
346
348
  def workdir(self, path: typing.Union[str, pathlib.PurePosixPath]) -> _Image: ...
@@ -616,6 +618,8 @@ class Image(modal.object.Object):
616
618
  region: typing.Union[str, collections.abc.Sequence[str], None] = None,
617
619
  args: collections.abc.Sequence[typing.Any] = (),
618
620
  kwargs: dict[str, typing.Any] = {},
621
+ *,
622
+ include_source: typing.Optional[bool] = None,
619
623
  ) -> Image: ...
620
624
  def env(self, vars: dict[str, str]) -> Image: ...
621
625
  def workdir(self, path: typing.Union[str, pathlib.PurePosixPath]) -> Image: ...
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.73.35
3
+ Version: 0.73.37
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -3,7 +3,7 @@ modal/__main__.py,sha256=CgIjP8m1xJjjd4AXc-delmR6LdBCZclw2A_V38CFIio,2870
3
3
  modal/_clustered_functions.py,sha256=kTf-9YBXY88NutC1akI-gCbvf01RhMPCw-zoOI_YIUE,2700
4
4
  modal/_clustered_functions.pyi,sha256=vllkegc99A0jrUOWa8mdlSbdp6uz36TsHhGxysAOpaQ,771
5
5
  modal/_container_entrypoint.py,sha256=YtfJ852XUDtAWBD-yVs99zy933-VBEKQyIngEj36Qcw,29286
6
- modal/_functions.py,sha256=Jf1ImQxyNQKHw6ylEUxyTcYwKWWcH5CoilpfZ_tm72g,71510
6
+ modal/_functions.py,sha256=r0g9rVbS1LtbRPGH3E2D7enqNnvIUPlvoPReg0bj-cE,72423
7
7
  modal/_ipython.py,sha256=TW1fkVOmZL3YYqdS2YlM1hqpf654Yf8ZyybHdBnlhSw,301
8
8
  modal/_location.py,sha256=joiX-0ZeutEUDTrrqLF1GHXCdVLF-rHzstocbMcd_-k,366
9
9
  modal/_object.py,sha256=ItQcsMNkz9Y3kdTsvfNarbW-paJ2qabDyQ7njaqY0XI,11359
@@ -22,10 +22,10 @@ modal/app.py,sha256=rCOPD51gVyow8muyaqMuV65qfTnAZKf_w1OCZdSF_6o,44636
22
22
  modal/app.pyi,sha256=0MMCgskIL4r3eq8oBcfm2lLyeao2gXjS3iXaIfmaJ-o,25959
23
23
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
24
24
  modal/client.py,sha256=8SQawr7P1PNUCq1UmJMUQXG2jIo4Nmdcs311XqrNLRE,15276
25
- modal/client.pyi,sha256=zGuFnRO-zNyaRSP8S64WcfhirY9_306lnDr7xCpb_fA,7593
25
+ modal/client.pyi,sha256=UQ-1dL_Pi2gf7_aSprQPscQf-NRdEp6uXKJ7zJwkSUo,7593
26
26
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
27
27
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
28
- modal/cls.py,sha256=5Er9L9tGpLGIrbiHOI7c9266gPG6nhxoJ_BX8op96nU,31096
28
+ modal/cls.py,sha256=nJhJr-YuttOmdNWxtMHcBV-q6iQmY5qXkEy9yO43clY,31130
29
29
  modal/cls.pyi,sha256=QqYoRKVCKhP_HkHittKpEZ6sqXkEdtEl4n1wMqeoe3M,8897
30
30
  modal/config.py,sha256=XT1W4Y9PVkbYMAXjJRshvQEPDhZmnfW_ZRMwl8XKoqA,11149
31
31
  modal/container_process.py,sha256=WTqLn01dJPVkPpwR_0w_JH96ceN5mV4TGtiu1ZR2RRA,6108
@@ -41,10 +41,10 @@ modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
41
41
  modal/file_io.pyi,sha256=NTRft1tbPSWf9TlWVeZmTlgB5AZ_Zhu2srWIrWr7brk,9445
42
42
  modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw,6497
43
43
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
44
- modal/functions.pyi,sha256=R8aCATbAInu3ujJjWh4kASdTmref8Ysnj3X4Bu77ID0,14255
44
+ modal/functions.pyi,sha256=c-EQIGxyDJ5xZqaxXSiMHcuZHpF8ZWxDhrMWhJMyUrU,14378
45
45
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
46
- modal/image.py,sha256=KYc6bg-m9A6wiLF38dWcFBMrEATyR2KOF0sp-6O9uC0,91508
47
- modal/image.pyi,sha256=kMkIDHcyyhA7BC2Vrx0RfrLEsqK8Ng2-IqUKL-CJexI,26250
46
+ modal/image.py,sha256=64xG9QoiGms4N6eVgkbs-PBab5RWSRWVazYCYXqOduY,91609
47
+ modal/image.pyi,sha256=Oc2ndYHSdQTcRpZKHSfTdj-m_2oQAsnc2EWTthbNn-s,26380
48
48
  modal/io_streams.py,sha256=QkQiizKRzd5bnbKQsap31LJgBYlAnj4-XkV_50xPYX0,15079
49
49
  modal/io_streams.pyi,sha256=bJ7ZLmSmJ0nKoa6r4FJpbqvzdUVa0lEe0Fa-MMpMezU,5071
50
50
  modal/mount.py,sha256=hNoy7J-E2C-CkSmbKldfL_zg8db8nP8cVzRj_35Rsp0,32124
@@ -172,10 +172,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
172
172
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
173
173
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
174
174
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
175
- modal_version/_version_generated.py,sha256=wAGaC7NwMRQUUUvT57QmxY3RdcCTvm9pAbVhlIpwHhY,149
176
- modal-0.73.35.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
177
- modal-0.73.35.dist-info/METADATA,sha256=AH-Y6QZZcLPeRkCngemat7i9PoEQXsJpmetQ8W1uzZQ,2330
178
- modal-0.73.35.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
179
- modal-0.73.35.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
180
- modal-0.73.35.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
181
- modal-0.73.35.dist-info/RECORD,,
175
+ modal_version/_version_generated.py,sha256=APmnO7vAiSp5-DV1q3PSPWJrftWZxE9syI-M43jpv_Q,149
176
+ modal-0.73.37.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
177
+ modal-0.73.37.dist-info/METADATA,sha256=6FtctbZVG2Qheb3A_3Sqx6RQy4qbXJBMR9HeQ0FazHw,2330
178
+ modal-0.73.37.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
179
+ modal-0.73.37.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
180
+ modal-0.73.37.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
181
+ modal-0.73.37.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 35 # git: e8d6fd1
4
+ build_number = 37 # git: 60b183a