stores 0.1.7.dev4__py3-none-any.whl → 0.1.7.dev6__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.
- stores/indexes/venv_utils.py +38 -10
- {stores-0.1.7.dev4.dist-info → stores-0.1.7.dev6.dist-info}/METADATA +1 -1
- {stores-0.1.7.dev4.dist-info → stores-0.1.7.dev6.dist-info}/RECORD +5 -5
- {stores-0.1.7.dev4.dist-info → stores-0.1.7.dev6.dist-info}/WHEEL +0 -0
- {stores-0.1.7.dev4.dist-info → stores-0.1.7.dev6.dist-info}/licenses/LICENSE +0 -0
stores/indexes/venv_utils.py
CHANGED
@@ -5,6 +5,7 @@ import json
|
|
5
5
|
import logging
|
6
6
|
import os
|
7
7
|
import pickle
|
8
|
+
import queue
|
8
9
|
import socket
|
9
10
|
import subprocess
|
10
11
|
import sys
|
@@ -340,16 +341,43 @@ def parse_tool_signature(
|
|
340
341
|
elif signature_dict.get("isgeneratorfunction"):
|
341
342
|
|
342
343
|
def func_handler(*args, **kwargs):
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
344
|
+
q = queue.Queue()
|
345
|
+
sentinel = object()
|
346
|
+
|
347
|
+
def run():
|
348
|
+
async def runner():
|
349
|
+
try:
|
350
|
+
async for item in run_remote_tool(
|
351
|
+
tool_id=signature_dict["tool_id"],
|
352
|
+
index_folder=index_folder,
|
353
|
+
args=args,
|
354
|
+
kwargs=kwargs,
|
355
|
+
venv=venv,
|
356
|
+
env_var=env_var,
|
357
|
+
stream=True,
|
358
|
+
):
|
359
|
+
q.put(item)
|
360
|
+
except Exception as e:
|
361
|
+
q.put(e)
|
362
|
+
finally:
|
363
|
+
q.put(sentinel)
|
364
|
+
|
365
|
+
asyncio.run(runner())
|
366
|
+
|
367
|
+
t = threading.Thread(target=run)
|
368
|
+
t.start()
|
369
|
+
|
370
|
+
while True:
|
371
|
+
item = q.get()
|
372
|
+
if item is sentinel:
|
373
|
+
break
|
374
|
+
elif isinstance(item, Exception):
|
375
|
+
raise item
|
376
|
+
else:
|
377
|
+
yield item
|
378
|
+
|
379
|
+
t.join()
|
380
|
+
|
353
381
|
elif signature_dict.get("iscoroutinefunction"):
|
354
382
|
|
355
383
|
async def func_handler(*args, **kwargs):
|
@@ -8,8 +8,8 @@ stores/indexes/base_index.py,sha256=YrEwETZ5eXj3rXK5qxOllRXqFifQoteYdzPAasbvEyg,
|
|
8
8
|
stores/indexes/index.py,sha256=Cub5mtnYGipHfPR8BexJYRSKfuJmcGPp0B3ou2bGNqs,2901
|
9
9
|
stores/indexes/local_index.py,sha256=Gg9LkEo1L0_NZZYPItsF_-1y6nFP369C3QlPvPyvPx8,3708
|
10
10
|
stores/indexes/remote_index.py,sha256=-GV4l2c7GL6_bcVOQnSK5rzYru237bwC5L6eiO-QFzM,3438
|
11
|
-
stores/indexes/venv_utils.py,sha256
|
12
|
-
stores-0.1.7.
|
13
|
-
stores-0.1.7.
|
14
|
-
stores-0.1.7.
|
15
|
-
stores-0.1.7.
|
11
|
+
stores/indexes/venv_utils.py,sha256=k664ptVhPfs4AHCpB6CiE-pWHGcqi982YjsZDDt64Ys,18577
|
12
|
+
stores-0.1.7.dev6.dist-info/METADATA,sha256=Gg4CaLZDS0isd_R0Vhpn7IGCIQQ51Og5rBuBANnV7tk,3081
|
13
|
+
stores-0.1.7.dev6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
14
|
+
stores-0.1.7.dev6.dist-info/licenses/LICENSE,sha256=VTidYE7_Dam0Dwyq095EhhDIqi47g03oVpLAHQgKws0,1066
|
15
|
+
stores-0.1.7.dev6.dist-info/RECORD,,
|
File without changes
|
File without changes
|