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";
|
2022-01-13 20:06:32 +00:00
|
|
|
version = "3.4.1";
|
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ionelmc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-13 20:06:32 +00:00
|
|
|
sha256 = "sha256-qc/8Epax5bPUZvhq42xSj6NUq0T4gbO5dDDS6omWBOU=";
|
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
|
|
|
};
|
|
|
|
}
|