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