{ lib, buildPythonPackage, fetchFromGitHub, rustPlatform, # nativeBuildInputs cargo, rustc, # optional-dependencies pandas, polars, pyarrow, # tests pytest-mock, pytestCheckHook, }: buildPythonPackage rec { pname = "fastexcel"; version = "0.18.0"; pyproject = true; src = fetchFromGitHub { owner = "ToucanToco"; repo = "fastexcel"; tag = "v${version}"; hash = "sha256-d55KHkY6kMuEcX1ApHZZbwnyjEObfPpMrxR+cQshi24="; }; cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src; hash = "sha256-ja8hYSq2BiajV/ZlN8EJEFypKzbv80w8iKij3yZst3M="; }; nativeBuildInputs = [ cargo rustPlatform.cargoSetupHook rustPlatform.maturinBuildHook rustc ]; maturinBuildFlags = [ "--features __maturin" ]; optional-dependencies = { pyarrow = [ pyarrow ]; pandas = [ pandas pyarrow ]; polars = [ polars ]; }; pythonImportsCheck = [ "fastexcel" "fastexcel._fastexcel" ]; preCheck = '' rm -rf python/fastexcel ''; nativeCheckInputs = [ pandas polars pyarrow pytest-mock pytestCheckHook ]; meta = { description = "Fast excel file reader for Python, written in Rust"; homepage = "https://github.com/ToucanToco/fastexcel/"; changelog = "https://github.com/ToucanToco/fastexcel/releases/tag/v${version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ GaetanLepage ]; }; }