dayhoff-tools 1.6.5__py3-none-any.whl → 1.6.6__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 dayhoff-tools might be problematic. Click here for more details.

@@ -1860,27 +1860,40 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
1860
1860
 
1861
1861
 
1862
1862
  def _poll_operation(operation_id: str, timeout: int = 600) -> Tuple[bool, str]:
1863
- """Poll /operations/<id> until COMPLETED or FAILED.
1863
+ """Poll `/operations/<id>` until it reports COMPLETED or FAILED.
1864
1864
 
1865
- Returns (True, "") on success or (False, error_message) on failure / timeout.
1866
- Uses a simple status spinner to avoid nested Live displays.
1865
+ Returns (True, "") on success or (False, error_message) on failure or
1866
+ timeout.
1867
+
1868
+ IMPORTANT: This helper deliberately *avoids* creating its own Rich Live/
1869
+ spinner so that it can be called from inside another Progress/Live context
1870
+ (the outer "Attaching studio…" progress bar). Nested Live renderables lead
1871
+ to constant hide/show repaint cycles, which is what caused the flickering
1872
+ the user observed.
1867
1873
  """
1868
1874
  start_ts = time.time()
1869
- with console.status("[cyan]Waiting for studio attach to complete…", spinner="dots") as status:
1870
- while True:
1871
- if time.time() - start_ts > timeout:
1872
- return False, "Timed out waiting for attach operation to complete"
1873
- op_resp = make_api_request("GET", f"/operations/{operation_id}")
1874
- if op_resp.status_code != 200:
1875
- return False, f"Failed to fetch operation status (HTTP {op_resp.status_code})"
1876
- data = op_resp.json()
1877
- op_status = data.get("status")
1878
- if op_status == "COMPLETED":
1879
- return True, ""
1880
- if op_status == "FAILED":
1881
- return False, data.get("error", "Operation failed")
1882
- # keep spinner steady – no constant message updates
1883
- time.sleep(3)
1875
+ while True:
1876
+ # ---- timeout guard -------------------------------------------------
1877
+ if time.time() - start_ts > timeout:
1878
+ return False, "Timed out waiting for attach operation to complete"
1879
+
1880
+ # ---- fetch status ---------------------------------------------------
1881
+ op_resp = make_api_request("GET", f"/operations/{operation_id}")
1882
+ if op_resp.status_code != 200:
1883
+ return False, (
1884
+ f"Failed to fetch operation status (HTTP {op_resp.status_code})"
1885
+ )
1886
+ data = op_resp.json()
1887
+ op_status = data.get("status")
1888
+
1889
+ # ---- interpret state -----------------------------------------------
1890
+ if op_status == "COMPLETED":
1891
+ return True, ""
1892
+ if op_status == "FAILED":
1893
+ return False, data.get("error", "Operation failed")
1894
+
1895
+ # Not finished yet – wait a little and poll again (no live spinner)
1896
+ time.sleep(3)
1884
1897
 
1885
1898
 
1886
1899
  @studio_app.command("detach")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.6.5
3
+ Version: 1.6.6
4
4
  Summary: Common tools for all the repos at Dayhoff Labs
5
5
  Author: Daniel Martin-Alarcon
6
6
  Author-email: dma@dayhofflabs.com
@@ -3,7 +3,7 @@ dayhoff_tools/chemistry/standardizer.py,sha256=uMn7VwHnx02nc404eO6fRuS4rsl4dvSPf
3
3
  dayhoff_tools/chemistry/utils.py,sha256=jt-7JgF-GeeVC421acX-bobKbLU_X94KNOW24p_P-_M,2257
4
4
  dayhoff_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  dayhoff_tools/cli/cloud_commands.py,sha256=33qcWLmq-FwEXMdL3F0OHm-5Stlh2r65CldyEZgQ1no,40904
6
- dayhoff_tools/cli/engine_commands.py,sha256=ohgcLv_y5UjeqBazh_BKnPGXSJn2rDqGCIb91VOUPiU,93633
6
+ dayhoff_tools/cli/engine_commands.py,sha256=7wjf_LN2Woa3cZPcyG7nBY6w-vDTqVGj3JvQCU1nXxM,94059
7
7
  dayhoff_tools/cli/main.py,sha256=tRN7WCBHg6uyNp6rA54pKTCoVmBntta2i0Yas3bUpZ4,4853
8
8
  dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
9
9
  dayhoff_tools/cli/utility_commands.py,sha256=FRZTPrjsG_qmIIqoNxd1Q1vVkS_5w8aY33IrVYVNCLg,18131
@@ -27,7 +27,7 @@ dayhoff_tools/intake/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJq
27
27
  dayhoff_tools/logs.py,sha256=DKdeP0k0kliRcilwvX0mUB2eipO5BdWUeHwh-VnsICs,838
28
28
  dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
29
29
  dayhoff_tools/warehouse.py,sha256=heaYc64qplgN3_1WVPFmqj53goStioWwY5NqlWc4c0s,24453
30
- dayhoff_tools-1.6.5.dist-info/METADATA,sha256=8COj8yPA8o8aeykuMF9Jk_yIzp8wf8184BfST1oFLrs,2914
31
- dayhoff_tools-1.6.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- dayhoff_tools-1.6.5.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
- dayhoff_tools-1.6.5.dist-info/RECORD,,
30
+ dayhoff_tools-1.6.6.dist-info/METADATA,sha256=UG7p9G_i-15hK8hWyeWmY8Sg3rvLoNjKQTt3VyprOpQ,2914
31
+ dayhoff_tools-1.6.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ dayhoff_tools-1.6.6.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
+ dayhoff_tools-1.6.6.dist-info/RECORD,,