depot/third_party/nixpkgs/pkgs/development/python-modules/cramjam/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

59 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
rustPlatform,
stdenv,
libiconv,
hypothesis,
numpy,
pytest-xdist,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "cramjam";
version = "2.8.3";
pyproject = true;
src = fetchFromGitHub {
owner = "milesgranger";
repo = "pyrus-cramjam";
rev = "refs/tags/v${version}";
hash = "sha256-1KD5/oZjfdXav1ZByQoyyiDSzbmY4VJsSJg/FtUFdDE=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
hash = "sha256-Bp7EtyuLdLUfU3yvouNVE42klfqYt9QOwt+iGe521yI=";
};
buildAndTestSubdir = "cramjam-python";
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
];
buildInputs = lib.optional stdenv.isDarwin libiconv;
nativeCheckInputs = [
hypothesis
numpy
pytest-xdist
pytestCheckHook
];
pytestFlagsArray = [ "cramjam-python/tests" ];
disabledTestPaths = [ "cramjam-python/benchmarks/test_bench.py" ];
pythonImportsCheck = [ "cramjam" ];
meta = with lib; {
description = "Thin Python bindings to de/compression algorithms in Rust";
homepage = "https://github.com/milesgranger/pyrus-cramjam";
license = with licenses; [ mit ];
maintainers = with maintainers; [ veprbl ];
};
}