Skip to content

Commit b810993

Browse files
authored
Merge pull request #237 from Nick011/chore/upgrade-networkx
upgrade to latest networkx to allow running on py 3.9
2 parents e198940 + e4d377f commit b810993

4 files changed

Lines changed: 15 additions & 11 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ target/
5555

5656
# Virtual Environments
5757
.venv
58+
venv/
5859

5960
# Temporary Files
6061
*.swp
6162

6263
# Visual Studio Code
6364
.vscode/
65+
66+
# Pycharm
67+
.idea/

orquesta/graphing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def deserialize(cls, data):
5353
@staticmethod
5454
def get_root_nodes(graph):
5555
nodes = [
56-
{"id": n, "name": graph.node[n].get("name", n)}
57-
for n, d in graph.in_degree().items()
56+
{"id": n, "name": graph.nodes[n].get("name", n)}
57+
for n, d in dict(graph.in_degree()).items()
5858
if d == 0
5959
]
6060

@@ -80,7 +80,7 @@ def get_task(self, task_id):
8080
raise exc.InvalidTask(task_id)
8181

8282
task = {"id": task_id}
83-
task.update(json_util.deepcopy(self._graph.node[task_id]))
83+
task.update(json_util.deepcopy(self._graph.nodes[task_id]))
8484

8585
return task
8686

@@ -102,7 +102,7 @@ def update_task(self, task_id, **kwargs):
102102
raise exc.InvalidTask(task_id)
103103

104104
for key, value in six.iteritems(kwargs):
105-
self._graph.node[task_id][key] = value
105+
self._graph.nodes[task_id][key] = value
106106

107107
def has_transition(self, source, destination, **kwargs):
108108
edges = filter(

orquesta/tests/unit/conducting/test_workflow_conductor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_init(self):
141141
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
142142
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
143143
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
144-
self.assertEqual(len(conductor.graph._graph.node), 5)
144+
self.assertEqual(len(conductor.graph._graph.nodes), 5)
145145
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
146146

147147
def test_init_with_inputs(self):
@@ -180,7 +180,7 @@ def test_init_with_inputs(self):
180180
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
181181
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
182182
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
183-
self.assertEqual(len(conductor.graph._graph.node), 5)
183+
self.assertEqual(len(conductor.graph._graph.nodes), 5)
184184
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
185185

186186
def test_init_with_partial_inputs(self):
@@ -221,7 +221,7 @@ def test_init_with_partial_inputs(self):
221221
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
222222
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
223223
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
224-
self.assertEqual(len(conductor.graph._graph.node), 5)
224+
self.assertEqual(len(conductor.graph._graph.nodes), 5)
225225
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
226226

227227
def test_init_with_context(self):
@@ -263,7 +263,7 @@ def test_init_with_context(self):
263263
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
264264
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
265265
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
266-
self.assertEqual(len(conductor.graph._graph.node), 5)
266+
self.assertEqual(len(conductor.graph._graph.nodes), 5)
267267
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
268268

269269
def test_serialization(self):
@@ -296,7 +296,7 @@ def test_serialization(self):
296296

297297
self.assertIsInstance(conductor.spec, native_specs.WorkflowSpec)
298298
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
299-
self.assertEqual(len(conductor.graph._graph.node), 5)
299+
self.assertEqual(len(conductor.graph._graph.nodes), 5)
300300
self.assertEqual(conductor.get_workflow_status(), statuses.SUCCEEDED)
301301
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
302302
self.assertEqual(len(conductor.workflow_state.tasks), 5)
@@ -850,7 +850,7 @@ def test_append_log_entries(self):
850850
self.assertIsInstance(conductor.spec, native_specs.WorkflowSpec)
851851
self.assertEqual(conductor.get_workflow_status(), statuses.RUNNING)
852852
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
853-
self.assertEqual(len(conductor.graph._graph.node), 5)
853+
self.assertEqual(len(conductor.graph._graph.nodes), 5)
854854
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
855855
self.assertListEqual(conductor.log, expected_log_entries)
856856
self.assertListEqual(conductor.errors, expected_errors)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ chardet>=3.0.2,<4.0.0
22
eventlet
33
Jinja2>=2.8 # BSD License (3 clause)
44
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
5-
networkx>=1.10,<2.0
5+
networkx>=2.5.1,<3.0
66
python-dateutil
77
PyYAML>=3.1.0 # MIT
88
six>=1.9.0

0 commit comments

Comments
 (0)