From 9f3e8a9f0b97939c5cc79f98842db3b7940954ed Mon Sep 17 00:00:00 2001 From: Reno Dakota <170618376+paparodeo@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:16:59 +0000 Subject: [PATCH] python312Packages.pytest-mpl: fix darwin fix checkphase on darwin to not access the display by using a workaround for matplotlib: https://github.com/matplotlib/matplotlib/issues/26292#issuecomment-1632887774 --- pkgs/development/python-modules/pytest-mpl/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/pytest-mpl/default.nix b/pkgs/development/python-modules/pytest-mpl/default.nix index 26cca96a3d42..d5bfa4402cbe 100644 --- a/pkgs/development/python-modules/pytest-mpl/default.nix +++ b/pkgs/development/python-modules/pytest-mpl/default.nix @@ -43,10 +43,13 @@ buildPythonPackage rec { "tests/subtests/test_subtest.py" ]; + # need to set MPLBACKEND=agg for headless matplotlib for darwin + # https://github.com/matplotlib/matplotlib/issues/26292 # The default tolerance is too strict in our build environment # https://github.com/matplotlib/pytest-mpl/pull/9 # https://github.com/matplotlib/pytest-mpl/issues/225 preCheck = '' + export MPLBACKEND=agg substituteInPlace pytest_mpl/plugin.py \ --replace-fail "DEFAULT_TOLERANCE = 2" "DEFAULT_TOLERANCE = 10" substituteInPlace tests/test_pytest_mpl.py \