about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/mpl-scatter-density/default.nix
blob: f0523c3594dcd731fe8f8ac2fd0048aade2794bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, buildPythonPackage
, pytestCheckHook
, fetchFromGitHub
, fetchpatch
, pythonOlder
, setuptools-scm
, setuptools
, fast-histogram
, matplotlib
, numpy
, wheel
, pytest-mpl
}:

buildPythonPackage rec {
  pname = "mpl-scatter-density";
  version = "0.7";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "astrofrog";
    repo = pname;
    rev = "refs/tags/v${version}";
    sha256 = "sha256-MMxM+iv5p9ZLcBpqa3tBBPbsMM/PTg6BXaDpGgSw+DE=";
  };

  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
    wheel
  ];

  propagatedBuildInputs = [ matplotlib numpy fast-histogram ];

  env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeCheckInputs = [
    pytestCheckHook
    pytest-mpl
  ];

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

  pythonImportsCheck = [ "mpl_scatter_density" ];

  meta = with lib; {
    homepage = "https://github.com/astrofrog/mpl-scatter-density";
    description = "Fast scatter density plots for Matplotlib";
    license = licenses.bsd2;
    maintainers = with maintainers; [ ifurther ];
  };
}