nixpkgs/pkgs/development/python-modules/fastbencode/default.nix
2026-01-23 23:41:16 +00:00

56 lines
1.1 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
cargo,
rustc,
rustPlatform,
setuptools,
setuptools-rust,
python,
}:
buildPythonPackage rec {
pname = "fastbencode";
version = "0.3.9";
pyproject = true;
src = fetchFromGitHub {
owner = "breezy-team";
repo = "fastbencode";
tag = "v${version}";
hash = "sha256-TZGIFcWm037h4Xs6e5a9j24FqhNxP9H71QVtL1homjQ=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-4DP8WOho4CKESfQHynZlosafcGPFqjpaOiZfLkcML3A=";
};
nativeBuildInputs = [
cargo
rustPlatform.cargoSetupHook
rustc
];
build-system = [
setuptools
setuptools-rust
];
pythonImportsCheck = [ "fastbencode" ];
checkPhase = ''
runHook preCheck
${python.interpreter} -m unittest tests.test_suite
runHook postCheck
'';
meta = {
description = "Fast implementation of bencode";
homepage = "https://github.com/breezy-team/fastbencode";
changelog = "https://github.com/breezy-team/fastbencode/releases/tag/v${version}";
license = lib.licenses.gpl2Plus;
maintainers = [ ];
};
}