Files
nixpkgs/pkgs/by-name/ir/ironcalc/python.nix
2026-09-18 18:40:12 +02:00

56 lines
820 B
Nix

{
python,
buildPythonPackage,
rustPlatform,
pkg-config,
bzip2,
zstd,
pytestCheckHook,
ironcalc,
}:
buildPythonPackage {
pname = "ironcalc";
inherit (ironcalc) src version;
pyproject = true;
postPatch = ''
cd bindings/python
'';
__structuredAttrs = true;
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (ironcalc) src;
hash = ironcalc.cargoHash;
};
cargoRoot = "../..";
env.PYO3_PYTHON = "${python}/bin/python3";
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
pkg-config
];
buildInputs = [
bzip2
zstd
];
doCheck = true;
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [ "ironcalc" ];
meta = ironcalc.meta // {
description = "Python bindings for IronCalc";
};
}