From e49d167450987cb08f8f5cdd107331734b4028d3 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 1 Jan 2016 04:55:33 -0500 Subject: [PATCH] Sort attributes in inheritance diagrams. This ensures that the graphviz script is always the same and thus the filename (which is the hash of the script and other things) remains consistent. --- sphinx/ext/inheritance_diagram.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index 0f4a18c63..24af6f168 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -227,10 +227,10 @@ class InheritanceGraph(object): } def _format_node_attrs(self, attrs): - return ','.join(['%s=%s' % x for x in attrs.items()]) + return ','.join(['%s=%s' % x for x in sorted(attrs.items())]) def _format_graph_attrs(self, attrs): - return ''.join(['%s=%s;\n' % x for x in attrs.items()]) + return ''.join(['%s=%s;\n' % x for x in sorted(attrs.items())]) def generate_dot(self, name, urls={}, env=None, graph_attrs={}, node_attrs={}, edge_attrs={}):