chiark / gitweb /
m.plots: replace hashes in test files before comparing.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 13 Sep 2024 00:24:49 +0000 (02:24 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 14 Sep 2024 00:50:55 +0000 (02:50 +0200)
Similarly to what I did for doxygen, the damn thing now has hashes
differing even between machines. How the hell is one supposed to make
reproducible builds with that, I don't know.

The 3.4 variant got removed, because it differs from 3.2 only in those
hashes, so it isn't needed anymore. Now I can finally unpin it from 3.7
on the CI and stop being afraid that it changes again with 3.9.3.

documentation/test_python/page_plugins/plots-34.html [deleted file]
documentation/test_python/test_page.py
package/ci/circleci.yml
plugins/m/test/plots/page-34.html [deleted file]
plugins/m/test/test_plots.py

diff --git a/documentation/test_python/page_plugins/plots-34.html b/documentation/test_python/page_plugins/plots-34.html
deleted file mode 100644 (file)
index a0b54cf..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="UTF-8" />
-  <title>And now something totally different | My Python Project</title>
-  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
-  <link rel="stylesheet" href="m-dark+documentation.compiled.css" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-</head>
-<body>
-<header><nav id="navigation">
-  <div class="m-container">
-    <div class="m-row">
-      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Python Project</a>
-    </div>
-  </div>
-</nav></header>
-<main><article>
-  <div class="m-container m-container-inflatable">
-    <div class="m-row">
-      <div class="m-col-l-10 m-push-l-1">
-        <h1>
-          And now something totally different
-        </h1>
-<style>
-div.m-plot svg { font-family: DejaVu Sans; }
-</style><div class="m-plot">
-<svg viewBox="0 0 576 113.76">
- <defs>
-  <style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
- </defs>
- <g id="figure_1">
-  <g id="axes_1">
-   <g id="patch_1">
-    <path d="M 59.365156 69.588125 L 564.12 69.588125 L 564.12 27.757969 L 59.365156 27.757969 z" class="m-background"/>
-   </g>
-   <g id="plot1-value0-0"><title>15.0 meters, i guess?</title>
-    <path clip-path="url(#pcce33c7247)" d="M 59.365156 29.659339 L 299.724606 29.659339 L 299.724606 46.560413 L 59.365156 46.560413 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot1-value0-1"><title>30.0 meters, i guess?</title>
-    <path clip-path="url(#pcce33c7247)" d="M 59.365156 50.785681 L 540.084055 50.785681 L 540.084055 67.686754 L 59.365156 67.686754 z" class="m-bar m-success"/>
-   </g>
-   <g id="matplotlib.axis_1">
-    <g id="xtick_1">
-     <g id="line2d_1">
-      <defs>
-       <path d="M 0 0 L 0 3.5" id="m67f9f4ece8" class="m-line"/>
-      </defs>
-      <g>
-       <use x="59.365156" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_1">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 59.365156, 84.946406)" x="59.365156" y="84.946406">0</text>
-     </g>
-    </g>
-    <g id="xtick_2">
-     <g id="line2d_2">
-      <g>
-       <use x="139.484973" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_2">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 139.484973, 84.946406)" x="139.484973" y="84.946406">5</text>
-     </g>
-    </g>
-    <g id="xtick_3">
-     <g id="line2d_3">
-      <g>
-       <use x="219.604789" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_3">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 219.604789, 84.946406)" x="219.604789" y="84.946406">10</text>
-     </g>
-    </g>
-    <g id="xtick_4">
-     <g id="line2d_4">
-      <g>
-       <use x="299.724606" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_4">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 299.724606, 84.946406)" x="299.724606" y="84.946406">15</text>
-     </g>
-    </g>
-    <g id="xtick_5">
-     <g id="line2d_5">
-      <g>
-       <use x="379.844422" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_5">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 379.844422, 84.946406)" x="379.844422" y="84.946406">20</text>
-     </g>
-    </g>
-    <g id="xtick_6">
-     <g id="line2d_6">
-      <g>
-       <use x="459.964239" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_6">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 459.964239, 84.946406)" x="459.964239" y="84.946406">25</text>
-     </g>
-    </g>
-    <g id="xtick_7">
-     <g id="line2d_7">
-      <g>
-       <use x="540.084055" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_7">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 540.084055, 84.946406)" x="540.084055" y="84.946406">30</text>
-     </g>
-    </g>
-    <g id="text_8">
-     <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 311.742578, 99.592344)" x="311.742578" y="99.592344">meters, i guess?</text>
-    </g>
-   </g>
-   <g id="matplotlib.axis_2">
-    <g id="ytick_1">
-     <g id="line2d_8">
-      <defs>
-       <path d="M 0 0 L -3.5 0" id="mb01a5532e0" class="m-line"/>
-      </defs>
-      <g>
-       <use x="59.365156" xlink:href="#mb01a5532e0" y="38.109876"/>
-      </g>
-     </g>
-     <g id="text_9">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 52.365156, 42.289017)" x="52.365156" y="42.289017">First</text>
-     </g>
-    </g>
-    <g id="ytick_2">
-     <g id="line2d_9">
-      <g>
-       <use x="59.365156" xlink:href="#mb01a5532e0" y="59.236218"/>
-      </g>
-     </g>
-     <g id="text_10">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 52.365156, 63.415358)" x="52.365156" y="63.415358">Second</text>
-     </g>
-    </g>
-   </g>
-   <g id="text_11">
-    <text class="m-title" style="text-anchor:middle;" transform="rotate(-0, 311.742578, 21.757969)" x="311.742578" y="21.757969">A plot with a single color</text>
-   </g>
-  </g>
- </g>
- <defs>
-  <clipPath id="pcce33c7247">
-   <rect height="41.830156" width="504.754844" x="59.365156" y="27.757969"/>
-  </clipPath>
- </defs>
-</svg>
-</div>
-      </div>
-    </div>
-  </div>
-</article></main>
-</body>
-</html>
index 94e9459c690e94a0ce1deb972619840a97a9d095..1c365892c2f184b284248f16caed7230ac293db3 100644 (file)
@@ -30,6 +30,9 @@ import subprocess
 
 from . import BaseTestCase, parse_version
 
+# Same as in the m.plots test case, see there for details
+_normalize_matplotlib_hashes = re.compile('([mp])[0-9a-f]{10}')
+
 def dot_version():
     return re.match(r'.*version (?P<version>\d+\.\d+\.\d+).*', subprocess.check_output(['dot', '-V'], stderr=subprocess.STDOUT).decode('utf-8').strip()).group('version')
 
@@ -99,11 +102,15 @@ class Plugins(BaseTestCase):
             file = 'plots.html'
         elif parse_version(matplotlib.__version__) >= parse_version('3.5'):
             file = 'plots-35.html'
-        elif parse_version(matplotlib.__version__) >= parse_version('3.4'):
-            file = 'plots-34.html'
         else:
             file = 'plots-32.html'
-        self.assertEqual(*self.actual_expected_contents('plots.html', file))
+
+        # The element hashes change wildly between versions, replace them with
+        # something stable before comparison
+        plots_actual_contents, plots_expected_contents = self.actual_expected_contents('plots.html', file)
+        plots_actual_contents = _normalize_matplotlib_hashes.sub(r'\1gggggggggg', plots_actual_contents)
+        plots_expected_contents = _normalize_matplotlib_hashes.sub(r'\1gggggggggg', plots_expected_contents)
+        self.assertEqual(plots_actual_contents, plots_expected_contents)
         self.assertTrue(os.path.exists(os.path.join(self.path, 'output/tiny.png')))
 
         import fancyline
index cdc3b5490e566825a96d65a5b1eaaf6197453e1e..3a958bbc9a509183ba7f6046d9bf6384cc5a0a94 100644 (file)
@@ -243,7 +243,7 @@ jobs:
     - install-base:
         extra: graphviz cmake ninja-build wget
     - install-python-deps:
-        # Matplotlib 3.6 has slightly different output, be sure to have at
+        # Matplotlib 3.6+ has slightly different output, be sure to have at
         # least one job testing 3.5 so we don't regress
         matplotlib-version: ==3.5.2
         # Docutils 0.18.0 dropped `in_footnote_list` and made some changes that
@@ -267,9 +267,9 @@ jobs:
         # libtinfo5 needed by doxygen 1.8.18, wtf
         extra: graphviz cmake ninja-build wget libtinfo5
     - install-python-deps:
-        # Matplotlib 3.8+ has significantly different output AGAIN, pin on 3.7
-        # until I can be bothered testing yet again
-        matplotlib-version: ==3.7.4
+        # Matplotlib 3.6 to 3.9.2 is known to have output as expected, pin it
+        # to ensure we don't regress once new versions change something again
+        matplotlib-version: ==3.9.2
         # NumPy 2.0 only works with pybind 2.12+
         numpy-version: ==1.26.4
     - checkout
@@ -290,9 +290,6 @@ jobs:
         # libtinfo5 needed by doxygen 1.8.18, wtf
         extra: graphviz cmake ninja-build wget libtinfo5
     - install-python-deps:
-        # Matplotlib 3.8+ has significantly different output AGAIN, pin on 3.7
-        # until I can be bothered testing yet again
-        matplotlib-version: ==3.7.4
         # NumPy 2.0 doesn't work with pybind 2.11, see below
         numpy-version: ==1.26.4
     - checkout
diff --git a/plugins/m/test/plots/page-34.html b/plugins/m/test/plots/page-34.html
deleted file mode 100644 (file)
index 87863ba..0000000
+++ /dev/null
@@ -1,682 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="UTF-8" />
-  <title>m.plots | A Pelican Blog</title>
-  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i" />
-  <link rel="stylesheet" href="static/m-dark.css" />
-  <link rel="canonical" href="page.html" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-</head>
-<body>
-<header><nav id="navigation">
-  <div class="m-container">
-    <div class="m-row">
-      <a href="./" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m">A Pelican Blog</a>
-    </div>
-  </div>
-</nav></header>
-<main>
-<article>
-  <div class="m-container m-container-inflatable">
-    <div class="m-row">
-      <div class="m-col-l-10 m-push-l-1">
-        <h1>m.plots</h1>
-<!-- content -->
-<p>Note: the test uses DejaVu Sans instead of Source Sans Pro in order to have
-predictable rendering on the CIs.</p>
-<style>
-div.m-plot svg { font-family: DejaVu Sans; }
-</style><div class="m-plot">
-<svg viewBox="0 0 576 113.76">
- <defs>
-  <style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
- </defs>
- <g id="figure_1">
-  <g id="axes_1">
-   <g id="patch_1">
-    <path d="M 59.365156 69.588125 L 564.12 69.588125 L 564.12 27.757969 L 59.365156 27.757969 z" class="m-background"/>
-   </g>
-   <g id="plot1-value0-0"><title>15.0 meters, i guess?</title>
-    <path clip-path="url(#pcce33c7247)" d="M 59.365156 29.659339 L 299.724606 29.659339 L 299.724606 46.560413 L 59.365156 46.560413 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot1-value0-1"><title>30.0 meters, i guess?</title>
-    <path clip-path="url(#pcce33c7247)" d="M 59.365156 50.785681 L 540.084055 50.785681 L 540.084055 67.686754 L 59.365156 67.686754 z" class="m-bar m-success"/>
-   </g>
-   <g id="matplotlib.axis_1">
-    <g id="xtick_1">
-     <g id="line2d_1">
-      <defs>
-       <path d="M 0 0 L 0 3.5" id="m67f9f4ece8" class="m-line"/>
-      </defs>
-      <g>
-       <use x="59.365156" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_1">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 59.365156, 84.946406)" x="59.365156" y="84.946406">0</text>
-     </g>
-    </g>
-    <g id="xtick_2">
-     <g id="line2d_2">
-      <g>
-       <use x="139.484973" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_2">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 139.484973, 84.946406)" x="139.484973" y="84.946406">5</text>
-     </g>
-    </g>
-    <g id="xtick_3">
-     <g id="line2d_3">
-      <g>
-       <use x="219.604789" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_3">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 219.604789, 84.946406)" x="219.604789" y="84.946406">10</text>
-     </g>
-    </g>
-    <g id="xtick_4">
-     <g id="line2d_4">
-      <g>
-       <use x="299.724606" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_4">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 299.724606, 84.946406)" x="299.724606" y="84.946406">15</text>
-     </g>
-    </g>
-    <g id="xtick_5">
-     <g id="line2d_5">
-      <g>
-       <use x="379.844422" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_5">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 379.844422, 84.946406)" x="379.844422" y="84.946406">20</text>
-     </g>
-    </g>
-    <g id="xtick_6">
-     <g id="line2d_6">
-      <g>
-       <use x="459.964239" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_6">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 459.964239, 84.946406)" x="459.964239" y="84.946406">25</text>
-     </g>
-    </g>
-    <g id="xtick_7">
-     <g id="line2d_7">
-      <g>
-       <use x="540.084055" xlink:href="#m67f9f4ece8" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_7">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 540.084055, 84.946406)" x="540.084055" y="84.946406">30</text>
-     </g>
-    </g>
-    <g id="text_8">
-     <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 311.742578, 99.592344)" x="311.742578" y="99.592344">meters, i guess?</text>
-    </g>
-   </g>
-   <g id="matplotlib.axis_2">
-    <g id="ytick_1">
-     <g id="line2d_8">
-      <defs>
-       <path d="M 0 0 L -3.5 0" id="mb01a5532e0" class="m-line"/>
-      </defs>
-      <g>
-       <use x="59.365156" xlink:href="#mb01a5532e0" y="38.109876"/>
-      </g>
-     </g>
-     <g id="text_9">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 52.365156, 42.289017)" x="52.365156" y="42.289017">First</text>
-     </g>
-    </g>
-    <g id="ytick_2">
-     <g id="line2d_9">
-      <g>
-       <use x="59.365156" xlink:href="#mb01a5532e0" y="59.236218"/>
-      </g>
-     </g>
-     <g id="text_10">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 52.365156, 63.415358)" x="52.365156" y="63.415358">Second</text>
-     </g>
-    </g>
-   </g>
-   <g id="text_11">
-    <text class="m-title" style="text-anchor:middle;" transform="rotate(-0, 311.742578, 21.757969)" x="311.742578" y="21.757969">A plot with a single color</text>
-   </g>
-  </g>
- </g>
- <defs>
-  <clipPath id="pcce33c7247">
-   <rect height="41.830156" width="504.754844" x="59.365156" y="27.757969"/>
-  </clipPath>
- </defs>
-</svg>
-</div>
-<div class="m-col-m-6 m-center-m">
-<p>A plot with separate colors, extra labels, error bars and custom width + height</p>
-<div class="m-plot">
-<svg viewBox="0 0 324 218.16">
- <defs>
-  <style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
- </defs>
- <g id="figure_1">
-  <g id="axes_1">
-   <g id="patch_1">
-    <path d="M 76.642031 173.988125 L 312.12 173.988125 L 312.12 27.757969 L 76.642031 27.757969 z" class="m-background"/>
-   </g>
-   <g id="plot2-value0-0"><title>3.0 ± 0.1 Mondays</title>
-    <path clip-path="url(#p91542c6844)" d="M 76.642031 34.404794 L 186.936162 34.404794 L 186.936162 72.386653 L 76.642031 72.386653 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot2-value0-1"><title>4.0 ± 2.1 Mondays</title>
-    <path clip-path="url(#p91542c6844)" d="M 76.642031 81.882117 L 223.700872 81.882117 L 223.700872 119.863976 L 76.642031 119.863976 z" class="m-bar m-info"/>
-   </g>
-   <g id="plot2-value0-2"><title>5.0 ± 1.0 Mondays</title>
-    <path clip-path="url(#p91542c6844)" d="M 76.642031 129.359441 L 260.465582 129.359441 L 260.465582 167.3413 L 76.642031 167.3413 z" class="m-bar m-danger"/>
-   </g>
-   <g id="matplotlib.axis_1">
-    <g id="xtick_1">
-     <g id="line2d_1">
-      <defs>
-       <path d="M 0 0 L 0 3.5" id="m6ad40cba81" class="m-line"/>
-      </defs>
-      <g>
-       <use x="76.642031" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_1">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 76.642031, 189.346406)" x="76.642031" y="189.346406">0</text>
-     </g>
-    </g>
-    <g id="xtick_2">
-     <g id="line2d_2">
-      <g>
-       <use x="113.406741" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_2">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 113.406741, 189.346406)" x="113.406741" y="189.346406">1</text>
-     </g>
-    </g>
-    <g id="xtick_3">
-     <g id="line2d_3">
-      <g>
-       <use x="150.171452" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_3">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 150.171452, 189.346406)" x="150.171452" y="189.346406">2</text>
-     </g>
-    </g>
-    <g id="xtick_4">
-     <g id="line2d_4">
-      <g>
-       <use x="186.936162" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_4">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 186.936162, 189.346406)" x="186.936162" y="189.346406">3</text>
-     </g>
-    </g>
-    <g id="xtick_5">
-     <g id="line2d_5">
-      <g>
-       <use x="223.700872" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_5">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 223.700872, 189.346406)" x="223.700872" y="189.346406">4</text>
-     </g>
-    </g>
-    <g id="xtick_6">
-     <g id="line2d_6">
-      <g>
-       <use x="260.465582" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_6">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 260.465582, 189.346406)" x="260.465582" y="189.346406">5</text>
-     </g>
-    </g>
-    <g id="xtick_7">
-     <g id="line2d_7">
-      <g>
-       <use x="297.230292" xlink:href="#m6ad40cba81" y="173.988125"/>
-      </g>
-     </g>
-     <g id="text_7">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 297.230292, 189.346406)" x="297.230292" y="189.346406">6</text>
-     </g>
-    </g>
-    <g id="text_8">
-     <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 194.381016, 203.992344)" x="194.381016" y="203.992344">Mondays</text>
-    </g>
-   </g>
-   <g id="matplotlib.axis_2">
-    <g id="ytick_1">
-     <g id="line2d_8">
-      <defs>
-       <path d="M 0 0 L -3.5 0" id="mb742502bbb" class="m-line"/>
-      </defs>
-      <g>
-       <use x="76.642031" xlink:href="#mb742502bbb" y="53.395723"/>
-      </g>
-     </g>
-     <g id="text_9">
-      <text class="m-label" transform="translate(27.94 52.251895)">January</text>
-      <text class="m-label" transform="translate(69.642031 64.569489)"/>
-     </g>
-    </g>
-    <g id="ytick_2">
-     <g id="line2d_9">
-      <g>
-       <use x="76.642031" xlink:href="#mb742502bbb" y="100.873047"/>
-      </g>
-     </g>
-     <g id="text_10">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 69.642031, 105.052188)" x="69.642031" y="105.052188">February</text>
-     </g>
-    </g>
-    <g id="ytick_3">
-     <g id="line2d_10">
-      <g>
-       <use x="76.642031" xlink:href="#mb742502bbb" y="148.35037"/>
-      </g>
-     </g>
-     <g id="text_11">
-      <text class="m-label" transform="translate(36.116094 147.206542)">March</text>
-      <text class="m-label" transform="translate(69.642031 159.524136)"/>
-     </g>
-    </g>
-   </g>
-   <g id="LineCollection_1">
-    <path clip-path="url(#p91542c6844)" d="M 183.259691 53.395723 L 190.612633 53.395723" class="m-error"/>
-    <path clip-path="url(#p91542c6844)" d="M 146.494981 100.873047 L 300.906763 100.873047" class="m-error"/>
-    <path clip-path="url(#p91542c6844)" d="M 223.700872 148.35037 L 297.230292 148.35037" class="m-error"/>
-   </g>
-   <g id="line2d_11">
-    <defs>
-     <path d="M 0 9.375 L 0 -9.375" id="md2c73e2086" class="m-error"/>
-    </defs>
-    <g clip-path="url(#p91542c6844)">
-     <use x="183.259691" xlink:href="#md2c73e2086" y="53.395723"/>
-     <use x="146.494981" xlink:href="#md2c73e2086" y="100.873047"/>
-     <use x="223.700872" xlink:href="#md2c73e2086" y="148.35037"/>
-    </g>
-   </g>
-   <g id="line2d_12">
-    <g clip-path="url(#p91542c6844)">
-     <use x="190.612633" xlink:href="#md2c73e2086" y="53.395723"/>
-     <use x="300.906763" xlink:href="#md2c73e2086" y="100.873047"/>
-     <use x="297.230292" xlink:href="#md2c73e2086" y="148.35037"/>
-    </g>
-   </g>
-   <g id="text_12">
-    <text class="m-label m-dim" transform="translate(69.642031 52.646105)"/>
-    <text class="m-label m-dim" transform="translate(11.88 64.963699)">a paradise</text>
-   </g>
-   <g id="text_13">
-    <text class="m-label m-dim" transform="translate(69.642031 147.600752)"/>
-    <text class="m-label m-dim" transform="translate(45.380156 159.918346)">hell!</text>
-   </g>
-   <g id="text_14">
-    <text class="m-title" style="text-anchor:middle;" transform="rotate(-0, 194.381016, 21.757969)" x="194.381016" y="21.757969">Yes.</text>
-   </g>
-  </g>
- </g>
- <defs>
-  <clipPath id="p91542c6844">
-   <rect height="146.230156" width="235.477969" x="76.642031" y="27.757969"/>
-  </clipPath>
- </defs>
-</svg>
-</div>
-</div>
-<div class="m-plot">
-<svg viewBox="0 0 576 142.56">
- <defs>
-  <style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
- </defs>
- <g id="figure_1">
-  <g id="axes_1">
-   <g id="patch_1">
-    <path d="M 26.561094 98.388125 L 564.12 98.388125 L 564.12 27.757969 L 26.561094 27.757969 z" class="m-background"/>
-   </g>
-   <g id="plot3-value0-0"><title>111.9 kB</title>
-    <path clip-path="url(#p3be1189609)" d="M 26.561094 30.96843 L 94.510828 30.96843 L 94.510828 49.313926 L 26.561094 49.313926 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot3-value0-1"><title>74.4 kB</title>
-    <path clip-path="url(#p3be1189609)" d="M 26.561094 53.900299 L 71.739469 53.900299 L 71.739469 72.245794 L 26.561094 72.245794 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot3-value0-2"><title>52.1 kB</title>
-    <path clip-path="url(#p3be1189609)" d="M 26.561094 76.832168 L 58.198101 76.832168 L 58.198101 95.177663 L 26.561094 95.177663 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot3-value1-0"><title>731.2 kB</title>
-    <path clip-path="url(#p3be1189609)" d="M 94.510828 30.96843 L 538.521957 30.96843 L 538.521957 49.313926 L 94.510828 49.313926 z" class="m-bar m-info"/>
-   </g>
-   <g id="plot3-value1-1"><title>226.3 kB</title>
-    <path clip-path="url(#p3be1189609)" d="M 71.739469 53.900299 L 209.157027 53.900299 L 209.157027 72.245794 L 71.739469 72.245794 z" class="m-bar m-info"/>
-   </g>
-   <g id="plot3-value1-2"><title>226.0 kB</title>
-    <path clip-path="url(#p3be1189609)" d="M 58.198101 76.832168 L 195.433489 76.832168 L 195.433489 95.177663 L 58.198101 95.177663 z" class="m-bar m-info"/>
-   </g>
-   <g id="matplotlib.axis_1">
-    <g id="xtick_1">
-     <g id="line2d_1">
-      <defs>
-       <path d="M 0 0 L 0 3.5" id="me38155cefd" class="m-line"/>
-      </defs>
-      <g>
-       <use x="26.561094" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_1">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 26.561094, 113.746406)" x="26.561094" y="113.746406">0</text>
-     </g>
-    </g>
-    <g id="xtick_2">
-     <g id="line2d_2">
-      <g>
-       <use x="87.284716" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_2">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 87.284716, 113.746406)" x="87.284716" y="113.746406">100</text>
-     </g>
-    </g>
-    <g id="xtick_3">
-     <g id="line2d_3">
-      <g>
-       <use x="148.008339" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_3">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 148.008339, 113.746406)" x="148.008339" y="113.746406">200</text>
-     </g>
-    </g>
-    <g id="xtick_4">
-     <g id="line2d_4">
-      <g>
-       <use x="208.731962" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_4">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 208.731962, 113.746406)" x="208.731962" y="113.746406">300</text>
-     </g>
-    </g>
-    <g id="xtick_5">
-     <g id="line2d_5">
-      <g>
-       <use x="269.455585" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_5">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 269.455585, 113.746406)" x="269.455585" y="113.746406">400</text>
-     </g>
-    </g>
-    <g id="xtick_6">
-     <g id="line2d_6">
-      <g>
-       <use x="330.179207" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_6">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 330.179207, 113.746406)" x="330.179207" y="113.746406">500</text>
-     </g>
-    </g>
-    <g id="xtick_7">
-     <g id="line2d_7">
-      <g>
-       <use x="390.90283" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_7">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 390.90283, 113.746406)" x="390.90283" y="113.746406">600</text>
-     </g>
-    </g>
-    <g id="xtick_8">
-     <g id="line2d_8">
-      <g>
-       <use x="451.626453" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_8">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 451.626453, 113.746406)" x="451.626453" y="113.746406">700</text>
-     </g>
-    </g>
-    <g id="xtick_9">
-     <g id="line2d_9">
-      <g>
-       <use x="512.350075" xlink:href="#me38155cefd" y="98.388125"/>
-      </g>
-     </g>
-     <g id="text_9">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 512.350075, 113.746406)" x="512.350075" y="113.746406">800</text>
-     </g>
-    </g>
-    <g id="text_10">
-     <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 295.340547, 128.392344)" x="295.340547" y="128.392344">kB</text>
-    </g>
-   </g>
-   <g id="matplotlib.axis_2">
-    <g id="ytick_1">
-     <g id="line2d_10">
-      <defs>
-       <path d="M 0 0 L -3.5 0" id="m9ccd95d470" class="m-line"/>
-      </defs>
-      <g>
-       <use x="26.561094" xlink:href="#m9ccd95d470" y="40.141178"/>
-      </g>
-     </g>
-     <g id="text_11">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 19.561094, 44.320319)" x="19.561094" y="44.320319">A</text>
-     </g>
-    </g>
-    <g id="ytick_2">
-     <g id="line2d_11">
-      <g>
-       <use x="26.561094" xlink:href="#m9ccd95d470" y="63.073047"/>
-      </g>
-     </g>
-     <g id="text_12">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 19.561094, 67.252188)" x="19.561094" y="67.252188">B</text>
-     </g>
-    </g>
-    <g id="ytick_3">
-     <g id="line2d_12">
-      <g>
-       <use x="26.561094" xlink:href="#m9ccd95d470" y="86.004916"/>
-      </g>
-     </g>
-     <g id="text_13">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 19.561094, 90.184056)" x="19.561094" y="90.184056">C</text>
-     </g>
-    </g>
-   </g>
-   <g id="text_14">
-    <text class="m-title" style="text-anchor:middle;" transform="rotate(-0, 295.340547, 21.757969)" x="295.340547" y="21.757969">Stacked plot</text>
-   </g>
-  </g>
- </g>
- <defs>
-  <clipPath id="p3be1189609">
-   <rect height="70.630156" width="537.558906" x="26.561094" y="27.757969"/>
-  </clipPath>
- </defs>
-</svg>
-</div>
-<div class="m-plot">
-<svg viewBox="0 0 576 113.76">
- <defs>
-  <style type="text/css">*{stroke-linecap:butt;stroke-linejoin:round;}</style>
- </defs>
- <g id="figure_1">
-  <g id="axes_1">
-   <g id="patch_1">
-    <path d="M 26.427031 69.588125 L 564.12 69.588125 L 564.12 27.757969 L 26.427031 27.757969 z" class="m-background"/>
-   </g>
-   <g id="plot4-value0-0"><title>111.9 ± 25.0 kB</title>
-    <path clip-path="url(#p49914ebfa5)" d="M 26.427031 29.659339 L 81.36204 29.659339 L 81.36204 46.560413 L 26.427031 46.560413 z" class="m-bar m-success"/>
-   </g>
-   <g id="plot4-value0-1"><title>74.4 ± 15.3 kB</title>
-    <path clip-path="url(#p49914ebfa5)" d="M 26.427031 50.785681 L 62.952185 50.785681 L 62.952185 67.686754 L 26.427031 67.686754 z" class="m-bar m-danger"/>
-   </g>
-   <g id="plot4-value1-0"><title>731.2 ± 200.0 kB</title>
-    <path clip-path="url(#p49914ebfa5)" d="M 81.36204 29.659339 L 440.329677 29.659339 L 440.329677 46.560413 L 81.36204 46.560413 z" class="m-bar m-info"/>
-   </g>
-   <g id="plot4-value1-1"><title>226.3 ± 5.0 kB</title>
-    <path clip-path="url(#p49914ebfa5)" d="M 62.952185 50.785681 L 174.049526 50.785681 L 174.049526 67.686754 L 62.952185 67.686754 z" class="m-bar m-primary"/>
-   </g>
-   <g id="matplotlib.axis_1">
-    <g id="xtick_1">
-     <g id="line2d_1">
-      <defs>
-       <path d="M 0 0 L 0 3.5" id="m61481b8dfb" class="m-line"/>
-      </defs>
-      <g>
-       <use x="26.427031" xlink:href="#m61481b8dfb" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_1">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 26.427031, 84.946406)" x="26.427031" y="84.946406">0</text>
-     </g>
-    </g>
-    <g id="xtick_2">
-     <g id="line2d_2">
-      <g>
-       <use x="124.612927" xlink:href="#m61481b8dfb" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_2">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 124.612927, 84.946406)" x="124.612927" y="84.946406">200</text>
-     </g>
-    </g>
-    <g id="xtick_3">
-     <g id="line2d_3">
-      <g>
-       <use x="222.798824" xlink:href="#m61481b8dfb" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_3">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 222.798824, 84.946406)" x="222.798824" y="84.946406">400</text>
-     </g>
-    </g>
-    <g id="xtick_4">
-     <g id="line2d_4">
-      <g>
-       <use x="320.98472" xlink:href="#m61481b8dfb" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_4">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 320.98472, 84.946406)" x="320.98472" y="84.946406">600</text>
-     </g>
-    </g>
-    <g id="xtick_5">
-     <g id="line2d_5">
-      <g>
-       <use x="419.170616" xlink:href="#m61481b8dfb" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_5">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 419.170616, 84.946406)" x="419.170616" y="84.946406">800</text>
-     </g>
-    </g>
-    <g id="xtick_6">
-     <g id="line2d_6">
-      <g>
-       <use x="517.356512" xlink:href="#m61481b8dfb" y="69.588125"/>
-      </g>
-     </g>
-     <g id="text_6">
-      <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 517.356512, 84.946406)" x="517.356512" y="84.946406">1000</text>
-     </g>
-    </g>
-    <g id="text_7">
-     <text class="m-label" style="text-anchor:middle;" transform="rotate(-0, 295.273516, 99.592344)" x="295.273516" y="99.592344">kB</text>
-    </g>
-   </g>
-   <g id="matplotlib.axis_2">
-    <g id="ytick_1">
-     <g id="line2d_7">
-      <defs>
-       <path d="M 0 0 L -3.5 0" id="m6e7aba3b4c" class="m-line"/>
-      </defs>
-      <g>
-       <use x="26.427031" xlink:href="#m6e7aba3b4c" y="38.109876"/>
-      </g>
-     </g>
-     <g id="text_8">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 19.427031, 42.289017)" x="19.427031" y="42.289017">A</text>
-     </g>
-    </g>
-    <g id="ytick_2">
-     <g id="line2d_8">
-      <g>
-       <use x="26.427031" xlink:href="#m6e7aba3b4c" y="59.236218"/>
-      </g>
-     </g>
-     <g id="text_9">
-      <text class="m-label" style="text-anchor:end;" transform="rotate(-0, 19.427031, 63.415358)" x="19.427031" y="63.415358">B</text>
-     </g>
-    </g>
-   </g>
-   <g id="LineCollection_1">
-    <path clip-path="url(#p49914ebfa5)" d="M 69.088803 38.109876 L 93.635277 38.109876" class="m-error"/>
-    <path clip-path="url(#p49914ebfa5)" d="M 55.440964 59.236218 L 70.463406 59.236218" class="m-error"/>
-   </g>
-   <g id="LineCollection_2">
-    <path clip-path="url(#p49914ebfa5)" d="M 342.143781 38.109876 L 538.515573 38.109876" class="m-error"/>
-    <path clip-path="url(#p49914ebfa5)" d="M 171.594879 59.236218 L 176.504174 59.236218" class="m-error"/>
-   </g>
-   <g id="line2d_9">
-    <defs>
-     <path d="M 0 5 L 0 -5" id="m8500f76974" class="m-error"/>
-    </defs>
-    <g clip-path="url(#p49914ebfa5)">
-     <use x="69.088803" xlink:href="#m8500f76974" y="38.109876"/>
-     <use x="55.440964" xlink:href="#m8500f76974" y="59.236218"/>
-    </g>
-   </g>
-   <g id="line2d_10">
-    <g clip-path="url(#p49914ebfa5)">
-     <use x="93.635277" xlink:href="#m8500f76974" y="38.109876"/>
-     <use x="70.463406" xlink:href="#m8500f76974" y="59.236218"/>
-    </g>
-   </g>
-   <g id="line2d_11">
-    <g clip-path="url(#p49914ebfa5)">
-     <use x="342.143781" xlink:href="#m8500f76974" y="38.109876"/>
-     <use x="171.594879" xlink:href="#m8500f76974" y="59.236218"/>
-    </g>
-   </g>
-   <g id="line2d_12">
-    <g clip-path="url(#p49914ebfa5)">
-     <use x="538.515573" xlink:href="#m8500f76974" y="38.109876"/>
-     <use x="176.504174" xlink:href="#m8500f76974" y="59.236218"/>
-    </g>
-   </g>
-   <g id="text_10">
-    <text class="m-title" style="text-anchor:middle;" transform="rotate(-0, 295.273516, 21.757969)" x="295.273516" y="21.757969">Stacked plot with errors and full colors</text>
-   </g>
-  </g>
- </g>
- <defs>
-  <clipPath id="p49914ebfa5">
-   <rect height="41.830156" width="537.692969" x="26.427031" y="27.757969"/>
-  </clipPath>
- </defs>
-</svg>
-</div>
-<!-- /content -->
-      </div>
-    </div>
-  </div>
-</article>
-</main>
-</body>
-</html>
index 0e9323527ba6dcace84d75b632cd0879fae80672..8261e4599f1b35ec06ee4b9892bcaccfcb9ab1d8 100644 (file)
 
 import matplotlib
 import os
+import re
 import sys
 import unittest
 
 from . import PelicanPluginTestCase, parse_version
 
+# Basically every matplotlib version causes the hashes to change, and 3.9.2 has
+# them also different on different machines. Yay software developers. Replace
+# them with a static string when comparing. The actual file is not changed in
+# order to make it possible to actually view it, it's only for the comparison.
+_normalize_hashes = re.compile('([mp])[0-9a-f]{10}')
+
 class Plots(PelicanPluginTestCase):
     def __init__(self, *args, **kwargs):
         super().__init__(__file__, '', *args, **kwargs)
@@ -46,8 +53,6 @@ class Plots(PelicanPluginTestCase):
             file = 'page.html'
         elif parse_version(matplotlib.__version__) >= parse_version('3.5'):
             file = 'page-35.html'
-        elif parse_version(matplotlib.__version__) >= parse_version('3.4'):
-            file = 'page-34.html'
         elif parse_version(matplotlib.__version__) >= parse_version('3.2'):
             file = 'page-32.html'
         elif parse_version(matplotlib.__version__) >= parse_version('3.0'):
@@ -55,4 +60,9 @@ class Plots(PelicanPluginTestCase):
         else:
             file = 'page-22.html'
 
-        self.assertEqual(*self.actual_expected_contents('page.html', file))
+        # The element hashes change wildly between versions, replace them with
+        # something stable before comparison
+        actual_contents, expected_contents = self.actual_expected_contents('page.html', file)
+        actual_contents = _normalize_hashes.sub(r'\1gggggggggg', actual_contents)
+        expected_contents = _normalize_hashes.sub(r'\1gggggggggg', expected_contents)
+        self.assertEqual(actual_contents, expected_contents)