2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-01-13 20:06:32 +00:00
|
|
|
, pathlib
|
2020-04-24 23:36:52 +00:00
|
|
|
, py-cpuinfo
|
2022-01-13 20:06:32 +00:00
|
|
|
, pytest
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
|
|
|
, statistics
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-benchmark";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "4.0.0";
|
2022-01-13 20:06:32 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ionelmc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-f9Ty4+5PycraxoLUSa9JFusV5Cot6bBWKfOGHZIRR3o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
py-cpuinfo
|
|
|
|
] ++ lib.optionals (pythonOlder "3.4") [
|
|
|
|
pathlib
|
|
|
|
statistics
|
|
|
|
];
|
|
|
|
|
|
|
|
# Circular dependency
|
|
|
|
doCheck = false;
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pytest_benchmark"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Pytest fixture for benchmarking code";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/ionelmc/pytest-benchmark";
|
2022-01-13 20:06:32 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|