1{ lib
2, buildPythonPackage
3, pytestCheckHook
4, fetchFromGitHub
5, fetchpatch
6, pythonOlder
7, setuptools-scm
8, setuptools
9, fast-histogram
10, matplotlib
11, numpy
12, wheel
13, pytest-mpl
14}:
15
16buildPythonPackage rec {
17 pname = "mpl-scatter-density";
18 version = "0.7";
19
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "astrofrog";
24 repo = pname;
25 rev = "refs/tags/v${version}";
26 sha256 = "sha256-MMxM+iv5p9ZLcBpqa3tBBPbsMM/PTg6BXaDpGgSw+DE=";
27 };
28
29 patches = [
30 # https://github.com/astrofrog/mpl-scatter-density/pull/37
31 (fetchpatch {
32 name = "distutils-removal.patch";
33 url = "https://github.com/ifurther/mpl-scatter-density/commit/6feedabe1e82da67d8eec46a80eb370d9f334251.patch";
34 sha256 = "sha256-JqWlSm8mIwqjRPa+kMEaKipJyzGEO+gJK+Q045N1MXA=";
35 })
36 ];
37
38 nativeBuildInputs = [
39 setuptools
40 setuptools-scm
41 wheel
42 ];
43
44 propagatedBuildInputs = [ matplotlib numpy fast-histogram ];
45
46 env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 pytest-mpl
51 ];
52
53 disabledTests = [
54 # AssertionError: (240, 240) != (216, 216)
55 # Erroneous pinning of figure DPI, sensitive to runtime environment
56 "test_default_dpi"
57 ];
58
59 pythonImportsCheck = [ "mpl_scatter_density" ];
60
61 meta = with lib; {
62 homepage = "https://github.com/astrofrog/mpl-scatter-density";
63 description = "Fast scatter density plots for Matplotlib";
64 license = licenses.bsd2;
65 maintainers = with maintainers; [ ifurther ];
66 };
67}