1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pkg-config,
6 rustPlatform,
7 openssl,
8}:
9
10buildPythonPackage rec {
11 pname = "hf-xet";
12 version = "1.1.10";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "huggingface";
17 repo = "xet-core";
18 tag = "v${version}";
19 hash = "sha256-dCyHRspViTIt8nc+KmmS6xJzL1oqRvCX4ndK2yGaf6A=";
20 };
21
22 sourceRoot = "${src.name}/hf_xet";
23
24 cargoDeps = rustPlatform.fetchCargoVendor {
25 inherit
26 pname
27 version
28 src
29 sourceRoot
30 ;
31 hash = "sha256-6XBKiMXTPtqbFtDVHZL23zYow/l6UYLjZOPPZdyKPwg=";
32 };
33
34 nativeBuildInputs = [
35 pkg-config
36 rustPlatform.cargoSetupHook
37 rustPlatform.maturinBuildHook
38 ];
39
40 buildInputs = [
41 openssl
42 ];
43
44 env.OPENSSL_NO_VENDOR = 1;
45
46 pythonImportsCheck = [ "hf_xet" ];
47
48 # No tests (yet?)
49 doCheck = false;
50
51 meta = {
52 description = "Xet client tech, used in huggingface_hub";
53 homepage = "https://github.com/huggingface/xet-core/tree/main/hf_xet";
54 changelog = "https://github.com/huggingface/xet-core/releases/tag/v${version}";
55 license = lib.licenses.asl20;
56 maintainers = with lib.maintainers; [ GaetanLepage ];
57 };
58}