1{ lib
2, substituteAll
3, buildPythonPackage
4, fetchFromGitHub
5, pytestCheckHook
6, exdown
7, numpy
8, gnuplot
9, setuptools
10}:
11
12buildPythonPackage rec {
13 pname = "termplotlib";
14 version = "0.3.9";
15
16 src = fetchFromGitHub {
17 owner = "nschloe";
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "1qfrv2w7vb2bbjvd5lqfq57c23iqkry0pwmif1ha3asmz330rja1";
21 };
22
23 nativeBuildInputs = [
24 setuptools
25 ];
26
27 format = "pyproject";
28 checkInputs = [
29 pytestCheckHook
30 exdown
31 ];
32 pythonImportsCheck = [ "termplotlib" ];
33
34 propagatedBuildInputs = [ numpy ];
35
36 patches = [
37 (substituteAll {
38 src = ./gnuplot-subprocess.patch;
39 gnuplot = "${gnuplot.out}/bin/gnuplot";
40 })
41 ];
42
43 # The current gnuplot version renders slightly different test
44 # graphs, with emphasis on slightly. The plots are still correct.
45 # Tests pass on gnuplot 5.4.1, but fail on 5.4.2.
46 disabledTests = [
47 "test_plot"
48 "test_nolabel"
49 ];
50
51 meta = with lib; {
52 description = "matplotlib for your terminal";
53 homepage = "https://github.com/nschloe/termplotlib";
54 license = with licenses; [ gpl3Plus ];
55 maintainers = with maintainers; [ thoughtpolice ];
56 };
57}