Unverified Commit 9eb33e76 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

python312Packages.mpl-scatter-density: fix build (#404092)

parents dbb15ebb ff51c326
Loading
Loading
Loading
Loading
+11 −17
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  pytestCheckHook,
  fetchFromGitHub,
  fetchpatch,
  pythonOlder,
  setuptools-scm,
  setuptools,
  fast-histogram,
@@ -12,38 +11,28 @@
  numpy,
  wheel,
  pytest-mpl,
  writableTmpDirAsHomeHook,
}:

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

  disabled = pythonOlder "3.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "astrofrog";
    repo = pname;
    tag = "v${version}";
    sha256 = "sha256-pDiKJAN/4WFf5icNU/ZGOvw0jqN3eGZHgilm2oolpbE=";
    hash = "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 = [
  build-system = [
    setuptools
    setuptools-scm
    wheel
  ];

  propagatedBuildInputs = [
  dependencies = [
    matplotlib
    numpy
    fast-histogram
@@ -52,8 +41,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