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

authored by Yohann Boniface and committed by GitHub 9eb33e76 dbb15ebb

+11 -17
+11 -17
pkgs/development/python-modules/mpl-scatter-density/default.nix
··· 1 1 { 2 2 lib, 3 + stdenv, 3 4 buildPythonPackage, 4 5 pytestCheckHook, 5 6 fetchFromGitHub, 6 - fetchpatch, 7 - pythonOlder, 8 7 setuptools-scm, 9 8 setuptools, 10 9 fast-histogram, ··· 12 11 numpy, 13 12 wheel, 14 13 pytest-mpl, 14 + writableTmpDirAsHomeHook, 15 15 }: 16 16 17 17 buildPythonPackage rec { 18 18 pname = "mpl-scatter-density"; 19 19 version = "0.8"; 20 - format = "setuptools"; 21 - 22 - disabled = pythonOlder "3.6"; 20 + pyproject = true; 23 21 24 22 src = fetchFromGitHub { 25 23 owner = "astrofrog"; 26 24 repo = pname; 27 25 tag = "v${version}"; 28 - sha256 = "sha256-pDiKJAN/4WFf5icNU/ZGOvw0jqN3eGZHgilm2oolpbE="; 26 + hash = "sha256-pDiKJAN/4WFf5icNU/ZGOvw0jqN3eGZHgilm2oolpbE="; 29 27 }; 30 28 31 - patches = [ 32 - # https://github.com/astrofrog/mpl-scatter-density/pull/37 33 - (fetchpatch { 34 - name = "distutils-removal.patch"; 35 - url = "https://github.com/ifurther/mpl-scatter-density/commit/6feedabe1e82da67d8eec46a80eb370d9f334251.patch"; 36 - sha256 = "sha256-JqWlSm8mIwqjRPa+kMEaKipJyzGEO+gJK+Q045N1MXA="; 37 - }) 38 - ]; 39 - 40 - nativeBuildInputs = [ 29 + build-system = [ 41 30 setuptools 42 31 setuptools-scm 43 32 wheel 44 33 ]; 45 34 46 - propagatedBuildInputs = [ 35 + dependencies = [ 47 36 matplotlib 48 37 numpy 49 38 fast-histogram ··· 52 41 nativeCheckInputs = [ 53 42 pytestCheckHook 54 43 pytest-mpl 44 + writableTmpDirAsHomeHook 55 45 ]; 46 + 47 + # Need to set MPLBACKEND=agg for headless `matplotlib` on darwin. 48 + # https://github.com/matplotlib/matplotlib/issues/26292 49 + env.MPLBACKEND = lib.optionalString stdenv.hostPlatform.isDarwin "agg"; 56 50 57 51 disabledTests = [ 58 52 # AssertionError: (240, 240) != (216, 216)