From 9bfe9c98e7cb4cd548e22221a463737e764bcfa4 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 25 Nov 2024 23:11:28 +0100 Subject: [PATCH] python312Packages.fastexcel: init at 0.12.1 --- .../python-modules/fastexcel/default.nix | 84 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 86 insertions(+) create mode 100644 pkgs/development/python-modules/fastexcel/default.nix diff --git a/pkgs/development/python-modules/fastexcel/default.nix b/pkgs/development/python-modules/fastexcel/default.nix new file mode 100644 index 000000000000..7eb217114bd6 --- /dev/null +++ b/pkgs/development/python-modules/fastexcel/default.nix @@ -0,0 +1,84 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + rustPlatform, + + # nativeBuildInputs + cargo, + rustc, + + # dependencies + pyarrow, + pythonOlder, + typing-extensions, + + # optional-dependencies + pandas, + polars, + + # tests + pytest-mock, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "fastexcel"; + version = "0.12.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "ToucanToco"; + repo = "fastexcel"; + tag = "v${version}"; + hash = "sha256-1BcArjhdbsYZ8VIz1FJYOLKSKQXOjLUXFonIXB+TfiY="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit pname version src; + hash = "sha256-JGDNqRF264hNAjQ9bwJnBsQgAcqJjreEbgRZAA58JnY="; + }; + + nativeBuildInputs = [ + cargo + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + rustc + ]; + + dependencies = + [ + pyarrow + ] + ++ lib.optionals (pythonOlder "3.9") [ + typing-extensions + ]; + + optional-dependencies = { + pandas = [ + pandas + ]; + polars = [ + polars + ]; + }; + + pythonImportsCheck = [ + "fastexcel" + ]; + + nativeCheckInputs = [ + pandas + polars + 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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eba465c9e2c1..6549ed1c8edd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4480,6 +4480,8 @@ self: super: with self; { faster-whisper = callPackage ../development/python-modules/faster-whisper { }; + fastexcel = callPackage ../development/python-modules/fastexcel { }; + fastimport = callPackage ../development/python-modules/fastimport { }; fastjet = callPackage ../development/python-modules/fastjet { };