1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, pythonOlder
5, filelock
6, importlib-metadata
7, packaging
8, requests
9, ruamel-yaml
10, tqdm
11, typing-extensions
12}:
13
14buildPythonPackage rec {
15 pname = "huggingface-hub";
16 version = "0.0.18";
17
18 src = fetchFromGitHub {
19 owner = "huggingface";
20 repo = "huggingface_hub";
21 rev = "v${version}";
22 sha256 = "sha256-SxA7rAdKuSrSYFIuxG81lblPJOL69Yx4rBccVrbQa/g=";
23 };
24
25 nativeBuildInputs = [ packaging ];
26
27 propagatedBuildInputs = [
28 filelock
29 requests
30 ruamel-yaml
31 tqdm
32 typing-extensions
33 ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
34
35 # Tests require network access.
36 doCheck = false;
37 pythonImportsCheck = [ "huggingface_hub" ];
38
39 meta = with lib; {
40 homepage = "https://github.com/huggingface/huggingface_hub";
41 description = "Download and publish models and other files on the huggingface.co hub";
42 changelog = "https://github.com/huggingface/huggingface_hub/releases/tag/${version}";
43 license = licenses.asl20;
44 maintainers = with maintainers; [ ];
45 };
46}