summary refs log tree commit diff
path: root/pkgs/development/python-modules/cufflinks/default.nix
blob: ed25c2c73717ba50b472865d259adc5928a87456 (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
{ lib, buildPythonPackage, fetchPypi, fetchpatch
, chart-studio
, colorlover
, ipython
, ipywidgets
, nose
, numpy
, pandas
, six
, statsmodels
}:

buildPythonPackage rec {
  pname = "cufflinks";
  version = "0.16";

  src = fetchPypi {
    inherit pname version;
    sha256 = "163lag5g4micpqm3m4qy9b5r06a7pw45nq80x4skxc7dcrly2ygd";
  };

  propagatedBuildInputs = [
    chart-studio
    colorlover
    ipython
    ipywidgets
    numpy
    pandas
    six
    statsmodels
  ];

  patches = [
    # Plotly 4 compatibility. Remove with next release, assuming it gets merged.
    (fetchpatch {
      url = "https://github.com/santosjorge/cufflinks/pull/202/commits/e291dce14181858cb457404adfdaf2624b6d0594.patch";
      sha256 = "1l0dahwqn3cxg49v3i3amwi80dmx2bi5zrazmgzpwsfargmk2kd1";
    })
  ];

  # in plotly4+, the plotly.plotly module was moved to chart-studio.plotly
  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "plotly>=3.0.0,<4.0.0a0" "chart-studio"
  '';

  checkInputs = [ nose ];

  checkPhase = ''
    nosetests -xv tests.py
  '';

  meta = with lib; {
    description = "Productivity Tools for Plotly + Pandas";
    homepage = "https://github.com/santosjorge/cufflinks";
    license = licenses.mit;
    maintainers = with maintainers; [ globin ];
  };
}