setta 0.0.3.dev14__py3-none-any.whl → 0.0.4.dev1__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 setta might be problematic. Click here for more details.
- setta/__init__.py +1 -1
- setta/routers/interactive.py +33 -12
- setta/static/constants/defaultValues.json +2 -1
- setta/static/frontend/assets/{index-af271c9f.css → index-03be034e.css} +1 -1
- setta/static/frontend/assets/{index-ab160324.js → index-4b75851d.js} +148 -148
- setta/static/frontend/index.html +2 -2
- setta/tasks/tasks.py +4 -5
- setta/tasks/utils.py +19 -12
- setta/utils/constants.py +1 -0
- setta-0.0.4.dev1.dist-info/METADATA +146 -0
- {setta-0.0.3.dev14.dist-info → setta-0.0.4.dev1.dist-info}/RECORD +15 -15
- setta-0.0.3.dev14.dist-info/METADATA +0 -25
- {setta-0.0.3.dev14.dist-info → setta-0.0.4.dev1.dist-info}/LICENSE +0 -0
- {setta-0.0.3.dev14.dist-info → setta-0.0.4.dev1.dist-info}/WHEEL +0 -0
- {setta-0.0.3.dev14.dist-info → setta-0.0.4.dev1.dist-info}/entry_points.txt +0 -0
- {setta-0.0.3.dev14.dist-info → setta-0.0.4.dev1.dist-info}/top_level.txt +0 -0
setta/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.0.
|
1
|
+
__version__ = "0.0.4.dev1"
|
setta/routers/interactive.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import asyncio
|
2
|
+
|
1
3
|
import black
|
2
4
|
from fastapi import APIRouter, Depends
|
3
5
|
from pydantic import BaseModel
|
@@ -39,12 +41,17 @@ async def route_update_interactive_code(
|
|
39
41
|
tasks=Depends(get_tasks),
|
40
42
|
lsp_writers=Depends(get_lsp_writers),
|
41
43
|
):
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
# Create list of coroutines to run in parallel
|
45
|
+
update_tasks = [
|
46
|
+
update_interactive_code(p, tasks, lsp_writers, idx)
|
47
|
+
for idx, p in enumerate(x.projects)
|
48
|
+
]
|
49
|
+
|
50
|
+
# Run all updates in parallel and gather results
|
51
|
+
all_content = await asyncio.gather(*update_tasks)
|
52
|
+
|
53
|
+
# Flatten the list of content
|
54
|
+
content = [item for sublist in all_content for item in sublist]
|
48
55
|
|
49
56
|
inMemorySubprocessInfo = tasks.getInMemorySubprocessInfo()
|
50
57
|
return {"inMemorySubprocessInfo": inMemorySubprocessInfo, "content": content}
|
@@ -75,20 +82,34 @@ async def update_interactive_code(p, tasks, lsp_writers, idx):
|
|
75
82
|
template_var_replacement_values=template_var_replacement_values,
|
76
83
|
)
|
77
84
|
|
85
|
+
runCodeBlocks = p["runCodeBlocks"]
|
86
|
+
if runCodeBlocks is None:
|
87
|
+
runCodeBlocks = [
|
88
|
+
k for k in p["sections"].keys() if get_section_type(p, k) == C.CODE
|
89
|
+
]
|
90
|
+
|
78
91
|
top_node_ids, section_dependencies = prune_and_find_top_nodes(
|
79
|
-
code_dict,
|
92
|
+
code_dict, runCodeBlocks
|
80
93
|
)
|
81
94
|
code_graph = []
|
82
95
|
project_config_id = p["projectConfig"]["id"]
|
83
96
|
for section_id in top_node_ids:
|
97
|
+
import_order = get_import_order_for_top_node(section_id, section_dependencies)
|
98
|
+
imports = [
|
99
|
+
{
|
100
|
+
"code": code_dict[s]["code"],
|
101
|
+
"module_name": create_in_memory_module_name(p, s),
|
102
|
+
}
|
103
|
+
for s in import_order
|
104
|
+
]
|
105
|
+
|
84
106
|
code_graph.append(
|
85
107
|
{
|
108
|
+
"imports": imports,
|
86
109
|
"subprocess_key": f"{project_config_id}-{section_id}-{idx}",
|
87
|
-
"
|
88
|
-
|
89
|
-
|
90
|
-
),
|
91
|
-
"module_name": create_in_memory_module_name(p, section_id),
|
110
|
+
"subprocessStartMethod": p["sections"][section_id][
|
111
|
+
"subprocessStartMethod"
|
112
|
+
],
|
92
113
|
}
|
93
114
|
)
|
94
115
|
|