From 8c05408962940c504c6406efe488c4c342662699 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Mon, 16 Mar 2026 17:22:27 +0000 Subject: [PATCH] python3Packages.scalene: 1.5.55 -> 2.1.4 --- .../python-modules/scalene/default.nix | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/scalene/default.nix b/pkgs/development/python-modules/scalene/default.nix index aa0faee17031..17f46719c69e 100644 --- a/pkgs/development/python-modules/scalene/default.nix +++ b/pkgs/development/python-modules/scalene/default.nix @@ -12,6 +12,7 @@ psutil, pydantic, pytestCheckHook, + pyyaml, rich, setuptools-scm, setuptools, @@ -22,8 +23,8 @@ let owner = "emeryberger"; repo = "heap-layers"; name = "Heap-Layers"; - rev = "a2048eae91b531dc5d72be7a194e0b333c06bd4c"; - sha256 = "sha256-vl3z30CBX7hav/DM/UE0EQ9lLxZF48tMJrYMXuSulyA="; + tag = "v1.0.0"; + hash = "sha256-p+8aUC124Digv3c9fZ7lLHg6H8FXoAcAQxlYzf9TYbM="; }; printf-src = fetchFromGitHub { @@ -31,20 +32,20 @@ let repo = "printf"; name = "printf"; tag = "v4.0.0"; - sha256 = "sha256-tgLJNJw/dJGQMwCmfkWNBvHB76xZVyyfVVplq7aSJnI="; + hash = "sha256-tgLJNJw/dJGQMwCmfkWNBvHB76xZVyyfVVplq7aSJnI="; }; in -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "scalene"; - version = "1.5.55"; + version = "2.1.4"; pyproject = true; src = fetchFromGitHub { owner = "plasma-umass"; repo = "scalene"; - tag = "v${version}"; - hash = "sha256-aO7l/paYqbneDArAbXxptIlMGfvc1dAaFLucEj/7xbk="; + tag = "v${finalAttrs.version}"; + hash = "sha256-ISXD7QegTL0OvAGS7KYZAk9MAKTr0hMFe/9ws02Ykgk="; }; patches = [ @@ -52,6 +53,7 @@ buildPythonPackage rec { ]; prePatch = '' + mkdir vendor cp -r ${heap-layers-src} vendor/Heap-Layers mkdir vendor/printf cp ${printf-src}/printf.c vendor/printf/printf.cpp @@ -60,18 +62,19 @@ buildPythonPackage rec { sed -i 's/^#define vsnprintf vsnprintf_/\/\/&/' vendor/printf/printf.h ''; - nativeBuildInputs = [ + build-system = [ cython setuptools setuptools-scm ]; - propagatedBuildInputs = [ + dependencies = [ cloudpickle jinja2 numpy psutil pydantic + pyyaml rich ] ++ lib.optionals stdenv.hostPlatform.isLinux [ nvidia-ml-py ]; @@ -97,6 +100,14 @@ buildPythonPackage rec { "test_nested_package_relative_import" ]; + disabledTestPaths = [ + # Broken pipe + # https://github.com/plasma-umass/scalene/issues/1017 + "tests/test_coverup_50.py" + "tests/test_multiprocessing_spawn.py::TestReplacementSemLockPickling" + "tests/test_multiprocessing_spawn.py::TestSpawnModeIntegration" + ]; + # remove scalene directory to prevent pytest import confusion preCheck = '' rm -rf scalene @@ -107,7 +118,7 @@ buildPythonPackage rec { meta = { 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}"; + changelog = "https://github.com/plasma-umass/scalene/releases/tag/${finalAttrs.src.tag}"; mainProgram = "scalene"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ sarahec ]; @@ -122,4 +133,4 @@ buildPythonPackage rec { "aarch64-darwin" ]; }; -} +})