Skip to content

Commit

Permalink
Merge pull request #237 from Nick011/chore/upgrade-networkx
Browse files Browse the repository at this point in the history
upgrade to latest networkx to allow running on py 3.9
  • Loading branch information
m4dcoder authored Jun 3, 2021
2 parents e198940 + e4d377f commit b810993
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ target/

# Virtual Environments
.venv
venv/

# Temporary Files
*.swp

# Visual Studio Code
.vscode/

# Pycharm
.idea/
8 changes: 4 additions & 4 deletions orquesta/graphing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def deserialize(cls, data):
@staticmethod
def get_root_nodes(graph):
nodes = [
{"id": n, "name": graph.node[n].get("name", n)}
for n, d in graph.in_degree().items()
{"id": n, "name": graph.nodes[n].get("name", n)}
for n, d in dict(graph.in_degree()).items()
if d == 0
]

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

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

return task

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

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

def has_transition(self, source, destination, **kwargs):
edges = filter(
Expand Down
12 changes: 6 additions & 6 deletions orquesta/tests/unit/conducting/test_workflow_conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def test_init(self):
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
self.assertEqual(len(conductor.graph._graph.node), 5)
self.assertEqual(len(conductor.graph._graph.nodes), 5)
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)

def test_init_with_inputs(self):
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_init_with_inputs(self):
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
self.assertEqual(len(conductor.graph._graph.node), 5)
self.assertEqual(len(conductor.graph._graph.nodes), 5)
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)

def test_init_with_partial_inputs(self):
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_init_with_partial_inputs(self):
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
self.assertEqual(len(conductor.graph._graph.node), 5)
self.assertEqual(len(conductor.graph._graph.nodes), 5)
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)

def test_init_with_context(self):
Expand Down Expand Up @@ -263,7 +263,7 @@ def test_init_with_context(self):
self.assertEqual(conductor.workflow_state.status, statuses.UNSET)
self.assertEqual(conductor.get_workflow_status(), statuses.UNSET)
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
self.assertEqual(len(conductor.graph._graph.node), 5)
self.assertEqual(len(conductor.graph._graph.nodes), 5)
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)

def test_serialization(self):
Expand Down Expand Up @@ -296,7 +296,7 @@ def test_serialization(self):

self.assertIsInstance(conductor.spec, native_specs.WorkflowSpec)
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
self.assertEqual(len(conductor.graph._graph.node), 5)
self.assertEqual(len(conductor.graph._graph.nodes), 5)
self.assertEqual(conductor.get_workflow_status(), statuses.SUCCEEDED)
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
self.assertEqual(len(conductor.workflow_state.tasks), 5)
Expand Down Expand Up @@ -850,7 +850,7 @@ def test_append_log_entries(self):
self.assertIsInstance(conductor.spec, native_specs.WorkflowSpec)
self.assertEqual(conductor.get_workflow_status(), statuses.RUNNING)
self.assertIsInstance(conductor.graph, graphing.WorkflowGraph)
self.assertEqual(len(conductor.graph._graph.node), 5)
self.assertEqual(len(conductor.graph._graph.nodes), 5)
self.assertIsInstance(conductor.workflow_state, conducting.WorkflowState)
self.assertListEqual(conductor.log, expected_log_entries)
self.assertListEqual(conductor.errors, expected_errors)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ chardet>=3.0.2,<4.0.0
eventlet
Jinja2>=2.8 # BSD License (3 clause)
jsonschema!=2.5.0,<3.0.0,>=2.0.0 # MIT
networkx>=1.10,<2.0
networkx>=2.5.1,<3.0
python-dateutil
PyYAML>=3.1.0 # MIT
six>=1.9.0
Expand Down

0 comments on commit b810993

Please sign in to comment.