1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cargo,
8 pkg-config,
9 rustPlatform,
10 rustc,
11
12 # buildInputs
13 openssl,
14 stdenv,
15 libiconv,
16}:
17
18buildPythonPackage rec {
19 pname = "hf-transfer";
20 version = "0.1.9";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "huggingface";
25 repo = "hf_transfer";
26 tag = "v${version}";
27 hash = "sha256-mcU3YuJVfuwBvtLfqceV3glcJcpjSX7M3VjvbvLCxZg=";
28 };
29
30 cargoDeps = rustPlatform.fetchCargoVendor {
31 inherit src;
32 name = "${pname}-${version}";
33 hash = "sha256-O4aKqVSShFpt8mdZkY3WV55j9CIczRSRkIMC7dJoGv0=";
34 };
35
36 build-system = [
37 cargo
38 pkg-config
39 rustPlatform.cargoSetupHook
40 rustPlatform.maturinBuildHook
41 rustc
42 ];
43
44 buildInputs =
45 [
46 openssl
47 ]
48 ++ lib.optionals stdenv.hostPlatform.isDarwin [
49 libiconv
50 ];
51
52 pythonImportsCheck = [ "hf_transfer" ];
53
54 env = {
55 OPENSSL_NO_VENDOR = true;
56 };
57
58 meta = {
59 description = "High speed download python library";
60 homepage = "https://github.com/huggingface/hf_transfer";
61 changelog = "https://github.com/huggingface/hf_transfer/releases/tag/v${version}";
62 license = lib.licenses.asl20;
63 maintainers = with lib.maintainers; [ GaetanLepage ];
64 };
65}