depot/third_party/nixpkgs/pkgs/development/python-modules/scalene/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

70 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, hypothesis
, fetchpatch
, fetchPypi
, setuptools
, setuptools-scm
, cloudpickle
, cython
, jinja2
, numpy
, psutil
, pynvml
, pytestCheckHook
, pythonOlder
, rich
}:
buildPythonPackage rec {
pname = "scalene";
version = "1.5.41";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchPypi {
inherit pname version;
hash = "sha256-akjxv9Qot2lGntZxkxfFqz65VboL1qduykfjyEg1Ivg=";
};
nativeBuildInputs = [
cython
setuptools
setuptools-scm
];
propagatedBuildInputs = [
cloudpickle
jinja2
psutil
pynvml
rich
];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
pytestCheckHook
];
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 ];
};
}