From c71ad753ca51734c8e583835958fa5176041449f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 11 Apr 2025 10:35:44 +0200 Subject: [PATCH] python312Packages.hf-xet: init at 1.0.3 --- .../python-modules/hf-xet/default.nix | 58 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 60 insertions(+) create mode 100644 pkgs/development/python-modules/hf-xet/default.nix diff --git a/pkgs/development/python-modules/hf-xet/default.nix b/pkgs/development/python-modules/hf-xet/default.nix new file mode 100644 index 000000000000..4b27b84b125d --- /dev/null +++ b/pkgs/development/python-modules/hf-xet/default.nix @@ -0,0 +1,58 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pkg-config, + rustPlatform, + openssl, +}: + +buildPythonPackage rec { + pname = "hf-xet"; + version = "1.0.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = "xet-core"; + tag = "v${version}"; + hash = "sha256-ZbLSPLRsRVSF9HD+R8k/GR7yq3Ej+c+AyYbyHhKOf3w="; + }; + + sourceRoot = "${src.name}/hf_xet"; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit + pname + version + src + sourceRoot + ; + hash = "sha256-gO5A457CJUdV7nfy69yliL6uqMu5Fc3rY2uXyMM/Na0="; + }; + + nativeBuildInputs = [ + pkg-config + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + ]; + + buildInputs = [ + openssl + ]; + + env.OPENSSL_NO_VENDOR = 1; + + pythonImportsCheck = [ "hf_xet" ]; + + # No tests (yet?) + doCheck = false; + + meta = { + description = "Xet client tech, used in huggingface_hub"; + homepage = "https://github.com/huggingface/xet-core/hf_xet"; + changelog = "https://github.com/huggingface/xet-core/releases/tag/v${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9353b1c7e320..a4469457ee2b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6204,6 +6204,8 @@ self: super: with self; { hf-transfer = callPackage ../development/python-modules/hf-transfer { }; + hf-xet = callPackage ../development/python-modules/hf-xet { }; + hfst = callPackage ../development/python-modules/hfst { }; hg-commitsigs = callPackage ../development/python-modules/hg-commitsigs { };