Unverified Commit 9edc36f2 authored by Tom Hunze's avatar Tom Hunze
Browse files

python312Packages.mpl-scatter-density: fix build

parent ca8f7212
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  pytestCheckHook,
  fetchFromGitHub,
  fetchpatch,
  pythonOlder,
  setuptools-scm,
  setuptools,
@@ -12,12 +12,13 @@
  numpy,
  wheel,
  pytest-mpl,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "mpl-scatter-density";
  version = "0.8";
  format = "setuptools";
  pyproject = true;

  disabled = pythonOlder "3.6";

@@ -28,15 +29,6 @@ buildPythonPackage rec {
    sha256 = "sha256-pDiKJAN/4WFf5icNU/ZGOvw0jqN3eGZHgilm2oolpbE=";
  };

  patches = [
    # https://github.com/astrofrog/mpl-scatter-density/pull/37
    (fetchpatch {
      name = "distutils-removal.patch";
      url = "https://github.com/ifurther/mpl-scatter-density/commit/6feedabe1e82da67d8eec46a80eb370d9f334251.patch";
      sha256 = "sha256-JqWlSm8mIwqjRPa+kMEaKipJyzGEO+gJK+Q045N1MXA=";
    })
  ];

  nativeBuildInputs = [
    setuptools
    setuptools-scm
@@ -52,8 +44,13 @@ buildPythonPackage rec {
  nativeCheckInputs = [
    pytestCheckHook
    pytest-mpl
    writableTmpDirAsHomeHook
  ];

  # Need to set MPLBACKEND=agg for headless `matplotlib` on darwin.
  # https://github.com/matplotlib/matplotlib/issues/26292
  env.MPLBACKEND = lib.optionalString stdenv.hostPlatform.isDarwin "agg";

  disabledTests = [
    # AssertionError: (240, 240) != (216, 216)
    # Erroneous pinning of figure DPI, sensitive to runtime environment