2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, substituteAll
|
2021-03-09 03:18:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, exdown
|
|
|
|
, numpy
|
|
|
|
, gnuplot
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "termplotlib";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.3.9";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nschloe";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "1qfrv2w7vb2bbjvd5lqfq57c23iqkry0pwmif1ha3asmz330rja1";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
format = "pyproject";
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
exdown
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
pythonImportsCheck = [ "termplotlib" ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
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"
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "matplotlib for your terminal";
|
|
|
|
homepage = "https://github.com/nschloe/termplotlib";
|
|
|
|
license = with licenses; [ gpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|