nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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.6.0";
18
19 src = fetchFromGitHub {
20 owner = "huggingface";
21 repo = "huggingface_hub";
22 rev = "refs/tags/v${version}";
23 sha256 = "sha256-jR4aqMAAQJ5a7pOe3RpCtLgdm5JVVSPsBQtube6FeqM=";
24 };
25
26 nativeBuildInputs = [ packaging ];
27
28 propagatedBuildInputs = [
29 filelock
30 pyyaml
31 requests
32 ruamel-yaml
33 tqdm
34 typing-extensions
35 ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
36
37 # Tests require network access.
38 doCheck = false;
39 pythonImportsCheck = [ "huggingface_hub" ];
40
41 meta = with lib; {
42 homepage = "https://github.com/huggingface/huggingface_hub";
43 description = "Download and publish models and other files on the huggingface.co hub";
44 changelog = "https://github.com/huggingface/huggingface_hub/releases/tag/v${version}";
45 license = licenses.asl20;
46 maintainers = with maintainers; [ ];
47 };
48}