From 8e4b96a3be9db681c8269bfb5e532fe388ac0a2f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 8 May 2025 02:03:50 +0200 Subject: [PATCH] python312Packages.depyf: 0.18.0 -> 0.19.0 Diff: https://github.com/thuml/depyf/compare/v0.18.0...v0.19.0 Changelog: https://github.com/thuml/depyf/releases/tag/v0.19.0 --- .../python-modules/depyf/default.nix | 63 ++++++++++++++++--- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/depyf/default.nix b/pkgs/development/python-modules/depyf/default.nix index a47cc7fd78a9..3408fee712ec 100644 --- a/pkgs/development/python-modules/depyf/default.nix +++ b/pkgs/development/python-modules/depyf/default.nix @@ -1,20 +1,33 @@ { lib, + stdenv, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies astor, dill, filelock, + + # tests pytestCheckHook, + torch, + pythonAtLeast, }: buildPythonPackage rec { pname = "depyf"; - version = "0.18.0"; + version = "0.19.0"; + pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-uZ8MODvpSa5F1dYG/kRMcfN1tVpXuNayDnhWZw1SEw0="; + src = fetchFromGitHub { + owner = "thuml"; + repo = "depyf"; + tag = "v${version}"; + hash = "sha256-AGM5Pm0hhqOX9CY7dFijZLqhWmY7xnmKWakh4MUtOMs="; }; # don't try to read git commit @@ -23,19 +36,51 @@ buildPythonPackage rec { --replace-fail 'commit_id = get_git_commit_id()' 'commit_id = None' ''; - propagatedBuildInputs = [ + build-system = [ + setuptools + ]; + + dependencies = [ astor dill filelock ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + pytestCheckHook + torch + ]; + + disabledTestPaths = + [ + # if self.quitting: raise BdbQuit + # E bdb.BdbQuit + "tests/test_pytorch/test_pytorch.py" + ] + ++ lib.optionals (pythonAtLeast "3.13") [ + + # depyf.decompiler.DecompilationError: DecompilationError: Failed to decompile instruction ... + # NotImplementedError: Unsupported instruction: LOAD_FAST_LOAD_FAST + "tests/test_code_owner.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # E torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised: + # E CppCompileError: C++ compile error + "tests/test_pytorch/test_export.py" + "tests/test_pytorch/test_logging.py" + "tests/test_pytorch/test_simple_graph.py" + ]; + + # All remaining tests fail with: + # ValueError: invalid literal for int() with base 10: 'L1' + doCheck = !(pythonAtLeast "3.13"); pythonImportsCheck = [ "depyf" ]; - meta = with lib; { + meta = { description = "Decompile python functions, from bytecode to source code"; homepage = "https://github.com/thuml/depyf"; - license = licenses.mit; + changelog = "https://github.com/thuml/depyf/releases/tag/v${version}"; + license = lib.licenses.mit; }; }