1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 flit-core,
7 matplotlib,
8 pytest-xdist,
9 pytestCheckHook,
10 numpy,
11 pandas,
12 pythonOlder,
13 scipy,
14 statsmodels,
15}:
16
17buildPythonPackage rec {
18 pname = "seaborn";
19 version = "0.13.2";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "mwaskom";
26 repo = "seaborn";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-aGIVcdG/XN999nYBHh3lJqGa3QVt0j8kmzaxdkULznY=";
29 };
30
31 nativeBuildInputs = [ flit-core ];
32
33 propagatedBuildInputs = [
34 matplotlib
35 numpy
36 pandas
37 ];
38
39 passthru.optional-dependencies = {
40 stats = [
41 scipy
42 statsmodels
43 ];
44 };
45
46 nativeCheckInputs = [
47 pytest-xdist
48 pytestCheckHook
49 ];
50
51 disabledTests =
52 [
53 # requires internet connection
54 "test_load_dataset_string_error"
55 ]
56 ++ lib.optionals (!stdenv.hostPlatform.isx86) [
57 # overly strict float tolerances
58 "TestDendrogram"
59 ];
60
61 # All platforms should use Agg. Let's set it explicitly to avoid probing GUI
62 # backends (leads to crashes on macOS).
63 env.MPLBACKEND = "Agg";
64
65 pythonImportsCheck = [ "seaborn" ];
66
67 meta = with lib; {
68 description = "Statistical data visualization";
69 homepage = "https://seaborn.pydata.org/";
70 changelog = "https://github.com/mwaskom/seaborn/blob/master/doc/whatsnew/${src.rev}.rst";
71 license = with licenses; [ bsd3 ];
72 };
73}