Files
nixpkgs/pkgs/development/python-modules/hf-xet/default.nix
T

59 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pkg-config,
rustPlatform,
openssl,
}:
buildPythonPackage (finalAttrs: {
pname = "hf-xet";
version = "1.3.2";
pyproject = true;
src = fetchFromGitHub {
owner = "huggingface";
repo = "xet-core";
tag = "v${finalAttrs.version}";
hash = "sha256-IiV+qsUiahJr/MA9oTULSUvFBEw/sw9DyzuGxXHHnoM=";
};
sourceRoot = "${finalAttrs.src.name}/hf_xet";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs)
pname
version
src
sourceRoot
;
hash = "sha256-+uz6bKAV99JmTIWVDXPEq0kPWQGIYL8dV17XN0TP6hY=";
};
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/tree/main/hf_xet";
changelog = "https://github.com/huggingface/xet-core/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})