From: Vladimír Vondruš Date: Tue, 4 Jan 2022 19:25:24 +0000 (+0100) Subject: Drop support for Graphviz < 2.40. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=e1c9a00a945635fdffaf227beed2d22b4df67da0;p=blog.git Drop support for Graphviz < 2.40. Mostly an inheritance of the old Travis CI images. CircleCI has Graphviz 2.42.2 which has the output consistent with 2.44, and Ubuntu 18.04 has Graphviz 2.40.1, so that's the oldest reasonable minimum to care about. --- diff --git a/doc/plugins/plots-and-graphs.rst b/doc/plugins/plots-and-graphs.rst index f8e9b4b4..15c5a796 100644 --- a/doc/plugins/plots-and-graphs.rst +++ b/doc/plugins/plots-and-graphs.rst @@ -261,9 +261,9 @@ paragraph before the actual graph block, see the for more information. Font name and size is controlled using the builtin :ini:`DOT_FONTNAME` and :ini:`DOT_FONTSIZE` options. -In addition you need the -`Graphviz `_ library installed. Get it via your -distribution package manager, for example on Ubuntu: +In addition you need the `Graphviz `_ library installed +(version 2.40.1 at least). Get it via your distribution package manager, for +example on Ubuntu: .. code:: sh @@ -325,11 +325,6 @@ extensive `attribute documentation - - - - Dot | My Project - - - - - -
-
-
-
-
-

- Dot -

-

A red graph:

- - -a - -a - - -b - -b - - -a--b - - - - -

A blue graph, from a file:

- - -a - -a - - -b - -b - - -a--b - - - - -
-
-
-
-
- - diff --git a/documentation/test_doxygen/contents_custom/dot-238.html b/documentation/test_doxygen/contents_custom/dot-238.html deleted file mode 100644 index f5c800ff..00000000 --- a/documentation/test_doxygen/contents_custom/dot-238.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - Dot | My Project - - - - - -
-
-
-
-
-

- Dot -

-

A red graph:

- - -a - -a - - -b - -b - - -a--b - - - - -

A blue graph, from a file:

- - -a - -a - - -b - -b - - -a--b - - - - -
-
-
-
-
- - diff --git a/documentation/test_doxygen/contents_dot/index-238.html b/documentation/test_doxygen/contents_dot/index-238.html deleted file mode 100644 index b1f962c3..00000000 --- a/documentation/test_doxygen/contents_dot/index-238.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - My Project - - - - - -
-
-
-
-
-

- My Project -

-

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have predictable rendering on the CIs.

- -Basics - -a - -a - - -b - - -b - - -a->b - - - - -c - -c - - -b->c - - -0 - - -c->c - - -1 - - - -
- -Colors - -a - -a - - -b - -b - - -a->b - - -yes - - -b->b - - -no - - - -
- - -a - -a - - -b - -b - - -a--b - - - - -
A graph
- - -a - -a - - -b - -b - - -a--b - - - - -
A graph
-
-
-
-
- - diff --git a/documentation/test_doxygen/test_contents.py b/documentation/test_doxygen/test_contents.py index 2ead912b..06f527c3 100644 --- a/documentation/test_doxygen/test_contents.py +++ b/documentation/test_doxygen/test_contents.py @@ -258,12 +258,8 @@ class Custom(IntegrationTestCase): # Used to be >= 2.44.0, but 2.42.2 appears to have the same output if LooseVersion(dot_version()) >= LooseVersion("2.42.2"): file = 'dot.html' - elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): - file = 'dot-240.html' - elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): - file = 'dot-238.html' else: - file = 'dot-236.html' + file = 'dot-240.html' self.assertEqual(*self.actual_expected_contents('dot.html', file)) @@ -342,10 +338,8 @@ class Dot(IntegrationTestCase): # Used to be >= 2.44.0, but 2.42.2 appears to have the same output if LooseVersion(dot_version()) >= LooseVersion("2.42.2"): file = 'index.html' - elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + else: file = 'index-240.html' - elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): - file = 'index-238.html' self.assertEqual(*self.actual_expected_contents('index.html', file)) diff --git a/documentation/test_python/page_plugins/dot-238.html b/documentation/test_python/page_plugins/dot-238.html deleted file mode 100644 index 6caced72..00000000 --- a/documentation/test_python/page_plugins/dot-238.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - Dot | My Python Project - - - - - -
-
-
-
-
-

- Dot -

-
- - - -a - -a - - -b - -b - - -a->b - - - - -c - -c - - -b->c - - - - - -
-
-
-
-
- - diff --git a/documentation/test_python/test_page.py b/documentation/test_python/test_page.py index 0fa56449..f2f9454f 100644 --- a/documentation/test_python/test_page.py +++ b/documentation/test_python/test_page.py @@ -85,10 +85,8 @@ class Plugins(BaseTestCase): # Used to be >= 2.44.0, but 2.42.2 appears to have the same output if LooseVersion(dot_version()) >= LooseVersion("2.42.2"): file = 'dot.html' - elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + else: file = 'dot-240.html' - elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): - file = 'dot-238.html' self.assertEqual(*self.actual_expected_contents('dot.html', file)) # I assume this will be a MASSIVE ANNOYANCE at some point as well so diff --git a/plugins/dot2svg.py b/plugins/dot2svg.py index 0f8d52f3..4e2eb62a 100644 --- a/plugins/dot2svg.py +++ b/plugins/dot2svg.py @@ -39,9 +39,8 @@ _patch_custom_size_dst = r""" _comment_src = re.compile(r"""\n""") -# Graphviz < 2.40 (Ubuntu 16.04 and older) doesn't have a linebreak between -# and -_class_src = re.compile(r"""<g id="(edge|node|clust)\d+" class="(?P<type>edge|node|cluster)(?P<classes>[^"]*)">[\n]?<title>(?P<title>[^<]*) +_class_src = re.compile(r""" +(?P<title>[^<]*) <(?Pellipse|polygon|path|text)( fill="(?P[^"]+)" stroke="[^"]+")? """) _class_dst = r""" @@ -52,8 +51,8 @@ _attributes_src = re.compile(r"""<(?Pellipse|polygon|polyline) fill="[^ _attributes_dst = r"""<\g """ -# re.compile() is called after replacing {font} in configure(). Graphviz < 2.40 -# doesn't put the fill="" attribute there +# re.compile() is called after replacing {font} in configure(). The fill +# attribute is sometimes omitted. _text_src_src = ' font-family="{font}" font-size="(?P[^"]+)"( fill="[^"]+")?' _text_dst = ' style="font-size: {size}px;"' diff --git a/plugins/m/test/dot/page-238.html b/plugins/m/test/dot/page-238.html deleted file mode 100644 index 30ef5863..00000000 --- a/plugins/m/test/dot/page-238.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - m.dot | A Pelican Blog - - - - - - -
-
-
-
-
-
-

m.dot

- -

Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have -predictable rendering on the CIs.

-

Different shapes, fills etc. All default colors, filled only the first node -and the arrowheads, nothing else. Non-default font size should be preserved.

-
- - -Basics - -a - -a - - -b - - -b - - -a->b - - - - -c - -c - - -b->c - - -0 - - -c->c - - -1 - - - -
-
- - -More shapes - -d -outsider - - - -
-

Colors:

-
- - -Colors - -a - -a - - -b - -b - - -a->b - - -yes - - -b->b - - -no - - - -
-

Unoriented graph without a title:

-
- - - -a - -a - - -b - -b - - -a--b - - - -a--b - - - - -
-

Strict graphs:

-
- - -A to B - -a - -a - - -b - -b - - -a->b - - - - - -
-
- - -A to B - -a - -a - - -b - -b - - -a--b - - - - -
-

Structs:

-
- - -Structs - -struct - -a - -b - -c - -d - -e - - -another - -a - -b - -c - -d - -e - - - -
-
- - -A to B - -a - -a - - -b - -b - - -a->b - - - - - -
This is a title.
-

This is a description.

-
-
- - - -a - -a - - -b - -b - - -a->b - - - - - -

The graph below should not be styled as a part of the figure:

-
- - -A to B - -a - -a - - -b - -b - - -a->b - - - - - -
-
-

Subgraphs:

-
- - - -cluster_Outer - -Outer - - -cluster_Inner - -Inner - - -A - -A - - -B - -B - - -A->B - - - - -C - -C - - -A->C - - - - -D - -D - - -B->D - - - - -B2 - -B2 - - -B2->B - - - - - -
- -
-
-
-
-
- - diff --git a/plugins/m/test/test_dot.py b/plugins/m/test/test_dot.py index 0d227c16..15f8fdad 100644 --- a/plugins/m/test/test_dot.py +++ b/plugins/m/test/test_dot.py @@ -46,9 +46,7 @@ class Dot(PelicanPluginTestCase): # Used to be >= 2.44.0, but 2.42.2 appears to have the same output if LooseVersion(dot_version()) >= LooseVersion("2.42.2"): file = 'page.html' - elif LooseVersion(dot_version()) > LooseVersion("2.40.0"): + else: file = 'page-240.html' - elif LooseVersion(dot_version()) >= LooseVersion("2.38.0"): - file = 'page-238.html' self.assertEqual(*self.actual_expected_contents('page.html', file))