1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 pytestCheckHook,
6 fetchFromGitHub,
7 setuptools-scm,
8 setuptools,
9 fast-histogram,
10 matplotlib,
11 numpy,
12 wheel,
13 pytest-mpl,
14 writableTmpDirAsHomeHook,
15}:
16
17buildPythonPackage rec {
18 pname = "mpl-scatter-density";
19 version = "0.8";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "astrofrog";
24 repo = "mpl-scatter-density";
25 tag = "v${version}";
26 hash = "sha256-pDiKJAN/4WFf5icNU/ZGOvw0jqN3eGZHgilm2oolpbE=";
27 };
28
29 build-system = [
30 setuptools
31 setuptools-scm
32 wheel
33 ];
34
35 dependencies = [
36 matplotlib
37 numpy
38 fast-histogram
39 ];
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 pytest-mpl
44 writableTmpDirAsHomeHook
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";
50
51 disabledTests = [
52 # AssertionError: (240, 240) != (216, 216)
53 # Erroneous pinning of figure DPI, sensitive to runtime environment
54 "test_default_dpi"
55 ];
56
57 pythonImportsCheck = [ "mpl_scatter_density" ];
58
59 meta = with lib; {
60 homepage = "https://github.com/astrofrog/mpl-scatter-density";
61 description = "Fast scatter density plots for Matplotlib";
62 license = licenses.bsd2;
63 maintainers = with maintainers; [ ifurther ];
64 };
65}