2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
hypothesis,
|
|
|
|
fetchPypi,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
cloudpickle,
|
|
|
|
cython,
|
|
|
|
jinja2,
|
|
|
|
numpy,
|
|
|
|
psutil,
|
|
|
|
pynvml,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
rich,
|
2024-04-21 15:54:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "scalene";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.5.41";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-akjxv9Qot2lGntZxkxfFqz65VboL1qduykfjyEg1Ivg=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cloudpickle
|
|
|
|
jinja2
|
|
|
|
psutil
|
|
|
|
pynvml
|
|
|
|
rich
|
|
|
|
];
|
|
|
|
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
hypothesis
|
|
|
|
numpy
|
|
|
|
];
|
|
|
|
|
|
|
|
# remove scalene directory to prevent pytest import confusion
|
|
|
|
preCheck = ''
|
|
|
|
rm -rf scalene
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "scalene" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High-resolution, low-overhead CPU, GPU, and memory profiler for Python with AI-powered optimization suggestions";
|
|
|
|
homepage = "https://github.com/plasma-umass/scalene";
|
|
|
|
changelog = "https://github.com/plasma-umass/scalene/releases/tag/v${version}";
|
|
|
|
mainProgram = "scalene";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ sarahec ];
|
|
|
|
};
|
|
|
|
}
|