modal 0.67.22__py3-none-any.whl → 0.67.25__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.
@@ -248,7 +248,13 @@ class FunctionInfo:
248
248
  def get_globals(self) -> dict[str, Any]:
249
249
  from .._vendor.cloudpickle import _extract_code_globals
250
250
 
251
+ if self.raw_f is None:
252
+ return {}
253
+
251
254
  func = self.raw_f
255
+ while hasattr(func, "__wrapped__") and func is not func.__wrapped__:
256
+ # Unwrap functions decorated using functools.wrapped (potentially multiple times)
257
+ func = func.__wrapped__
252
258
  f_globals_ref = _extract_code_globals(func.__code__)
253
259
  f_globals = {k: func.__globals__[k] for k in f_globals_ref if k in func.__globals__}
254
260
  return f_globals
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.67.22"
29
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.25"
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.67.22"
84
+ self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.67.25"
85
85
  ): ...
86
86
  def is_closed(self) -> bool: ...
87
87
  @property
modal/cls.py CHANGED
@@ -90,10 +90,9 @@ class _Obj:
90
90
 
91
91
  def __init__(
92
92
  self,
93
- user_cls: type,
93
+ user_cls: Optional[type], # this would be None in case of lookups
94
94
  class_service_function: Optional[_Function], # only None for <v0.63 classes
95
95
  classbound_methods: dict[str, _Function],
96
- from_other_workspace: bool,
97
96
  options: Optional[api_pb2.FunctionOptions],
98
97
  args,
99
98
  kwargs,
@@ -107,9 +106,7 @@ class _Obj:
107
106
  if class_service_function:
108
107
  # >= v0.63 classes
109
108
  # first create the singular object function used by all methods on this parameterization
110
- self._instance_service_function = class_service_function._bind_parameters(
111
- self, from_other_workspace, options, args, kwargs
112
- )
109
+ self._instance_service_function = class_service_function._bind_parameters(self, options, args, kwargs)
113
110
  for method_name, class_bound_method in classbound_methods.items():
114
111
  method = self._instance_service_function._bind_instance_method(class_bound_method)
115
112
  self._method_functions[method_name] = method
@@ -117,7 +114,7 @@ class _Obj:
117
114
  # looked up <v0.63 classes - bind each individual method to the new parameters
118
115
  self._instance_service_function = None
119
116
  for method_name, class_bound_method in classbound_methods.items():
120
- method = class_bound_method._bind_parameters(self, from_other_workspace, options, args, kwargs)
117
+ method = class_bound_method._bind_parameters(self, options, args, kwargs)
121
118
  self._method_functions[method_name] = method
122
119
 
123
120
  # Used for construction local object lazily
@@ -247,7 +244,6 @@ class _Cls(_Object, type_prefix="cs"):
247
244
  _method_functions: Optional[dict[str, _Function]] = None # Placeholder _Functions for each method
248
245
  _options: Optional[api_pb2.FunctionOptions]
249
246
  _callables: dict[str, Callable[..., Any]]
250
- _from_other_workspace: Optional[bool] # Functions require FunctionBindParams before invocation.
251
247
  _app: Optional["modal.app._App"] = None # not set for lookups
252
248
 
253
249
  def _initialize_from_empty(self):
@@ -255,7 +251,6 @@ class _Cls(_Object, type_prefix="cs"):
255
251
  self._class_service_function = None
256
252
  self._options = None
257
253
  self._callables = {}
258
- self._from_other_workspace = None
259
254
 
260
255
  def _initialize_from_other(self, other: "_Cls"):
261
256
  self._user_cls = other._user_cls
@@ -263,7 +258,6 @@ class _Cls(_Object, type_prefix="cs"):
263
258
  self._method_functions = other._method_functions
264
259
  self._options = other._options
265
260
  self._callables = other._callables
266
- self._from_other_workspace = other._from_other_workspace
267
261
 
268
262
  def _get_partial_functions(self) -> dict[str, _PartialFunction]:
269
263
  if not self._user_cls:
@@ -382,7 +376,6 @@ class _Cls(_Object, type_prefix="cs"):
382
376
  cls._class_service_function = class_service_function
383
377
  cls._method_functions = method_functions
384
378
  cls._callables = callables
385
- cls._from_other_workspace = False
386
379
  return cls
387
380
 
388
381
  def _uses_common_service_function(self):
@@ -449,7 +442,6 @@ class _Cls(_Object, type_prefix="cs"):
449
442
 
450
443
  rep = f"Ref({app_name})"
451
444
  cls = cls._from_loader(_load_remote, rep, is_another_app=True)
452
- cls._from_other_workspace = bool(workspace is not None)
453
445
  return cls
454
446
 
455
447
  def with_options(
@@ -543,7 +535,6 @@ class _Cls(_Object, type_prefix="cs"):
543
535
  self._user_cls,
544
536
  self._class_service_function,
545
537
  self._method_functions,
546
- self._from_other_workspace,
547
538
  self._options,
548
539
  args,
549
540
  kwargs,
modal/cls.pyi CHANGED
@@ -30,10 +30,9 @@ class _Obj:
30
30
  def _uses_common_service_function(self): ...
31
31
  def __init__(
32
32
  self,
33
- user_cls: type,
33
+ user_cls: typing.Optional[type],
34
34
  class_service_function: typing.Optional[modal.functions._Function],
35
35
  classbound_methods: dict[str, modal.functions._Function],
36
- from_other_workspace: bool,
37
36
  options: typing.Optional[modal_proto.api_pb2.FunctionOptions],
38
37
  args,
39
38
  kwargs,
@@ -58,10 +57,9 @@ class Obj:
58
57
 
59
58
  def __init__(
60
59
  self,
61
- user_cls: type,
60
+ user_cls: typing.Optional[type],
62
61
  class_service_function: typing.Optional[modal.functions.Function],
63
62
  classbound_methods: dict[str, modal.functions.Function],
64
- from_other_workspace: bool,
65
63
  options: typing.Optional[modal_proto.api_pb2.FunctionOptions],
66
64
  args,
67
65
  kwargs,
@@ -90,7 +88,6 @@ class _Cls(modal.object._Object):
90
88
  _method_functions: typing.Optional[dict[str, modal.functions._Function]]
91
89
  _options: typing.Optional[modal_proto.api_pb2.FunctionOptions]
92
90
  _callables: dict[str, typing.Callable[..., typing.Any]]
93
- _from_other_workspace: typing.Optional[bool]
94
91
  _app: typing.Optional[modal.app._App]
95
92
 
96
93
  def _initialize_from_empty(self): ...
@@ -142,7 +139,6 @@ class Cls(modal.object.Object):
142
139
  _method_functions: typing.Optional[dict[str, modal.functions.Function]]
143
140
  _options: typing.Optional[modal_proto.api_pb2.FunctionOptions]
144
141
  _callables: dict[str, typing.Callable[..., typing.Any]]
145
- _from_other_workspace: typing.Optional[bool]
146
142
  _app: typing.Optional[modal.app.App]
147
143
 
148
144
  def __init__(self, *args, **kwargs): ...
modal/functions.py CHANGED
@@ -982,7 +982,6 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
982
982
  def _bind_parameters(
983
983
  self,
984
984
  obj: "modal.cls._Obj",
985
- from_other_workspace: bool,
986
985
  options: Optional[api_pb2.FunctionOptions],
987
986
  args: Sized,
988
987
  kwargs: dict[str, Any],
@@ -993,7 +992,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
993
992
  """
994
993
 
995
994
  # In some cases, reuse the base function, i.e. not create new clones of each method or the "service function"
996
- can_use_parent = len(args) + len(kwargs) == 0 and not from_other_workspace and options is None
995
+ can_use_parent = len(args) + len(kwargs) == 0 and options is None
997
996
  parent = self
998
997
 
999
998
  async def _load(param_bound_func: _Function, resolver: Resolver, existing_object_id: Optional[str]):
modal/functions.pyi CHANGED
@@ -200,7 +200,6 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.
200
200
  def _bind_parameters(
201
201
  self,
202
202
  obj: modal.cls._Obj,
203
- from_other_workspace: bool,
204
203
  options: typing.Optional[modal_proto.api_pb2.FunctionOptions],
205
204
  args: collections.abc.Sized,
206
205
  kwargs: dict[str, typing.Any],
@@ -370,7 +369,6 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
370
369
  def _bind_parameters(
371
370
  self,
372
371
  obj: modal.cls.Obj,
373
- from_other_workspace: bool,
374
372
  options: typing.Optional[modal_proto.api_pb2.FunctionOptions],
375
373
  args: collections.abc.Sized,
376
374
  kwargs: dict[str, typing.Any],
@@ -459,11 +457,11 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
459
457
 
460
458
  _call_generator_nowait: ___call_generator_nowait_spec
461
459
 
462
- class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
460
+ class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
463
461
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
464
462
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
465
463
 
466
- remote: __remote_spec[ReturnType, P]
464
+ remote: __remote_spec[P, ReturnType]
467
465
 
468
466
  class __remote_gen_spec(typing_extensions.Protocol):
469
467
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -475,17 +473,17 @@ class Function(typing.Generic[P, ReturnType, OriginalReturnType], modal.object.O
475
473
  def _get_obj(self) -> typing.Optional[modal.cls.Obj]: ...
476
474
  def local(self, *args: P.args, **kwargs: P.kwargs) -> OriginalReturnType: ...
477
475
 
478
- class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
476
+ class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
479
477
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
480
478
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
481
479
 
482
- _experimental_spawn: ___experimental_spawn_spec[ReturnType, P]
480
+ _experimental_spawn: ___experimental_spawn_spec[P, ReturnType]
483
481
 
484
- class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER]):
482
+ class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER]):
485
483
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
486
484
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
487
485
 
488
- spawn: __spawn_spec[ReturnType, P]
486
+ spawn: __spawn_spec[P, ReturnType]
489
487
 
490
488
  def get_raw_f(self) -> typing.Callable[..., typing.Any]: ...
491
489
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: modal
3
- Version: 0.67.22
3
+ Version: 0.67.25
4
4
  Summary: Python client library for Modal
5
5
  Author: Modal Labs
6
6
  Author-email: support@modal.com
@@ -19,11 +19,11 @@ modal/app.py,sha256=EJ7FUN6rWnSwLJoYJh8nmKg_t-8hdN8_rt0OrkP7JvQ,46084
19
19
  modal/app.pyi,sha256=BE5SlR5tRECuc6-e2lUuOknDdov3zxgZ4N0AsLb5ZVQ,25270
20
20
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
21
21
  modal/client.py,sha256=VMg_aIuo_LOEe2ttxBHEND3PLhTp5lo-onH4wELhIyY,16375
22
- modal/client.pyi,sha256=LBgKSqDZ1yCcjrp7XoJpGUCvx8T4Wfivzk85Mu5X3go,7354
22
+ modal/client.pyi,sha256=trOibxN1Vr90huSHLpzaRB1dcFw-cAe7XNhao3J7IOw,7354
23
23
  modal/cloud_bucket_mount.py,sha256=G7T7jWLD0QkmrfKR75mSTwdUZ2xNfj7pkVqb4ipmxmI,5735
24
24
  modal/cloud_bucket_mount.pyi,sha256=CEi7vrH3kDUF4LAy4qP6tfImy2UJuFRcRbsgRNM1wo8,1403
25
- modal/cls.py,sha256=F2jk5zFCAA8h-GfM0dbdBG3Mu5wiG9k9Z9JLYRYuT2Q,24758
26
- modal/cls.pyi,sha256=2_nbvSlkh2d0tfibTIxsThPiL0Xcrcosc5f_ET-i0sk,8147
25
+ modal/cls.py,sha256=thVWlCLbRmCDKN-B4A72984-Wx9X8lUK_dv8u7Q6yu8,24345
26
+ modal/cls.pyi,sha256=hnBYiTULnN0Fsqcaoi3oD-pYOdunW_iypM0QPzkR_GY,8011
27
27
  modal/config.py,sha256=1KhNJkjYsJkX1V8RPPdRYPlM2HE-ZZs0JVSxbiXjmrw,11010
28
28
  modal/container_process.py,sha256=YRCKjn56oqTtGjtLxpl_KSkOhYrcRitgF3LOI6o14Q4,5759
29
29
  modal/container_process.pyi,sha256=k2kClwaSzz11eci1pzFZgCm-ptXapHAyHTOENorlazA,2594
@@ -33,8 +33,8 @@ modal/environments.py,sha256=5cgA-zbm6ngKLsRA19zSOgtgo9-BarJK3FJK0BiF2Lo,6505
33
33
  modal/environments.pyi,sha256=XalNpiPkAtHWAvOU2Cotq0ozmtl-Jv0FDsR8h9mr27Q,3521
34
34
  modal/exception.py,sha256=EBkdWVved2XEPsXaoPRu56xfxFFHL9iuqvUsdj42WDA,6392
35
35
  modal/experimental.py,sha256=jFuNbwrNHos47viMB9q-cHJSvf2RDxDdoEcss9plaZE,2302
36
- modal/functions.py,sha256=b8ZO2OQSGf78B3FiF7pmBFEE0svFBSm_XX95cdzEyxI,70003
37
- modal/functions.pyi,sha256=fifvDS5GDEYmXjko1UGZrKqmhfnQn6GRwCblM9hrRWo,25107
36
+ modal/functions.py,sha256=fOAYQuDXUQ7O_6GMlHGxYlDyNhyc1sfsb_w7u7drLJU,69938
37
+ modal/functions.pyi,sha256=uso8NOeCB2IEibRIdqBRrEgJagD8erz_RuLjQ4VbJ6I,25035
38
38
  modal/gpu.py,sha256=r4rL6uH3UJIQthzYvfWauXNyh01WqCPtKZCmmSX1fd4,6881
39
39
  modal/image.py,sha256=ZIC8tgjJnqWamN4sZ0Gch3x2VmcM671MWfRLR5SMmoc,79423
40
40
  modal/image.pyi,sha256=JjicLNuaBsfuPZ_xo_eN0zKZkDrEm2alYg-szENhJjM,24591
@@ -83,7 +83,7 @@ modal/_utils/__init__.py,sha256=waLjl5c6IPDhSsdWAm9Bji4e2PVxamYABKAze6CHVXY,28
83
83
  modal/_utils/app_utils.py,sha256=88BT4TPLWfYAQwKTHcyzNQRHg8n9B-QE2UyJs96iV-0,108
84
84
  modal/_utils/async_utils.py,sha256=9ubwMkwiDB4gzOYG2jL9j7Fs-5dxHjcifZe3r7JRg-k,25091
85
85
  modal/_utils/blob_utils.py,sha256=0k_qUpO5GHnz538wjRhyRw4NdJ5O322N7QSilIu32jw,16601
86
- modal/_utils/function_utils.py,sha256=SkT5emqGJ8NNASk0BlBmgDfDBUYAkUM851K74qCHL98,24641
86
+ modal/_utils/function_utils.py,sha256=GV-mq6sSGXQIX5PcExYWJMaWY9YLjChjsiQjg-oPvm8,24902
87
87
  modal/_utils/grpc_testing.py,sha256=iqM9n5M0cWUUIIWNaEDer_pIfPnzXdZBO4L8FVbNepQ,8309
88
88
  modal/_utils/grpc_utils.py,sha256=PPB5ay-vXencXNIWPVw5modr3EH7gfq2QPcO5YJ1lMU,7737
89
89
  modal/_utils/hash_utils.py,sha256=xKwSI1eQobyWNdJwyLO59eB241LOXmQ6QvtzJsyIMcw,1784
@@ -159,10 +159,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
159
159
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
160
  modal_version/__init__.py,sha256=3IY-AWLH55r35_mQXIaut0jrJvoPuf1NZJBQQfSbPuo,470
161
161
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
162
- modal_version/_version_generated.py,sha256=gdQaGdaFF6o5OAu7TdkJGYiu36iikOeaOFgnyHuuw1w,149
163
- modal-0.67.22.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
- modal-0.67.22.dist-info/METADATA,sha256=djlJg0n2_mElTJKrulV80jKUkzhGTiLW7DhHRlDTL0k,2329
165
- modal-0.67.22.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
- modal-0.67.22.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
- modal-0.67.22.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
- modal-0.67.22.dist-info/RECORD,,
162
+ modal_version/_version_generated.py,sha256=uAhpYn_SMPAv5tWusHWQddyfKAV9HgEGR6ivI5spTbQ,149
163
+ modal-0.67.25.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
+ modal-0.67.25.dist-info/METADATA,sha256=g7RY-cXFWr4e_pHAYSacgL6tVwCrgny81vIJHS0l1Uk,2329
165
+ modal-0.67.25.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
166
+ modal-0.67.25.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
167
+ modal-0.67.25.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
168
+ modal-0.67.25.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2024
2
2
 
3
3
  # Note: Reset this value to -1 whenever you make a minor `0.X` release of the client.
4
- build_number = 22 # git: eb2defd
4
+ build_number = 25 # git: 3ff7f8f