about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/seaborn/default.nix
blob: 267b6065ed735fb70ff8aa0c30ca71c4ab34a007 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{ lib
, stdenv
, buildPythonPackage
, fetchpatch
, fetchPypi
, flit-core
, matplotlib
, pytest-xdist
, pytestCheckHook
, numpy
, pandas
, pythonOlder
, scipy
}:

buildPythonPackage rec {
  pname = "seaborn";
  version = "0.12.2";
  format = "pyproject";

  disabled = pythonOlder "3.6";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-N0ZF82UJ0NyriVy6W0fa8Fhvd7/js2yXxgfbfaW+ATk=";
  };

  patches = [
    (fetchpatch {
      name = "fix-test-using-matplotlib-3.7.patch";
      url = "https://github.com/mwaskom/seaborn/commit/db7ae11750fc2dfb695457239708448d54e9b8cd.patch";
      hash = "sha256-LbieI0GeC/0NpFVxV/NRQweFjP/lj/TR2D/SLMPYqJg=";
    })
    (fetchpatch {
      name = "fix-pandas-deprecation.patch";
      url = "https://github.com/mwaskom/seaborn/commit/a48601d6bbf8381f9435be48624f1a77d6fbfced.patch";
      hash = "sha256-LuN8jn6Jo9Fvdl5iGZ2LgINYujSDvvs+hSclnadV1F4=";
    })
    (fetchpatch {
      name = "fix-tests-using-numpy-1.25.patch";
      url = "https://github.com/mwaskom/seaborn/commit/b6737d5aec9a91bb8840cdda896a7970e1830d56.patch";
      hash = "sha256-Xj82yyB5Vy2xKRl0ideDmJ5Zr4Xc+8cEHU/liVwMSvE=";
    })
  ];

  nativeBuildInputs = [
    flit-core
  ];

  propagatedBuildInputs = [
    matplotlib
    numpy
    pandas
    scipy
  ];

  nativeCheckInputs = [
    pytest-xdist
    pytestCheckHook
  ];

  disabledTests = [
    # requires internet connection
    "test_load_dataset_string_error"

    # per https://github.com/mwaskom/seaborn/issues/3431, we can enable this
    # once matplotlib releases version > 3.7.2
    "test_share_xy"
  ] ++ lib.optionals (!stdenv.hostPlatform.isx86) [
    # overly strict float tolerances
    "TestDendrogram"
  ];

  # All platforms should use Agg. Let's set it explicitly to avoid probing GUI
  # backends (leads to crashes on macOS).
  env.MPLBACKEND="Agg";

  pythonImportsCheck = [
    "seaborn"
  ];

  meta = with lib; {
    description = "Statistical data visualization";
    homepage = "https://seaborn.pydata.org/";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ fridh ];
  };
}