modal 0.73.112__py3-none-any.whl → 0.73.114__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 +2 -7
- modal/_utils/git_utils.py +24 -0
- modal/client.pyi +2 -2
- modal/config.py +0 -1
- modal/functions.pyi +6 -6
- {modal-0.73.112.dist-info → modal-0.73.114.dist-info}/METADATA +1 -1
- {modal-0.73.112.dist-info → modal-0.73.114.dist-info}/RECORD +12 -12
- {modal-0.73.112.dist-info → modal-0.73.114.dist-info}/WHEEL +1 -1
- modal_version/_version_generated.py +1 -1
- {modal-0.73.112.dist-info → modal-0.73.114.dist-info}/LICENSE +0 -0
- {modal-0.73.112.dist-info → modal-0.73.114.dist-info}/entry_points.txt +0 -0
- {modal-0.73.112.dist-info → modal-0.73.114.dist-info}/top_level.txt +0 -0
modal/_functions.py
CHANGED
@@ -245,8 +245,7 @@ class _Invocation:
|
|
245
245
|
or not ctx.retry_policy
|
246
246
|
or ctx.retry_policy.retries == 0
|
247
247
|
or ctx.function_call_invocation_type != api_pb2.FUNCTION_CALL_INVOCATION_TYPE_SYNC
|
248
|
-
|
249
|
-
# or not ctx.sync_client_retries_enabled
|
248
|
+
or not ctx.sync_client_retries_enabled
|
250
249
|
):
|
251
250
|
return await self._get_single_output()
|
252
251
|
|
@@ -1311,16 +1310,12 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
1311
1310
|
yield item
|
1312
1311
|
|
1313
1312
|
async def _call_function(self, args, kwargs) -> ReturnType:
|
1314
|
-
if config.get("client_retries"):
|
1315
|
-
function_call_invocation_type = api_pb2.FUNCTION_CALL_INVOCATION_TYPE_SYNC
|
1316
|
-
else:
|
1317
|
-
function_call_invocation_type = api_pb2.FUNCTION_CALL_INVOCATION_TYPE_SYNC_LEGACY
|
1318
1313
|
invocation = await _Invocation.create(
|
1319
1314
|
self,
|
1320
1315
|
args,
|
1321
1316
|
kwargs,
|
1322
1317
|
client=self.client,
|
1323
|
-
function_call_invocation_type=
|
1318
|
+
function_call_invocation_type=api_pb2.FUNCTION_CALL_INVOCATION_TYPE_SYNC,
|
1324
1319
|
)
|
1325
1320
|
|
1326
1321
|
return await invocation.run_function()
|
modal/_utils/git_utils.py
CHANGED
@@ -24,6 +24,25 @@ async def run_command_fallible(args: list[str]) -> Optional[str]:
|
|
24
24
|
return None
|
25
25
|
|
26
26
|
|
27
|
+
def is_valid_commit_info(commit_info: api_pb2.CommitInfo) -> tuple[bool, str]:
|
28
|
+
# returns (valid, error_message)
|
29
|
+
if commit_info.vcs != "git":
|
30
|
+
return False, "Invalid VCS"
|
31
|
+
if len(commit_info.commit_hash) != 40:
|
32
|
+
return False, "Invalid commit hash"
|
33
|
+
if len(commit_info.branch) > 255:
|
34
|
+
# Git doesn't enforce a max length for branch names, but github does, so use their limit
|
35
|
+
# https://stackoverflow.com/questions/24014361/max-length-of-git-branch-name
|
36
|
+
return False, "Branch name too long"
|
37
|
+
if len(commit_info.repo_url) > 200:
|
38
|
+
return False, "Repo URL too long"
|
39
|
+
if len(commit_info.author_name) > 200:
|
40
|
+
return False, "Author name too long"
|
41
|
+
if len(commit_info.author_email) > 200:
|
42
|
+
return False, "Author email too long"
|
43
|
+
return True, ""
|
44
|
+
|
45
|
+
|
27
46
|
async def get_git_commit_info() -> Optional[api_pb2.CommitInfo]:
|
28
47
|
"""Collect git information about the current repository asynchronously."""
|
29
48
|
git_info: api_pb2.CommitInfo = api_pb2.CommitInfo(vcs="git")
|
@@ -69,4 +88,9 @@ async def get_git_commit_info() -> Optional[api_pb2.CommitInfo]:
|
|
69
88
|
if origin_url:
|
70
89
|
git_info.repo_url = origin_url
|
71
90
|
|
91
|
+
valid, error_message = is_valid_commit_info(git_info)
|
92
|
+
if not valid:
|
93
|
+
logger.warning(f"Invalid commit info: {error_message}")
|
94
|
+
return None
|
95
|
+
|
72
96
|
return git_info
|
modal/client.pyi
CHANGED
@@ -31,7 +31,7 @@ class _Client:
|
|
31
31
|
server_url: str,
|
32
32
|
client_type: int,
|
33
33
|
credentials: typing.Optional[tuple[str, str]],
|
34
|
-
version: str = "0.73.
|
34
|
+
version: str = "0.73.114",
|
35
35
|
): ...
|
36
36
|
def is_closed(self) -> bool: ...
|
37
37
|
@property
|
@@ -93,7 +93,7 @@ class Client:
|
|
93
93
|
server_url: str,
|
94
94
|
client_type: int,
|
95
95
|
credentials: typing.Optional[tuple[str, str]],
|
96
|
-
version: str = "0.73.
|
96
|
+
version: str = "0.73.114",
|
97
97
|
): ...
|
98
98
|
def is_closed(self) -> bool: ...
|
99
99
|
@property
|
modal/config.py
CHANGED
@@ -230,7 +230,6 @@ _SETTINGS = {
|
|
230
230
|
"image_builder_version": _Setting(),
|
231
231
|
"strict_parameters": _Setting(False, transform=_to_boolean), # For internal/experimental use
|
232
232
|
"snapshot_debug": _Setting(False, transform=_to_boolean),
|
233
|
-
"client_retries": _Setting(False, transform=_to_boolean), # For internal testing.
|
234
233
|
"cuda_checkpoint_path": _Setting("/__modal/.bin/cuda-checkpoint"), # Used for snapshotting GPU memory.
|
235
234
|
}
|
236
235
|
|
modal/functions.pyi
CHANGED
@@ -198,11 +198,11 @@ class Function(
|
|
198
198
|
|
199
199
|
_call_generator_nowait: ___call_generator_nowait_spec[typing_extensions.Self]
|
200
200
|
|
201
|
-
class __remote_spec(typing_extensions.Protocol[
|
201
|
+
class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
202
202
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
203
203
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
204
204
|
|
205
|
-
remote: __remote_spec[modal._functions.
|
205
|
+
remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
206
206
|
|
207
207
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
208
208
|
def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
|
@@ -217,19 +217,19 @@ class Function(
|
|
217
217
|
self, *args: modal._functions.P.args, **kwargs: modal._functions.P.kwargs
|
218
218
|
) -> modal._functions.OriginalReturnType: ...
|
219
219
|
|
220
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
220
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
221
221
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
222
222
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
223
223
|
|
224
224
|
_experimental_spawn: ___experimental_spawn_spec[
|
225
|
-
modal._functions.
|
225
|
+
modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
|
226
226
|
]
|
227
227
|
|
228
|
-
class __spawn_spec(typing_extensions.Protocol[
|
228
|
+
class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
229
229
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
230
230
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
231
231
|
|
232
|
-
spawn: __spawn_spec[modal._functions.
|
232
|
+
spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
233
233
|
|
234
234
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
|
235
235
|
|
@@ -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=arhkIoF8nQNfa4iwYGSoqN3QMDg5M38QNAODXC8TlKc,29301
|
6
|
-
modal/_functions.py,sha256=
|
6
|
+
modal/_functions.py,sha256=B2pf6yN3MI07j9TdyJ-fSLUHXUjrLJzEby37I8WhKnc,72826
|
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=JBIECWdfpRKCaCxVWZbC3Q1kF5Whk_EKvY9f4Y6AFyg,11446
|
@@ -22,12 +22,12 @@ modal/app.py,sha256=ojhuLZuNZAQ1OsbDH0k6G4pm1W7bOIvZfXbaKlvQ-Ao,45622
|
|
22
22
|
modal/app.pyi,sha256=tZFbcsu20SuvfB2puxCyuXLFNJ9bQulzag55rVpgZmc,26827
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
24
24
|
modal/client.py,sha256=j9D3hNis1lfhnz9lVFGgJgowbH3PaGUzNKgHPWYG778,15372
|
25
|
-
modal/client.pyi,sha256=
|
25
|
+
modal/client.pyi,sha256=h-8XDhigD3KSUiMGL2K0ORIWrVgvRzWxIgOsmXD4t9o,7661
|
26
26
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
|
28
28
|
modal/cls.py,sha256=JhDbaZZHN52lqA_roY1BCbcN9BvbkUcdXiM2Kg9lIc0,31717
|
29
29
|
modal/cls.pyi,sha256=ZJUwtRaQBGlM6tphvnv49FHBVDSgttMdD_LnYyRSKJM,10302
|
30
|
-
modal/config.py,sha256=
|
30
|
+
modal/config.py,sha256=Zx7YsllgIJzMRKeIkaGSLLtMFV4kTUvGxpptnmqlP1U,11623
|
31
31
|
modal/container_process.py,sha256=WTqLn01dJPVkPpwR_0w_JH96ceN5mV4TGtiu1ZR2RRA,6108
|
32
32
|
modal/container_process.pyi,sha256=Hf0J5JyDdCCXBJSKx6gvkPOo0XrztCm78xzxamtzUjQ,2828
|
33
33
|
modal/dict.py,sha256=3Pb45IkfqcDGXu3VVStJVbC_QYk6RTRXrMbZxtByAAk,13354
|
@@ -41,7 +41,7 @@ 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=
|
44
|
+
modal/functions.pyi,sha256=D-PDJfSbwqMDXdq7Bxu2ErZRENo-tRgu_zPoB-jl0OU,14377
|
45
45
|
modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
|
46
46
|
modal/image.py,sha256=Q-zNKdDmn7HHRv8YW7cIVYD1lbsOiiRuWfTZqLjGu2U,92189
|
47
47
|
modal/image.pyi,sha256=DQ4DLOCPr6_yV7z4LS0bTY0rOyvQP9-dQOrzaW7pPG8,25260
|
@@ -99,7 +99,7 @@ modal/_utils/bytes_io_segment_payload.py,sha256=uunxVJS4PE1LojF_UpURMzVK9GuvmYWR
|
|
99
99
|
modal/_utils/deprecation.py,sha256=EXP1beU4pmEqEzWMLw6E3kUfNfpmNA_VOp6i0EHi93g,4856
|
100
100
|
modal/_utils/docker_utils.py,sha256=h1uETghR40mp_y3fSWuZAfbIASH1HMzuphJHghAL6DU,3722
|
101
101
|
modal/_utils/function_utils.py,sha256=OqsmLKOqSenxkXiNSPUWpKqD5KotySa_Omw1tmt97K0,27380
|
102
|
-
modal/_utils/git_utils.py,sha256
|
102
|
+
modal/_utils/git_utils.py,sha256=qtUU6JAttF55ZxYq51y55OR58B0tDPZsZWK5dJe6W5g,3182
|
103
103
|
modal/_utils/grpc_testing.py,sha256=H1zHqthv19eGPJz2HKXDyWXWGSqO4BRsxah3L5Xaa8A,8619
|
104
104
|
modal/_utils/grpc_utils.py,sha256=wmMydVKN9YbugTwUXuOuzxbpzYvxkTDaFRxlBtIDE_0,8526
|
105
105
|
modal/_utils/hash_utils.py,sha256=zg3J6OGxTFGSFri1qQ12giDz90lWk8bzaxCTUCRtiX4,3034
|
@@ -170,10 +170,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
|
|
170
170
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
171
171
|
modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
|
172
172
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
173
|
-
modal_version/_version_generated.py,sha256=
|
174
|
-
modal-0.73.
|
175
|
-
modal-0.73.
|
176
|
-
modal-0.73.
|
177
|
-
modal-0.73.
|
178
|
-
modal-0.73.
|
179
|
-
modal-0.73.
|
173
|
+
modal_version/_version_generated.py,sha256=ROjaB34WYOCoibKCJBxkpTX-8P-A4xP5WrbxQiinFKw,150
|
174
|
+
modal-0.73.114.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
175
|
+
modal-0.73.114.dist-info/METADATA,sha256=TNknT3Jat8Rfo28q8ua9i7qsXa4ZAXyjpsKU8jD7gl8,2453
|
176
|
+
modal-0.73.114.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
177
|
+
modal-0.73.114.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
178
|
+
modal-0.73.114.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
179
|
+
modal-0.73.114.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|