python3Packages.fastcrc: init at 0.3.2

This commit is contained in:
Leah Amelia Chen 2024-05-17 10:26:58 +02:00
parent e7d631432f
commit 831c38e319
No known key found for this signature in database
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,59 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
rustPlatform,
pytestCheckHook,
pytest-benchmark,
nix-update-script,
}:
let
pname = "fastcrc";
version = "0.3.2";
src = fetchFromGitHub {
owner = "overcat";
repo = "fastcrc";
rev = "refs/tags/v${version}";
hash = "sha256-yLrv/zqsjgygJAIJtztwxlm4s9o9EBVsCyx1jUXd7hA=";
};
in
buildPythonPackage {
inherit pname version src;
pyproject = true;
disabled = pythonOlder "3.7";
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-wSE7548L+ymNjN9TfygAGY1BrssXOPGXlmE83wV7zb4=";
};
pythonImportsCheck = [ "fastcrc" ];
nativeCheckInputs = [
pytestCheckHook
pytest-benchmark
];
# Python source files interfere with testing
preCheck = ''
rm -r fastcrc
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Hyper-fast Python module for computing CRC(8, 16, 32, 64) checksum";
homepage = "https://fastcrc.readthedocs.io/en/latest/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ pluiedev ];
};
}

View File

@ -4323,6 +4323,8 @@ self: super: with self; {
fastapi-sso = callPackage ../development/python-modules/fastapi-sso { };
fastcrc = callPackage ../development/python-modules/fastcrc { };
fast-histogram = callPackage ../development/python-modules/fast-histogram { };
fastavro = callPackage ../development/python-modules/fastavro { };