summary refs log tree commit diff
path: root/pkgs/development/python-modules/termplotlib/default.nix
blob: 5ed244959eb1ef4482a832945b07329e1b09870c (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
{ lib
, substituteAll
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, exdown
, numpy
, gnuplot
, setuptools
}:

buildPythonPackage rec {
  pname = "termplotlib";
  version = "0.3.9";

  src = fetchFromGitHub {
    owner = "nschloe";
    repo = pname;
    rev = "v${version}";
    sha256 = "1qfrv2w7vb2bbjvd5lqfq57c23iqkry0pwmif1ha3asmz330rja1";
  };

  nativeBuildInputs = [
    setuptools
  ];

  format = "pyproject";
  nativeCheckInputs = [
    pytestCheckHook
    exdown
  ];
  pythonImportsCheck = [ "termplotlib" ];

  propagatedBuildInputs = [ numpy ];

  patches = [
    (substituteAll {
      src = ./gnuplot-subprocess.patch;
      gnuplot = "${gnuplot.out}/bin/gnuplot";
    })
  ];

  # The current gnuplot version renders slightly different test
  # graphs, with emphasis on slightly. The plots are still correct.
  # Tests pass on gnuplot 5.4.1, but fail on 5.4.2.
  disabledTests = [
    "test_plot"
    "test_nolabel"
  ];

  meta = with lib; {
    description = "matplotlib for your terminal";
    homepage = "https://github.com/nschloe/termplotlib";
    license = with licenses; [ gpl3Plus ];
    maintainers = with maintainers; [ thoughtpolice ];
  };
}