Skip to content

[8.0] test: Python 3.14 and matplotlib 3.11 compatibility in test suite#8702

Open
chrisburr wants to merge 4 commits into
DIRACGrid:rel-v8r0from
chrisburr:fix/python-3.14-graph-imports-v8r0
Open

[8.0] test: Python 3.14 and matplotlib 3.11 compatibility in test suite#8702
chrisburr wants to merge 4 commits into
DIRACGrid:rel-v8r0from
chrisburr:fix/python-3.14-graph-imports-v8r0

Conversation

@chrisburr

Copy link
Copy Markdown
Member

Backport of #8695 to rel-v8r0.

Summary

  • Import graph modules via importlib.import_module / getattr instead of exec/eval. The exec/eval form raises NameError on Python 3.13+ (PEP 667); rel-v8r0 still used it, so this fix is only needed here.
  • Replace assertDictContainsSubset (removed in Python 3.12) with assertLessEqual(subset.items(), full.items()).
  • Accept multiple reference images in the plot comparison tests (referenceImages/compareToReferences).
  • Add matplotlib 3.11 reference images for all of rel-v8r0's plot tests (histograms, stacked line, pie, cumulative, quality, time-stacked bar, no-data, error), rendered from this branch's own plotting code.

exec/eval-based imports break on Python 3.13+ (PEP 667) with a NameError.
A plot is accepted when it matches any of several reference images, so a matplotlib upgrade that changes the rendering only needs an extra reference image (<stem>.<tag>.png) rather than replacing the existing one.
Rendered with the matplotlib shipped in DIRACOS for Python 3.14, so the plot comparison tests pass on both the previous and the new matplotlib.
@chrisburr chrisburr added the sweep:ignore Prevent sweeping from being ran for this PR label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant