coiled 1.126.1.dev18__py3-none-any.whl → 1.126.1.dev19__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.

Potentially problematic release.


This version of coiled might be problematic. Click here for more details.

coiled/filestore.py CHANGED
@@ -317,15 +317,35 @@ class FilestoreManagerWithoutHttp:
317
317
  )
318
318
 
319
319
  @classmethod
320
- def download_from_signed_url(cls, local_path, url):
320
+ def download_from_signed_url(cls, local_path, url, max_retries=3, verbose=False):
321
321
  # TODO (performance enhancement) check if file already exists, skip if match, warn if not
322
322
  os.makedirs(os.path.dirname(local_path), exist_ok=True)
323
- # TODO (performance enhancement) stream
323
+
324
+ if verbose:
325
+ print(f"Downloading file from signed URL: {url} to {local_path}")
326
+
324
327
  with httpx.Client(http2=cls.http2) as client:
325
- with open(local_path, "wb") as f:
326
- headers = {"Content-Type": "binary/octet-stream"}
327
- response = client.get(url, timeout=60, headers=headers)
328
- f.write(io.BytesIO(response.content).getbuffer())
328
+ for attempt in range(max_retries):
329
+ try:
330
+ with client.stream("GET", url, timeout=60) as response:
331
+ response.raise_for_status()
332
+ with open(local_path, "wb") as f:
333
+ for chunk in response.iter_bytes(chunk_size=8192):
334
+ f.write(chunk)
335
+ return # Success, exit function
336
+ except (httpx.RemoteProtocolError, httpx.ReadTimeout, httpx.ConnectError) as e:
337
+ if attempt < max_retries - 1:
338
+ wait_time = 2**attempt # Exponential backoff: 1s, 2s, 4s
339
+ if verbose:
340
+ print(
341
+ f"Download failed (attempt {attempt + 1}/{max_retries}): {e}. "
342
+ f"Retrying in {wait_time}s..."
343
+ )
344
+ time.sleep(wait_time)
345
+ else:
346
+ if verbose:
347
+ print(f"Download failed after {max_retries} attempts: {e}")
348
+ raise
329
349
 
330
350
 
331
351
  class FilestoreManager(FilestoreManagerWithoutHttp):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coiled
3
- Version: 1.126.1.dev18
3
+ Version: 1.126.1.dev19
4
4
  Summary: Python client for coiled.io dask clusters
5
5
  Project-URL: Homepage, https://coiled.io
6
6
  Maintainer-email: Coiled <info@coiled.io>
@@ -12,7 +12,7 @@ coiled/context.py,sha256=MXWsW0swdYU-x32U7NiM0xt-t65maiEO8rvsGGeScFw,4754
12
12
  coiled/core.py,sha256=Cu6hKBXRWSztbpF8huAyU_1glnt1gacnO9vExvG-Cwo,110796
13
13
  coiled/errors.py,sha256=5aXhNXgidMm0VgPYT3MZMwlHhRE57MeSmqAJFHYaa8Y,305
14
14
  coiled/exceptions.py,sha256=jUXgmfO0LitGe8ztSmAlzb9eQV3X5c0kNO2BwtEDTYg,3099
15
- coiled/filestore.py,sha256=0WKjjZVAJ2yxA1Oldfc1pUxj391aEAiSDtbC8qJCMvA,13445
15
+ coiled/filestore.py,sha256=EHgpXw5xPtwR9EMf-gUpAUsXTYxUmTX7zZboIHlkjAE,14424
16
16
  coiled/function.py,sha256=pONtcTUDRr0dykhVV73AWXqU_pb-4-lvOA0tR3i_PlA,21654
17
17
  coiled/plugins.py,sha256=w03H2Sck54QmwrVOM1BVscNiVeQsHyGm1yWNzPPPWKs,3424
18
18
  coiled/prefect.py,sha256=j1EOg7Xuw82TNRonAGEoZ3ANlwN8GM5aDXRYSjC0lnA,1497
@@ -94,8 +94,8 @@ coiled/v2/widgets/__init__.py,sha256=Bt3GHTTyri-kFUaqGRVydDM-sCg5NdNujDg2RyvgV8U
94
94
  coiled/v2/widgets/interface.py,sha256=YeMQ5qdRbbpM04x9qIg2LE1xwxyRxFbdDYnkrwHazPk,301
95
95
  coiled/v2/widgets/rich.py,sha256=3rU5-yso92NdeEh3uSvEE-GwPNyp6i0Nb5PE5czXCik,28974
96
96
  coiled/v2/widgets/util.py,sha256=Y8qpGqwNzqfCzgyRFRy7vcscBoXqop-Upi4HLPpXLgg,3120
97
- coiled-1.126.1.dev18.dist-info/METADATA,sha256=5j8wxyEXv1GqCjfsvRTVH5pugBr7vL9GEDjnVJJuOCg,2182
98
- coiled-1.126.1.dev18.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
- coiled-1.126.1.dev18.dist-info/entry_points.txt,sha256=C8dz1ST_bTlTO-kNvuHBJQma9PyJPotg0S4xpPt5aHY,47
100
- coiled-1.126.1.dev18.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
101
- coiled-1.126.1.dev18.dist-info/RECORD,,
97
+ coiled-1.126.1.dev19.dist-info/METADATA,sha256=ZjQRzjpmjVrLmzJsWaOoDV3JR-mjVWg0fNUuxKCWQRo,2182
98
+ coiled-1.126.1.dev19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
99
+ coiled-1.126.1.dev19.dist-info/entry_points.txt,sha256=C8dz1ST_bTlTO-kNvuHBJQma9PyJPotg0S4xpPt5aHY,47
100
+ coiled-1.126.1.dev19.dist-info/licenses/LICENSE,sha256=ZPwVR73Biwm3sK6vR54djCrhaRiM4cAD2zvOQZV8Xis,3859
101
+ coiled-1.126.1.dev19.dist-info/RECORD,,