Unverified Commit 925ca273 authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

python3Packages.scalene: 1.5.55 -> 2.1.4 (#501080)

parents 8b31678c 8c054089
Loading
Loading
Loading
Loading
+22 −11
Original line number Diff line number Diff line
@@ -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"
    ];
  };
}
})