1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, pythonOlder
5, filelock
6, importlib-metadata
7, packaging
8, pyyaml
9, requests
10, ruamel-yaml
11, tqdm
12, typing-extensions
13}:
14
15buildPythonPackage rec {
16 pname = "huggingface-hub";
17 version = "0.11.0";
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-d+X4hGt4K6xmRFw8mevKpZ6RDv+U1PJ8WbmdKGDbVNs=";
27 };
28
29 propagatedBuildInputs = [
30 filelock
31 packaging
32 pyyaml
33 requests
34 ruamel-yaml
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; [ ];
54 };
55}