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