modAL 1.3.1.dev2__py3-none-any.whl → 1.3.1.dev4__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.
@@ -4,7 +4,6 @@ import dataclasses
4
4
  import hashlib
5
5
  import os
6
6
  import platform
7
- import random
8
7
  import time
9
8
  from collections.abc import AsyncIterator
10
9
  from contextlib import AbstractContextManager, contextmanager
@@ -58,10 +57,8 @@ MULTIPART_UPLOAD_THRESHOLD = 1024**3
58
57
  # For block based storage like volumefs2: the size of a block
59
58
  BLOCK_SIZE: int = 8 * 1024 * 1024
60
59
 
61
- HEALTHY_R2_UPLOAD_PERCENTAGE = 0.95
62
60
 
63
-
64
- @retry(n_attempts=5, base_delay=0.5, timeout=None)
61
+ @retry(n_attempts=3, base_delay=0.3, timeout=None)
65
62
  async def _upload_to_s3_url(
66
63
  upload_url,
67
64
  payload: "BytesIOSegmentPayload",
@@ -191,13 +188,10 @@ def get_content_length(data: BinaryIO) -> int:
191
188
  async def _blob_upload_with_fallback(
192
189
  items, blob_ids: list[str], callback, content_length: int
193
190
  ) -> tuple[str, bool, int]:
191
+ """Try uploading to each provider in order, with fallback on failure."""
194
192
  r2_throughput_bytes_s = 0
195
193
  r2_failed = False
196
194
  for idx, (item, blob_id) in enumerate(zip(items, blob_ids)):
197
- # We want to default to R2 95% of the time and S3 5% of the time.
198
- # To ensure the failure path is continuously exercised.
199
- if idx == 0 and len(items) > 1 and random.random() > HEALTHY_R2_UPLOAD_PERCENTAGE:
200
- continue
201
195
  try:
202
196
  if blob_id.endswith(":r2"):
203
197
  t0 = time.monotonic_ns()
@@ -207,7 +201,7 @@ async def _blob_upload_with_fallback(
207
201
  else:
208
202
  await callback(item)
209
203
  return blob_id, r2_failed, r2_throughput_bytes_s
210
- except Exception as _:
204
+ except Exception:
211
205
  if blob_id.endswith(":r2"):
212
206
  r2_failed = True
213
207
  # Ignore all errors except the last one, since we're out of fallback options.
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.dev2",
36
+ version: str = "1.3.1.dev4",
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.dev2",
166
+ version: str = "1.3.1.dev4",
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.3.1.dev2
3
+ Version: 1.3.1.dev4
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -26,7 +26,7 @@ modal/app.pyi,sha256=WR0nGSUh8-8OYRHFqEnijGoPp_IbawNY1JW_0pozXsE,50857
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=zCGUF3RioFCBkCy14L6a3gZ8kvoucamb3bKgVijBo98,14471
29
+ modal/client.pyi,sha256=fc5Dsix89l-sB3KvE7Pb3ysvW4m_xfdIrIecGolAddM,14471
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=Cmqt1vOw0-01ktjJBOrdzvdyDbHpjKMTaZ2eEy_8YUE,41694
@@ -98,7 +98,7 @@ 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=2KQs7W2OwU6-5wxCoYbkt8_sLocDDQSyyBbb1gulZ20,43322
100
100
  modal/_utils/auth_token_manager.py,sha256=QsDokl1c1dN9m6Z9N-Se-8cY3laphByjJtNdRXUTieI,5151
101
- modal/_utils/blob_utils.py,sha256=L4lEL-rvZwoxCxrGaa8zWVoaHjhq1eQfO4SLrvt4g8k,23376
101
+ modal/_utils/blob_utils.py,sha256=LIWNN7w0ma5IG1rP3gaOrn6YKcGTXMbI1_rSpJay8pY,23147
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
@@ -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.dev2.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
161
+ modal-1.3.1.dev4.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=0AlO5a1cQL-5pwDpK4XlTfcYD1BbP5voNFZ8DMSnYK0,120
183
+ modal_version/__init__.py,sha256=ay2uHLq4CuLcSwyQzlly6Bma7JwJr_U1KwTM-6SSmmo,120
184
184
  modal_version/__main__.py,sha256=nLUbubxKx7GXNzJIkTB7M7_u8080LyLM0IS0rzFkC_c,119
185
- modal-1.3.1.dev2.dist-info/METADATA,sha256=z3ClS3lEdrOLP9XxGEtKPgQGakMVOWEp2S1YcG9uCv8,2492
186
- modal-1.3.1.dev2.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
187
- modal-1.3.1.dev2.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
188
- modal-1.3.1.dev2.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
189
- modal-1.3.1.dev2.dist-info/RECORD,,
185
+ modal-1.3.1.dev4.dist-info/METADATA,sha256=taKAoxSViGa9pVmQmX8cO49ImaY3z5UX1AATp9ZkIWk,2492
186
+ modal-1.3.1.dev4.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
187
+ modal-1.3.1.dev4.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
188
+ modal-1.3.1.dev4.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
189
+ modal-1.3.1.dev4.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.dev2"
4
+ __version__ = "1.3.1.dev4"