2019-05-20 10:54:54 -04:00
|
|
|
{
|
|
|
|
lib,
|
2023-07-05 01:30:58 +09:00
|
|
|
stdenv,
|
2019-05-20 10:54:54 -04:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2022-01-21 10:05:31 +01:00
|
|
|
flit-core,
|
2019-05-20 10:54:54 -04:00
|
|
|
matplotlib,
|
2023-07-01 13:31:46 +09:00
|
|
|
matplotx,
|
2019-05-20 10:54:54 -04:00
|
|
|
numpy,
|
2020-10-10 19:14:13 +01:00
|
|
|
rich,
|
2021-08-01 11:11:21 +02:00
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2019-05-20 10:54:54 -04:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "perfplot";
|
2022-07-16 12:59:23 +02:00
|
|
|
version = "0.10.2";
|
2022-01-21 10:05:31 +01:00
|
|
|
format = "pyproject";
|
2023-07-01 21:40:55 +02:00
|
|
|
|
2021-08-01 11:11:21 +02:00
|
|
|
disabled = pythonOlder "3.7";
|
2019-05-20 10:54:54 -04:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nschloe";
|
2021-08-01 11:11:21 +02:00
|
|
|
repo = pname;
|
2022-07-16 12:59:23 +02:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-03 01:48:06 +01:00
|
|
|
hash = "sha256-bu6eYQukhLE8sLkS3PbqTgXOqJFXJYXTcXAhmjaq48g=";
|
2019-05-20 10:54:54 -04:00
|
|
|
};
|
2022-01-21 10:05:31 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ flit-core ];
|
2019-05-20 10:54:54 -04:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
matplotlib
|
2023-07-01 13:31:46 +09:00
|
|
|
matplotx
|
2019-05-20 10:54:54 -04:00
|
|
|
numpy
|
2020-10-10 19:14:13 +01:00
|
|
|
rich
|
2019-05-20 10:54:54 -04:00
|
|
|
];
|
|
|
|
|
2023-07-05 01:30:58 +09:00
|
|
|
# This variable is needed to suppress the "Trace/BPT trap: 5" error in Darwin's checkPhase.
|
|
|
|
# Not sure of the details, but we can avoid it by changing the matplotlib backend during testing.
|
|
|
|
env.MPLBACKEND = lib.optionalString stdenv.isDarwin "Agg";
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2019-05-20 10:54:54 -04:00
|
|
|
|
2023-07-01 21:40:55 +02:00
|
|
|
pythonImportsCheck = [ "perfplot" ];
|
2019-05-20 10:54:54 -04:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Performance plots for Python code snippets";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "https://github.com/nschloe/perfplot";
|
2023-07-01 21:40:55 +02:00
|
|
|
changelog = "https://github.com/nschloe/perfplot/releases/tag/v${version}";
|
2019-05-20 10:54:54 -04:00
|
|
|
license = licenses.mit;
|
2023-06-30 17:53:25 +02:00
|
|
|
maintainers = with maintainers; [ ];
|
2019-05-20 10:54:54 -04:00
|
|
|
};
|
|
|
|
}
|