vellum-workflow-server 0.14.71.post2__py3-none-any.whl → 0.14.71.post4__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 vellum-workflow-server might be problematic. Click here for more details.
- {vellum_workflow_server-0.14.71.post2.dist-info → vellum_workflow_server-0.14.71.post4.dist-info}/METADATA +1 -1
- {vellum_workflow_server-0.14.71.post2.dist-info → vellum_workflow_server-0.14.71.post4.dist-info}/RECORD +6 -6
- workflow_server/api/tests/test_workflow_view.py +59 -4
- workflow_server/api/workflow_view.py +2 -2
- {vellum_workflow_server-0.14.71.post2.dist-info → vellum_workflow_server-0.14.71.post4.dist-info}/WHEEL +0 -0
- {vellum_workflow_server-0.14.71.post2.dist-info → vellum_workflow_server-0.14.71.post4.dist-info}/entry_points.txt +0 -0
|
@@ -4,9 +4,9 @@ workflow_server/api/auth_middleware.py,sha256=IlZaCiwZ5nwQqk5sYQorvOFj7lt0p1ZSSE
|
|
|
4
4
|
workflow_server/api/healthz_view.py,sha256=itiRvBDBXncrw8Kbbc73UZLwqMAhgHOR3uSre_dAfgY,404
|
|
5
5
|
workflow_server/api/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
workflow_server/api/tests/test_input_display_mapping.py,sha256=drBZqMudFyB5wgiUOcMgRXz7E7ge-Qgxbstw4E4f0zE,2211
|
|
7
|
-
workflow_server/api/tests/test_workflow_view.py,sha256=
|
|
7
|
+
workflow_server/api/tests/test_workflow_view.py,sha256=b9paDtjUZY8IpRLLcFRnlTW6yB8nw09CZKOwxHgC098,8726
|
|
8
8
|
workflow_server/api/tests/test_workflow_view_stream_workflow_route.py,sha256=2gro4GD3FBuaA8T2-0oQxOOXh6zTf6hwxKb9CGU3x8g,24813
|
|
9
|
-
workflow_server/api/workflow_view.py,sha256=
|
|
9
|
+
workflow_server/api/workflow_view.py,sha256=8NIqSNgvRBCMwS2aJLlV-E_S_nD0ILxjKZRyMrFtouY,16204
|
|
10
10
|
workflow_server/code_exec_runner.py,sha256=tfijklTVkX4y45jeFTfrY2hVhdwo0VrLFc3SMeIiVYs,3096
|
|
11
11
|
workflow_server/config.py,sha256=K5Tavm7wiqCZt0RWWue7zzb8N6e8aWnFOTNlBqEJPcI,1330
|
|
12
12
|
workflow_server/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -26,7 +26,7 @@ workflow_server/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
|
26
26
|
workflow_server/utils/tests/test_system_utils.py,sha256=MdBxI9gxUOpR_JBAHpEz6dGFY6JjxhMSM2oExpqFvNA,4314
|
|
27
27
|
workflow_server/utils/tests/test_utils.py,sha256=qwK5Rmy3RQyjtlUrYAuGuDlBeRzZKsf1yS-y2IpUizQ,6452
|
|
28
28
|
workflow_server/utils/utils.py,sha256=Wqqn-1l2ugkGgy5paWWdt0AVxAyPMQCYcnRSSOMjXlA,4355
|
|
29
|
-
vellum_workflow_server-0.14.71.
|
|
30
|
-
vellum_workflow_server-0.14.71.
|
|
31
|
-
vellum_workflow_server-0.14.71.
|
|
32
|
-
vellum_workflow_server-0.14.71.
|
|
29
|
+
vellum_workflow_server-0.14.71.post4.dist-info/METADATA,sha256=wjw3aXITpYnZhhSwje6_X0YitUOkCyAmkOW-3cLEKzI,2243
|
|
30
|
+
vellum_workflow_server-0.14.71.post4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
31
|
+
vellum_workflow_server-0.14.71.post4.dist-info/entry_points.txt,sha256=uB_0yPkr7YV6RhEXzvFReUM8P4OQBlVXD6TN6eb9-oc,277
|
|
32
|
+
vellum_workflow_server-0.14.71.post4.dist-info/RECORD,,
|
|
@@ -51,7 +51,7 @@ class TestNode(BaseNode):
|
|
|
51
51
|
# AND the node should have the correct metadata
|
|
52
52
|
node = nodes[0]
|
|
53
53
|
assert UUID(node["id"])
|
|
54
|
-
assert node["module"] == "vellum_custom_nodes"
|
|
54
|
+
assert node["module"] == ["vellum_custom_nodes"]
|
|
55
55
|
assert node["name"] == "TestNode"
|
|
56
56
|
assert node["label"] == "Test Node"
|
|
57
57
|
assert "A test node for processing data." in node["description"]
|
|
@@ -105,14 +105,14 @@ class SomeOtherNode(BaseNode):
|
|
|
105
105
|
assert some_node["label"] == "Some node"
|
|
106
106
|
assert some_node["description"] == "This is Some Node."
|
|
107
107
|
assert UUID(some_node["id"])
|
|
108
|
-
assert some_node["module"] == "vellum_custom_nodes"
|
|
108
|
+
assert some_node["module"] == ["vellum_custom_nodes"]
|
|
109
109
|
|
|
110
110
|
# AND the second node should have correct metadata
|
|
111
111
|
some_other_node = nodes[1]
|
|
112
112
|
assert some_other_node["label"] == "Some other node"
|
|
113
113
|
assert some_other_node["description"] == "This is Some Other Node."
|
|
114
114
|
assert UUID(some_other_node["id"])
|
|
115
|
-
assert some_other_node["module"] == "vellum_custom_nodes"
|
|
115
|
+
assert some_other_node["module"] == ["vellum_custom_nodes"]
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
def test_version_route__no_custom_nodes_dir(tmp_path):
|
|
@@ -219,10 +219,65 @@ class BrokenNode(BaseNode)
|
|
|
219
219
|
assert valid_node["label"] == "Some node"
|
|
220
220
|
assert valid_node["description"] == "This is Some Node."
|
|
221
221
|
assert UUID(valid_node["id"])
|
|
222
|
-
assert valid_node["module"] == "vellum_custom_nodes"
|
|
222
|
+
assert valid_node["module"] == ["vellum_custom_nodes"]
|
|
223
223
|
|
|
224
224
|
# AND the error should be logged with full traceback
|
|
225
225
|
assert len(caplog.records) > 0
|
|
226
226
|
error_message = caplog.records[0].message
|
|
227
227
|
assert "Failed to load node from module invalid_node" in error_message
|
|
228
228
|
assert "invalid_node.py, line 4" in error_message
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def test_version_route__with_inputs(tmp_path):
|
|
232
|
+
# GIVEN a temporary custom_nodes directory
|
|
233
|
+
custom_nodes_dir = tmp_path / "vellum_custom_nodes"
|
|
234
|
+
custom_nodes_dir.mkdir()
|
|
235
|
+
|
|
236
|
+
# AND an addition node file
|
|
237
|
+
node_file = custom_nodes_dir / "addition_node.py"
|
|
238
|
+
node_file.write_text(
|
|
239
|
+
"""
|
|
240
|
+
from vellum.workflows.inputs import BaseInputs
|
|
241
|
+
from vellum.workflows.nodes import BaseNode
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
class Inputs(BaseInputs):
|
|
245
|
+
arg1: int
|
|
246
|
+
arg2: int
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class MyAdditionNode(BaseNode):
|
|
250
|
+
\"\"\"Custom node that performs simple addition.\"\"\"
|
|
251
|
+
label = "Addition Node"
|
|
252
|
+
arg1: int = Inputs.arg1
|
|
253
|
+
arg2: int = Inputs.arg2
|
|
254
|
+
|
|
255
|
+
class Outputs(BaseNode.Outputs):
|
|
256
|
+
result: int
|
|
257
|
+
|
|
258
|
+
def run(self) -> BaseNode.Outputs:
|
|
259
|
+
result = self.arg1 + self.arg2
|
|
260
|
+
return self.Outputs(result=result)
|
|
261
|
+
"""
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
flask_app = create_app()
|
|
265
|
+
|
|
266
|
+
# WHEN we make a request to the version route
|
|
267
|
+
with patch("os.getcwd", return_value=str(tmp_path)), flask_app.test_client() as test_client:
|
|
268
|
+
response = test_client.get("/workflow/version")
|
|
269
|
+
|
|
270
|
+
# THEN we should get a successful response
|
|
271
|
+
assert response.status_code == 200
|
|
272
|
+
|
|
273
|
+
# AND we should find the addition node
|
|
274
|
+
nodes = response.json["nodes"]
|
|
275
|
+
assert len(nodes) == 1
|
|
276
|
+
|
|
277
|
+
# AND the node should have the correct metadata
|
|
278
|
+
node = nodes[0]
|
|
279
|
+
assert node["label"] == "Addition Node"
|
|
280
|
+
assert node["description"] == "Custom node that performs simple addition."
|
|
281
|
+
assert UUID(node["id"])
|
|
282
|
+
assert node["module"] == ["vellum_custom_nodes"]
|
|
283
|
+
assert node["name"] == "MyAdditionNode"
|
|
@@ -376,9 +376,9 @@ def get_version_route() -> tuple[dict, int]:
|
|
|
376
376
|
nodes.append(
|
|
377
377
|
{
|
|
378
378
|
"id": str(uuid4()),
|
|
379
|
-
"module": CUSTOM_NODES_DIRECTORY,
|
|
379
|
+
"module": CUSTOM_NODES_DIRECTORY.split("/"),
|
|
380
380
|
"name": obj.__name__,
|
|
381
|
-
"label": obj
|
|
381
|
+
"label": obj.label.instance if hasattr(obj, "label") else obj.__name__,
|
|
382
382
|
"description": inspect.getdoc(obj) or "",
|
|
383
383
|
}
|
|
384
384
|
)
|
|
File without changes
|
|
File without changes
|