Files
2026-05-09 05:48:49 +00:00

64 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
hatchling,
numpy,
py7zr,
pytestCheckHook,
stdlib-list,
torch,
torchvision,
}:
buildPythonPackage (finalAttrs: {
pname = "fickling";
version = "0.1.11";
pyproject = true;
src = fetchFromGitHub {
owner = "trailofbits";
repo = "fickling";
tag = "v${finalAttrs.version}";
hash = "sha256-0tY7zmMW5zt1Cl+Id5BejcLCQmjeqwCJS/CbKijqXNQ=";
};
build-system = [
hatchling
];
dependencies = [
stdlib-list
];
pythonRelaxDeps = [ "stdlib-list" ];
optional-dependencies = {
torch = [
numpy
torch
torchvision
];
};
nativeCheckInputs = [
py7zr
pytestCheckHook
]
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
# Tests fail upstream in pytorch under python 3.14
doCheck = pythonOlder "3.14";
pythonImportsCheck = [ "fickling" ];
meta = {
description = "Python pickling decompiler and static analyzer";
homepage = "https://github.com/trailofbits/fickling";
changelog = "https://github.com/trailofbits/fickling/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [ sarahec ];
};
})