From e488bee4904bae7d779235134aeb6dc5c7f8a31b Mon Sep 17 00:00:00 2001 From: sarahec Date: Sun, 3 Mar 2024 13:22:08 -0800 Subject: [PATCH 1/2] maintainers: add sarahec --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 029397c5bac5..e56ba8e740c7 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -17326,6 +17326,12 @@ githubId = 92817635; name = "Sanskar Gurdasani"; }; + sarahec = { + email = "sarahec@nextquestion.net"; + github = "sarahec"; + githubId = 11277967; + name = "Sarah Clark"; + }; sarcasticadmin = { email = "rob@sarcasticadmin.com"; github = "sarcasticadmin"; From 982c5169b41b9e1f10983e3d92418ace4db79d13 Mon Sep 17 00:00:00 2001 From: sarahec Date: Sun, 3 Mar 2024 14:21:16 -0800 Subject: [PATCH 2/2] python311Packages.scalene: init at 1.5.38 --- .../python-modules/scalene/default.nix | 87 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 91 insertions(+) create mode 100644 pkgs/development/python-modules/scalene/default.nix diff --git a/pkgs/development/python-modules/scalene/default.nix b/pkgs/development/python-modules/scalene/default.nix new file mode 100644 index 000000000000..29a51e38b631 --- /dev/null +++ b/pkgs/development/python-modules/scalene/default.nix @@ -0,0 +1,87 @@ +{ lib +, buildPythonPackage +, hypothesis +, fetchpatch +, fetchPypi +, setuptools +, setuptools-scm +, cloudpickle +, cython +, jinja2 +, numpy +, psutil +, pynvml +, pytestCheckHook +, pythonOlder +, rich +}: + +buildPythonPackage rec { + pname = "scalene"; + version = "1.5.38"; + pyproject = true; + disabled = pythonOlder "3.9"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-LR1evkn2m6FNBmJnUUJubesxIPeHG6RDgLFBHDuxe38="; + }; + + patches = [ + # fix scalene_config import. remove on next update + (fetchpatch { + name = "scalene_config-import-fix.patch"; + url = "https://github.com/plasma-umass/scalene/commit/cd437be11f600ac0925ce77efa516e6d83934200.patch"; + hash = "sha256-YjFh+mu5jyIJYUQFhmGqLXhec6lgQAdj4tWxij3NkwU="; + }) + ]; + + nativeBuildInputs = [ + cython + setuptools + setuptools-scm + ]; + + propagatedBuildInputs = [ + cloudpickle + jinja2 + psutil + pynvml + rich + ]; + + __darwinAllowLocalNetworking = true; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + checkInputs = [ + hypothesis + numpy + ]; + + disabledTestPaths = [ + # remove on next update + # Failing Darwin-specific tests that were subsequently removed from the source repo. + "tests/test_coverup_35.py" + "tests/test_coverup_42.py" + "tests/test_coverup_43.py" + ]; + + # 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 30aced23bf3b..86e9e4bb074c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26823,6 +26823,8 @@ with pkgs; sampler = callPackage ../applications/misc/sampler { }; + scalene = with python3Packages; toPythonApplication scalene; + scalr-cli = callPackage ../tools/admin/scalr-cli { }; scaphandre = callPackage ../servers/scaphandre { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dc44a98191ce..e5fc2413189b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13299,6 +13299,8 @@ self: super: with self; { sasmodels = callPackage ../development/python-modules/sasmodels { }; + scalene = callPackage ../development/python-modules/scalene { }; + scales = callPackage ../development/python-modules/scales { }; scancode-toolkit = callPackage ../development/python-modules/scancode-toolkit { };